[Ironruby-core] Code Review: SingletonOptimizations
Tomas.Matousek at microsoft.com
Fri Feb 12 00:54:18 EST 2010
tfpt review "/shelveset:SingletonOptimizations;REDMOND\tomat"
Optimizes allocation of singletons. Module singletons could be allocated lazily. We used to eagerly allocate a singleton for each allocated RubyModule. This is only necessary for classes. Their singletons are chained in the inheritance hierarchy parallel to the hierarchy of the classes. A module doesn't have a super-class and thus we don't need to create a singleton for it unless it has some members. Consequently 2 modules of the same meta-module type with no singletons can share the same call-site rules. This sharing significantly improves RoR request time and reduces working set since the request processing code is using such modules.
Also fixes a few related minor bugs.
Initialized in 7.64449s
10000 requests: 337 requests per second
Peak working set: 216MB
Initialized in 6.966271s
10000 requests: 1132 requests per second
Peak working set: 91MB
Initialized in 26.106867s
10000 requests: 1243 requests per second
Peak working set: 89MB
Initialized in 2.82389s
10000 requests: 1623 requests per second
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 82586 bytes
More information about the Ironruby-core