erigon-pulse/crypto
Victor Shyba 158fb2b606
Optimize memory buffer, simplify set32, use sha256-simd (#7060)
Hi,

I'm syncing Gnosis on a Celeron N5100 to get familiar with the codebase.
In the process I managed to optimize some things from profiling.
Since I'm not yet on the project Discord, I decided to open this PR as a
suggestion. This pass all tests here and gave me a nice boost for that
platform, although I didn't have time to benchmark it yet.

* reuse VM Memory objects with sync.Pool. It starts with 4k as `evmone`
[code
suggested](0897edb001/lib/evmone/execution_state.hpp (L49))
as a good value.
* set32 simplification: mostly cosmetic
* sha256-simd: Celeron has SHA instructions. We should probably do the
same for torrent later, but this already helped as it is very CPU bound
on such a low end processor. Maybe that helps ARM as well.
2023-03-14 07:17:04 +00:00
..
blake2b Refactoring To Increase Code Quality (#4842) 2022-08-04 20:23:00 +07:00
bls12381 Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
bn256 Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
cryptopool use crypto pool (#6197) 2022-12-04 11:59:02 +07:00
ecies Optimize memory buffer, simplify set32, use sha256-simd (#7060) 2023-03-14 07:17:04 +00:00
crypto_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
crypto.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
signature_cgo.go Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
signature_nocgo.go Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
signature_test.go Refactor crypto.FromECDSAPub to MarshalPubkey/Std (#3797) 2022-03-31 11:06:20 +07:00