File: constants.rb

# constants.rb

Path: | lib/merb-core/constants.rb
Last Update: | Tue Mar 03 13:34:13 -0700 2009

Most of this list is simply constants frozen for efficiency and lowered memory consumption. Every time Ruby VM comes across a string or a number or a regexp literal, new object is created.

This means if you refer to the same string 6 times per request and your application takes 100 requests per second, there are 600 objects for weak MRI garbage collector to work on.

GC cycles take up to 80% (!) time of request processing in some cases. Eventually Rubinius and maybe MRI 2.0 gonna improve this situation but at the moment, all commonly used strings, regexp and numbers used as constants so no extra objects created and VM just operates pointers.

[Validate]