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

OpenLayers trac-20090302 at openlayers.org
Fri Oct 22 16:45:28 EDT 2010


#2899: Remove overhead from OpenLayers.Class
------------------------------+---------------------------------------------
  Reporter:  ahocevar         |       Owner:  tschaub     
      Type:  feature          |      Status:  closed      
  Priority:  minor            |   Milestone:  2.11 Release
 Component:  BaseTypes.Class  |     Version:  2.10        
Resolution:  fixed            |    Keywords:              
     State:  Complete         |  
------------------------------+---------------------------------------------

Comment(by ahocevar):

 @pwr: Of course you are right. If the purpose of variables is as obvious
 as here (similar to i in for loops), I think we can make an exception for
 the sake of saving bytes for the poor folks out there that don't use a js
 compressor that shortens variable names.

 @erilem: I ran the benchmark you created for (a) on my machine, and after
 several reloads I have to say that sometimes pure js, and sometimes
 OpenLayers.Class wins. The benchmark you created for (b) is unfair,
 because we do not have 10000 base classes in the library, only (educated
 guess) about 20. And to compare OpenLayers.Class and pure js for classes
 that inherit from other classes, you would also have to call
 OpenLayers.inherit in case 2 of (b). But again, I'm not against removing
 OpenLayers.Class in 3.0. Thanks for the cooperation on this! We just made
 class instantiation 10 times faster.

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


More information about the Trac mailing list