数星期前在 twitter, Discourse 大神 SamSaffron 和 Jeff Atwood 发牢骚对 Rails Performance 的不满。
结果出现了这个 Post.
https://samsaffron.com/archive/2018/06/01/an-analysis-of-memory-bloat-in-active-record-5-2
及后引发了
https://mobile.twitter.com/samsaffron/status/1002446941156884480 https://mobile.twitter.com/codinghorror/status/1002680669925924864
虽然引起很多人的不满,不过至少 Ruby / Rails 对 malloc 的问题又再正视了。( Discourse 现时正赞助 Eric Wong 解决很多 Ruby 速度的问题 )
然后 Jeff Atwood 就出现了个 idea, 加速甚至取替 Active Record. Mini_SQL 就是这个成果
https://github.com/discourse/mini_sql
暂时看来速度快得惊人,不过只支援 Pg.
Comparison:
# wide topic mini sql: 7535.8 i/s
# wide topic pg: 7345.1 i/s - same-ish: difference falls within error
# wide topic sequel: 3449.4 i/s - 2.18x slower
# wide topic ar: 2382.9 i/s - 3.16x slower
# sequel title id pluck: 1181.0 i/s
# mini_sql query_single title id: 1171.1 i/s - same-ish: difference falls within error
# mini_sql select title id: 1105.6 i/s - 1.07x slower
# pg select title id: 1002.2 i/s - 1.18x slower
# sequel title id select: 916.8 i/s - 1.29x slower
# ar select title id pluck: 696.2 i/s - 1.70x slower
# ar select title id: 131.6 i/s - 8.98x slower