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

feat(obj): Store properties and methods in a slice rather than a hashmap #301

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

giann
Copy link
Collaborator

@giann giann commented Jun 12, 2024

closes #90

We never needed to known the property name at runtime, this is an artifact of the 'Crafting Interpreters' heritage.

This results in a performance boost of about 40% on some benches:

Before:

→ hyperfine --warmup 10 'buzz tests/bench/001-btree.buzz 15 Benchmark 1: buzz tests/bench/001-btree.buzz 15
  Time (mean ± σ):      1.221 s ±  0.022 s    [User: 1.028 s, System: 0.174 s]
  Range (min … max):    1.195 s …  1.271 s    10 runs

After:

→ hyperfine --warmup 10 'buzz tests/bench/001-btree.buzz 15 Benchmark 1: buzz tests/bench/001-btree.buzz 15
  Time (mean ± σ):     795.5 ms ±   7.7 ms    [User: 725.1 ms, System: 62.9 ms]
  Range (min … max):   785.3 ms … 811.7 ms    10 runs

closes #90

We never needed to known the property name at runtime, this is an artifact of the 'Crafting Interpreters' heritage.

This results in a performance boost of about 40% on some benches:

Before:
→ hyperfine --warmup 10 'buzz tests/bench/001-btree.buzz 15
Benchmark 1: buzz tests/bench/001-btree.buzz 15
  Time (mean ± σ):      1.221 s ±  0.022 s    [User: 1.028 s, System: 0.174 s]
  Range (min … max):    1.195 s …  1.271 s    10 runs

After:
→ hyperfine --warmup 10 'buzz tests/bench/001-btree.buzz 15
Benchmark 1: buzz tests/bench/001-btree.buzz 15
  Time (mean ± σ):     795.5 ms ±   7.7 ms    [User: 725.1 ms, System: 62.9 ms]
  Range (min … max):   785.3 ms … 811.7 ms    10 runs
@giann giann merged commit 11ec46a into main Jun 12, 2024
3 of 4 checks passed
@giann giann deleted the obj-field-idx-fiber-start branch June 12, 2024 10:04
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.

Runtime doesn't need to know properties name
1 participant