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

Runtime doesn't need to know properties name #90

Closed
giann opened this issue Oct 14, 2022 · 0 comments · Fixed by #301
Closed

Runtime doesn't need to know properties name #90

giann opened this issue Oct 14, 2022 · 0 comments · Fixed by #301
Labels
language Issue related to the language
Milestone

Comments

@giann
Copy link
Collaborator

giann commented Oct 14, 2022

Field access doesn't need to rely on a name lookup at runtime. It could be an index generated at compile time juste like we do for locals.

@giann giann added the language Issue related to the language label Oct 14, 2022
@giann giann added this to the 0.1.0 milestone Oct 14, 2022
@giann giann modified the milestones: 0.1.0, 0.2.0 Nov 17, 2022
@giann giann modified the milestones: 0.2.0, 0.1.0 Jan 26, 2023
@giann giann modified the milestones: 0.3.0, 0.4.0 Sep 25, 2023
@giann giann modified the milestones: 0.4.0, 0.5.0 May 14, 2024
giann added a commit that referenced this issue 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
giann added a commit that referenced this issue 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
giann added a commit that referenced this issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language Issue related to the language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant