-
Notifications
You must be signed in to change notification settings - Fork 247
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
First parameter of galDivide is always 1 #253
Comments
Good observation. It simplifies down to something like this:
If it was super-hot we could eliminate the |
Feel free to close the issue, thanks. |
@cristaloleg I am sending in a PR.. I was mainly saying "adding a separate table isn't worth it". |
As note by @cristaloleg in #253 the first parameter is always 1 in uses of `galDivide`. Implement a `galOneOver` that uses this fact and replace `galDivide`. Make `expTable` fixed size and cast to uint8 to avoid bounds check on use.
Ah, my bad. |
@cristaloleg Actually |
Nice! By the way,
|
The XOR is so fast that I don't really see any point in adding 256 bytes to binaries just for that. |
* Use faster division for matrix construction * Remove needless 0 check. As note by @cristaloleg in #253 the first parameter is always 1 in uses of `galDivide`. Implement a `galOneOver` that uses this fact and replace `galDivide`. Make `expTable` fixed size and cast to uint8 to avoid bounds check on use.
#254 Merged |
Hi, I was scrolling through the code and found that
galDivide
1st param is always1
(4 usages in code and 1 in tests).reedsolomon/galois.go
Line 873 in 3db84f1
This func doesn't look like a hot function, but maybe propagating a const might give a small benefit (smaller binary, caching, etc.). WDYT?
Thanks.
The text was updated successfully, but these errors were encountered: