Skip to content

Use turbo-crc32 package to calculate crc32.#156

Open
reklatsmasters wants to merge 1 commit into
koajs:masterfrom
reklatsmasters:patch/crc32
Open

Use turbo-crc32 package to calculate crc32.#156
reklatsmasters wants to merge 1 commit into
koajs:masterfrom
reklatsmasters:patch/crc32

Conversation

@reklatsmasters

Copy link
Copy Markdown

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

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

@coveralls

Copy link
Copy Markdown

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
Copy Markdown

Coverage Status

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

@kroleg

kroleg commented Dec 16, 2018

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Author

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

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

millette commented Jun 3, 2019

Copy link
Copy Markdown

@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

kroleg commented Jun 17, 2019

Copy link
Copy Markdown
Contributor

@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