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

Proposal: Use a dedicated data type for stock symbols instead of String #54

Open
vultix opened this issue May 2, 2023 · 2 comments
Open

Comments

@vultix
Copy link

vultix commented May 2, 2023

Proposal: Use a stack-allocated dedicated Symbol type such as stock-symbol.

Benefits:

  • A dedicated type is more self-explanatory than passing around strings
  • Should be much faster than doing many tiny heap allocated String symbols
  • This will allow us to implement Copy, making many operations much simpler
  • Can provide additional validation of the underlying strings
@vultix
Copy link
Author

vultix commented May 2, 2023

I'd be willing to make a pull request if this is the way we want to go

@d-e-s-o
Copy link
Owner

d-e-s-o commented May 4, 2023

Thanks for bringing this up. Yeah, it probably makes sense to introduce such a type. But I'd suggest we define it ourselves instead of relying on a third-party crate such as stock-symbol. Could probably be as simple as a wrapper around [7; c_char] or something like that. Feel free to propose an implementation or prototype something.

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

No branches or pull requests

2 participants