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

Tagged enum usability & performance improvements #482

Merged
merged 3 commits into from
Aug 1, 2022

Conversation

cleaton
Copy link
Contributor

@cleaton cleaton commented Jul 26, 2022

  1. Support multiple units with same field names
  2. Move atom / tuple decode outside the type check if, to remove duplicate decode calls

Enum with 22 cases:
before:
tagged_enum_decode 1.56 M 642.48 ns ±1292.75% 634 ns 675 ns
after:
tagged_enum_decode 3.17 M 314.98 ns ±2092.02% 311 ns 343 ns

(~300ns is also the tagged_enum_encode latency on my machine)

@cleaton cleaton changed the title Untagged enum usability & performance Untagged enum usability & performance improvements Jul 26, 2022
@evnu evnu requested review from philss and a team July 26, 2022 10:14
@cleaton cleaton changed the title Untagged enum usability & performance improvements Tagged enum usability & performance improvements Jul 26, 2022
@evnu
Copy link
Member

evnu commented Jul 27, 2022

Thanks for the PR @cleaton! I will need some time to review this as I am on vacation :)

@cleaton
Copy link
Contributor Author

cleaton commented Jul 27, 2022

Thanks for the PR @cleaton! I will need some time to review this as I am on vacation :)

no problem, enjoy :)

Copy link
Member

@evnu evnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@evnu evnu removed the request for review from philss August 1, 2022 09:56
@evnu evnu merged commit 5037dd1 into rusterlium:master Aug 1, 2022
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.

2 participants