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

Improve runtime performance #77

Merged
merged 15 commits into from
Jul 11, 2021
Merged

Improve runtime performance #77

merged 15 commits into from
Jul 11, 2021

Conversation

orsinium
Copy link
Member

@orsinium orsinium commented Jul 9, 2021

No description provided.

@orsinium orsinium changed the title WIP Improving runtime performance Improve runtime performance Jul 9, 2021
@orsinium
Copy link
Member Author

orsinium commented Jul 9, 2021

2-3 times faster now, with a bit slower decoration. Good.

Before:

# import
  5kk loops, best of 5: 82.244 ns

# CLASSIC CONTRACTS
# decorate
  20k loops, best of 5: 13.685 us
# call
  200k loops, best of 5: 980.015 ns
# call with args
  200k loops, best of 5: 1.644 us
# contract error
  20k loops, best of 5: 11.129 us

# VAA SIMPLE
# decorate
  10k loops, best of 5: 25.485 us
# call
  20k loops, best of 5: 11.328 us
# call with args
  20k loops, best of 5: 19.045 us
# contract error
  20k loops, best of 5: 13.434 us

After:

# import
  5kk loops, best of 5: 82.693 ns

# CLASSIC CONTRACTS
# decorate
  20k loops, best of 5: 16.98 us
# call
  500k loops, best of 5: 688.965 ns
# call with args
  200k loops, best of 5: 1.171 us
# contract error
  50k loops, best of 5: 4.212 us

# VAA SIMPLE
# decorate
  10k loops, best of 5: 26.283 us
# call
  50k loops, best of 5: 4.106 us
# call with args
  50k loops, best of 5: 6.486 us
# contract error
  50k loops, best of 5: 5.627 us

@orsinium
Copy link
Member Author

Made decoration 3 times faster as well by deferring init of everything that can be deferred. Also, read signature once. lru_cache stays, it helps if there are multiple contracts for one function.

@orsinium orsinium merged commit b586eda into master Jul 11, 2021
@orsinium orsinium deleted the performance branch July 11, 2021 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant