[OpenLayers-Trac] Re: [OpenLayers] #2899: Remove overhead from OpenLayers.Class

OpenLayers trac-20090302 at openlayers.org
Fri Oct 22 16:04:18 EDT 2010

#2899: Remove overhead from OpenLayers.Class
 Reporter:  ahocevar         |       Owner:  tschaub     
     Type:  feature          |      Status:  new         
 Priority:  minor            |   Milestone:  2.11 Release
Component:  BaseTypes.Class  |     Version:  2.10        
 Keywords:                   |       State:  Commit      
Changes (by erilem):

  * state:  Review => Commit


 Andreas, with [attachment:Class.3.diff] {{{OpenLayers.inherit}}} doesn't
 {{{return C}}}, as I don't think this is needed. Tests continue to pass.
 You can commit if you agree with this change. But, naturally, feel also
 free to wait for Tim's review.

 Now why I'd be in favor to no longer use {{{OpenLayers.Class}}} in the

 (a) I still observe that "Pure !JavaScript" performs better than
 "{{{OpenLayers.Class}}}". [attachment:perf-type-instantiation.html] gives
 me the following results in FF3:

 --- Type Instantiation ---
 OpenLayers.Class 177.8
 Pure JavaScript 159.1
 Object Litteral 140

 (I'm still not sure why though.)

 (b) More importantly, defining types is a lot faster when not using
 {{{OpenLayers.Class}}}. So not using {{{OpenLayers.Class}}} will reduce
 the initial parsing of {{{OpenLayers.js}}}. [attachment:perf-type-
 definition.html] gives me the following results in FF3:

 --- Type Definition ---
 OpenLayers.Class 65.8
 Pure JavaScript 4.6

 Thanks a lot for the great collaboration on this!

Ticket URL: <http://trac.openlayers.org/ticket/2899#comment:11>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer

More information about the Trac mailing list