amazon-ion / ion-hash-python

A Python implementation of Amazon Ion Hash.
https://amazon-ion.github.io/ion-hash/
Apache License 2.0
10 stars 7 forks source link

Determine whether precomputing certain `bytes` can improve speed of `ion_hash()` #23

Closed popematt closed 3 years ago

popematt commented 3 years ago

Should we avoid recomputing bytes([...]) on each call by storing the values?

Originally posted by @tgregg in https://github.com/amzn/ion-hash-python/pull/22#r701397395

https://github.com/amzn/ion-hash-python/blob/482ceb0c99494f196f7838a66ffe13721ee87425/ionhash/hasher.py#L481-L483

Also applicable to: https://github.com/amzn/ion-hash-python/blob/482ceb0c99494f196f7838a66ffe13721ee87425/ionhash/fast_value_hasher.py#L96