Commit d3951dfa authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Don't use delegate to delegate trivial methods

Around 300 ms (in total) would be spent in these delegated methods due
to the extra stuff ActiveSupport adds to the compiled methods. Because
these delegations are so simple we can just manually define the methods,
saving around 275 milliseconds.
parent 27adae93d9c3
...@@ -47,7 +47,17 @@ def self.referenced_by(node) ...@@ -47,7 +47,17 @@ def self.referenced_by(node)
{ object_sym =>, node.attr(data_reference)) } { object_sym =>, node.attr(data_reference)) }
end end
delegate :object_class, :object_sym, :references_in, to: :class def object_class
def object_sym
def references_in(*args, &block)
self.class.references_in(*args, &block)
def find_object(project, id) def find_object(project, id)
# Implement in child class # Implement in child class
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment