Opened 13 years ago

Closed 13 years ago

#725 closed enhancement (invalid)

Optimizations for gs_ajax_utils.js

Reported by: zcarter Owned by: nobody
Priority: moderate Milestone: 3.05 Release
Component: Greenstone3 Runtime Severity: enhancement
Keywords: greenstone3, web, javascript, optimize Cc:

Description

I am unable to email these changes as I am at school, and I don't have Subversion write access (and the school computers don't have SVN anyway).

The changes are:

  • Changed multiple concatenations into creation of lists (they are joined when returned). This is faster as in Javascript, strings are immutable.
  • Changed postfix increments to prefix increments where possible; slight performance boost.
  • Changed multi-line functions into one-liners where possible (avoids variable allocation, etc.)
  • Fixed inconsistencies in coding style (all four-spaces instead of mixed, whitespace added, etc.)
  • Removed unneeded whitespace.

Included is a diff file, and the actual file itself.

Attachments (2)

gs_ajax_utils.diff (5.5 KB ) - added by zcarter 13 years ago.
.diff file
gs_ajax_utils.js (3.3 KB ) - added by zcarter 13 years ago.
Hard-copy of new file; I don't trust OS X's diff tool.

Download all attachments as: .zip

Change History (3)

by zcarter, 13 years ago

Attachment: gs_ajax_utils.diff added

.diff file

by zcarter, 13 years ago

Attachment: gs_ajax_utils.js added

Hard-copy of new file; I don't trust OS X's diff tool.

comment:1 by zcarter, 13 years ago

Resolution: invalid
Status: newclosed

Sorry for doubling-up on the ticket; I thought it hadn't gone through. See ticket 724. http://trac.greenstone.org/ticket/724

Note: See TracTickets for help on using tickets.