Skip to content

Measurements

Jordan Hollinger edited this page Jul 8, 2021 · 8 revisions

These measurements were made against Active Record 5.2 using an in-memory sqlite3 database. You may run them yourself by cloning this repo and running bundle exec rake bench.

Before running make sure you have run bundle install. This requires the Sqlite3 headers (apt-get install libsqlite3-dev on Ubuntu).

Speed Test

simple query
  ActiveRecord 1.03989845 sec
  OccamsRecord 0.23857913 sec
  336% improvement

belongs_to (many to one)
  ActiveRecord 2.03903914 sec
  OccamsRecord 0.36090831 sec
  465% improvement

belongs_to (one to one)
  ActiveRecord 4.11567396 sec
  OccamsRecord 1.03515957 sec
  298% improvement

has_many
  ActiveRecord 2.48180171 sec
  OccamsRecord 0.18858107 sec
  1216% improvement

Memory Test

simple query
  ActiveRecord 146730896 bytes
  OccamsRecord 41909064 bytes
  250% improvement

belongs_to (many to one)
  ActiveRecord 199358904 bytes
  OccamsRecord 45962808 bytes
  334% improvement

belongs_to (one to one)
  ActiveRecord 374657304 bytes
  OccamsRecord 119851299 bytes
  213% improvement

has_many
  ActiveRecord 181339440 bytes
  OccamsRecord 34089984 bytes
  432% improvement
Clone this wiki locally