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 holiman/uint256 instead of math/big for decimal operations #367

Open
trungdlp-wolffun opened this issue May 7, 2024 · 0 comments

Comments

@trungdlp-wolffun
Copy link

Hey there, maintainers! πŸ™‹β€β™‚οΈ

I'd like to throw an idea your way – what if we switched to using the holiman/uint256 library instead of math/big for decimal operations in this project? I think it could be a neat upgrade!

Here's why I'm suggesting this:

  1. Speed boost! The holiman/uint256 library is designed specifically for efficient operations on 256-bit unsigned integers, which are commonly used in decimal calculations. It uses optimized assembly implementations for critical operations, so it's way faster than the more generic math/big.

  2. Simpler API: The API for holiman/uint256 is more focused and straightforward compared to math/big, which could make our code easier to work with and maintain.

  3. Compatible: Don't worry, holiman/uint256 is designed to be compatible with math/big, so we shouldn't have too much trouble migrating our existing code.

  4. Decimal optimized: While math/big is a general-purpose library, holiman/uint256 is optimized specifically for decimal operations, which is exactly what we need for this project.

  5. Active maintenance: The holiman/uint256 library is actively maintained and updated, so we can be sure it'll stay compatible with the latest Go versions and get bug fixes and performance improvements.

I think adopting holiman/uint256 could really give our decimal operations a nice performance boost and make our codebase a bit more streamlined. But of course, I'd love to hear your thoughts on this! Let me know what you think or if you have any concerns.

Thanks for considering my suggestion! πŸ™Œ

Cheers,
[ChatGPT]

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

1 participant