Making ActiveResource 34x faster: QActiveResource
blog.directededge.com
blog.directededge.com
module HashAccessor
def method_missing(method)
value = self[method] || self[method.to_s]
raise NoMethodError.new unless value
value
end
end
Hash.send :include, HashAccessor
module ActiveResource
class Base
def self.find(from=nil, params={})
resource = from == :all ? self.collection_name : self.element_name
values = QAR::Resource.new(self.site.to_s, resource).find(from, params)
end
end
endWell done! And thank you for open sourcing this.
Well done!
http://doc.qt.nokia.com/4.6/classes.html
It was fairly recent that Nokia bought them; before that Trolltech was an independant company.
My company noticed an absolutely whopping performance boost when we dropped XML in favor of JSON for a transport format, fwiw. Ruby has quite possibly the slowest XML parsing libraries on the block (even when you wrap libxml), and we avoid parsing XML at all costs now.
More people should look at it. Even the datastructures are pretty much a joy to use.