Opened 11 years ago

Last modified 3 months ago

#724 new enhancement

Optimizations for gs_ajax_utils.js

Reported by: zcarter Owned by: zcarter
Priority: moderate Milestone: 3.11 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.js (3.0 KB ) - added by zcarter 11 years ago.
Fixed newOpenTag. Fixed a coding style inconsistency.
gs_ajax_utils.diff (6.4 KB ) - added by zcarter 11 years ago.
diff file.

Download all attachments as: .zip

Change History (6)

comment:1 by zcarter, 11 years ago

Owner: changed from nobody to zcarter

by zcarter, 11 years ago

Attachment: gs_ajax_utils.js added

Fixed newOpenTag. Fixed a coding style inconsistency.

by zcarter, 11 years ago

Attachment: gs_ajax_utils.diff added

diff file.

comment:2 by zcarter, 11 years ago

Updated gs_ajax_utils.js again; coding inconsistency with an if statement and added a join() call to newOpenTag.

comment:3 by sjm84, 10 years ago

Milestone: 3.05 Release3.06 Release

Several optimizations have been made but as this is only used in one minor feature we will move this back to the 3.06 release.

comment:4 by kjdon, 3 months ago

Milestone: 3.10 Release3.11 Release

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.