Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing performance benchmark comparison #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cdgriffith
Copy link

@cdgriffith cdgriffith commented Mar 16, 2022

There is unfortunately a fundamental flaw in the benchmarks, is that they all have the initialization as part of the process. Here is a quick example of how breaking that part out of it changes the benchmarks drastically.

Raw run:

#  <class 'addict.addict.Dict'>  -  get :  1197604715  ops per second.
.#  <class 'addict.addict.Dict'>  -  get through list :  647249139  ops per second.
.#  <class 'addict.addict.Dict'>  -  instantiate :  773292  ops per second.
.#  <class 'addict.addict.Dict'>  -  set :  130434783  ops per second.
.#  <class 'addict.addict.Dict'>  -  set through list :  91240875  ops per second.
.#  <class 'box.box.Box'>  -  get :  57853629  ops per second.
.#  <class 'box.box.Box'>  -  get through list :  25509119  ops per second.
.#  <class 'box.box.Box'>  -  instantiate :  382330  ops per second.
.#  <class 'box.box.Box'>  -  set :  29902815  ops per second.
.#  <class 'box.box.Box'>  -  set through list :  18625442  ops per second.
.#  <class 'scalpl.scalpl.Cut'>  -  get :  71882113  ops per second.
.#  <class 'scalpl.scalpl.Cut'>  -  get through list :  37406484  ops per second.
.#  <class 'scalpl.scalpl.Cut'>  -  instantiate :  367421940  ops per second.
.#  <class 'scalpl.scalpl.Cut'>  -  set :  68681318  ops per second.
.#  <class 'scalpl.scalpl.Cut'>  -  set through list :  40647652  ops per second.
.#  <class 'dict'>  -  get :  1675977835  ops per second.
.#  <class 'dict'>  -  get through list :  746268647  ops per second.
.#  <class 'dict'>  -  instantiate :  612870255  ops per second.
.#  <class 'dict'>  -  set :  1388888605  ops per second.
.#  <class 'dict'>  -  set through list :  798934707  ops per second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant