Ticket #724 (new enhancement)

Opened 7 years ago

Last modified 6 years ago

Optimizations for gs_ajax_utils.js

Reported by: zcarter Owned by: zcarter
Priority: moderate Milestone: 3.09 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

gs_ajax_utils.js Download (3.0 KB) - added by zcarter 7 years ago.
Fixed newOpenTag. Fixed a coding style inconsistency.
gs_ajax_utils.diff Download (6.4 KB) - added by zcarter 7 years ago.
diff file.

Change History

Changed 7 years ago by zcarter

  • owner changed from nobody to zcarter

Changed 7 years ago by zcarter

Fixed newOpenTag. Fixed a coding style inconsistency.

Changed 7 years ago by zcarter

diff file.

Changed 7 years ago by zcarter

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

Changed 6 years ago by sjm84

  • milestone changed from 3.05 Release to 3.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.

Note: See TracTickets for help on using tickets.