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

Memoize transaction.hash #1305

Closed
wants to merge 1 commit into from
Closed

Conversation

olalonde
Copy link
Contributor

@olalonde olalonde commented Aug 6, 2015

What this basically does is avoid computing the hash if we already did so previously. It just memorizes the last computed hash so doesn't leak memory.

@braydonf
Copy link
Contributor

Looks like there is an issue here with Node.js v0.10 with the tests.

How is computing the hash again leaking memory? And wouldn't storing the buffer increase the memory footprint for each transaction?

There may be performance benefits to something like this, especially if hash is called multiple times, however toBuffer() may actually be the bottleneck and not the hashing. Though benchmarks would help prove such. Any idea of possible performance improvements?

@braydonf braydonf closed this Oct 27, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants