apca
apca copied to clipboard
Proposal: Use a dedicated data type for stock symbols instead of String
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
Stringsymbols - This will allow us to implement
Copy, making many operations much simpler - Can provide additional validation of the underlying strings
I'd be willing to make a pull request if this is the way we want to go
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.