This project is archived and is in readonly mode.
Avoid excessive AST traversal for Routing
-
Mike Burns
How much of a speedup does this gain?
I just ran some self.z= vs. @z= micro-benchmarks and had to run a large number of these before I saw an obvious difference.
ruby 1.8.6 (2007-09-24 patchlevel 111) [amd64-freebsd7]
-
Lourens Naudé
Mike,
I'll attach benchmarks in a bit.
We've got 5 namespaces, each with 10 to 15 odd controllers.
Each map.resources spawns 14 routes ( excluding custom via :collection or :member ) by default.
class Bar
attr_accessor :foo
def method_a
self.foo #method lookup
end
def method_b
foo #method lookup
end
def method_c
@foo #no method lookup
end
end
Routing, especially with a large routes.rb file, features prominently in profiler output as well as bleakhouse dumps.
Bottom line being you'd notice no difference with a limited number of routes.
-
Pratik
- State changed from new to invalid
-1 on this. If you insists, please do disuss in rails core mailing list.
Thanks.
-
Evan
BleakHouse has nothing to do with runtime performance.
I'm them having trouble imagining that is change makes a difference on real apps, and it makes the code harder to understand and introspect.
-
Lourens Naudé
Thanks for time spent in reviewing this.