Skip to content

Slightly improve perf of internal Maybe type #157

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

Merged
merged 1 commit into from
May 11, 2022
Merged

Slightly improve perf of internal Maybe type #157

merged 1 commit into from
May 11, 2022

Conversation

chriskrycho
Copy link
Collaborator

  • Switch to having a single instance of the Nothing type.
  • Similarly, make sure there is only a single constant value for the Just type discriminant, even though the instance must be constructed dynamically per each value it wraps.
  • Update to use constant numbers as sentinel values instead of strings.

This is, even all combined, a very small win... but it isn't zero!

- Switch to having a single instance of the Nothing type.
- Similarly, make sure there is only a single constant value for the
  Just type discriminant, even though the instance must be constructed
  dynamically per each value it wraps.
- Update to use constant numbers as sentinel values instead of strings.

This is, even all combined, a *very* small win... but it isn't zero!
@chriskrycho chriskrycho added the enhancement New feature or request label May 11, 2022
@chriskrycho chriskrycho merged commit 6a3fe39 into main May 11, 2022
@chriskrycho chriskrycho deleted the perf branch May 11, 2022 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant