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

Use turbo-crc32 package to calculate crc32. #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reklatsmasters
Copy link

turbo-crc32 is about 2x times faster than crc.

crc:            987.866ms
buffer-crc32:   1387.205ms
turbo-crc32:    447.711ms

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f3ef163 on reklatsmasters:patch/crc32 into 89c048a on koajs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f3ef163 on reklatsmasters:patch/crc32 into 89c048a on koajs:master.

@kroleg
Copy link
Contributor

kroleg commented Dec 16, 2018

@reklatsmasters i was thinking today if it's possible to remove crc completly and simply compare JSON.stringify'ed representations of session before and after. What do you think about it?

@reklatsmasters
Copy link
Author

@kroleg I did not completely understand how to do it.

@kroleg kroleg mentioned this pull request Dec 18, 2018
@millette
Copy link

millette commented Jun 3, 2019

@kroleg A stable JSON.stringify would be needed when comparing since the order of keys isn't garanteed. Something like https://github.com/substack/json-stable-stringify although there are faster options.

@kroleg
Copy link
Contributor

kroleg commented Jun 17, 2019

@millette i don't think so. All json-stable-stringify does is keys sorting. We don't need it. If session object wasn't modified then JSON.stringifys output will not change.

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.

4 participants