So I still have a *ton* of work to do, and this code is not particularly well optimized (or complete), but my naive PoC for this is showing nearly a 2x speedup for Active Record. (measuring `Post.all.each(&:attributes)` on 1k records)
-
-
The only easy win I see left is if Ruby had an equivalent of `HashMap::with_capacity` (or `rb_ary_new_capa` on their end), as ~3% of time is spend re-allocating a hashmap with a known size
-
Though this is also in the benchmark for `ActiveRecord::Base#attributes` which literally nobody calls, but is a good proxy for "I read all of the fields on this thing"
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.