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

OpenLayers trac-20090302 at openlayers.org
Fri Oct 22 16:56:36 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 erilem):

 > @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.

 You're right that my bench isn't representative of what we have in the
 lib, but the thing is: defining a type with {{{OpenLayers.Class}}} is ~13x
 slower than defining it with plain !JavaScript. I'll try to come up with
 realistic benchmarks. I'd like to be sure that it's worth editing 250+
 files :-)

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

More information about the Trac mailing list