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

replaced struct.unpack with struct.Struct().unpack #22

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

arekbulski
Copy link
Member

Per issue #21 . I ran the tests, but leave the benchmarks to you. I am having problems with benchmarks/build-formats.

@GreyCat GreyCat merged commit 0b66357 into master Mar 12, 2018
@GreyCat
Copy link
Member

GreyCat commented Mar 12, 2018

Thanks! I've ran the simple PCAP-based benchmark.

  • Before: 4.256415247915 ± 0.08523450167324
  • After: 4.16146477063333 ± 0.047591945923799

The overall effect is ~2%, and is comparable to the margin of error (which is also about 1-2%). But 2% is still good, I guess ;)

@@ -1,5 +1,6 @@
import itertools
import sys
import struct
from struct import unpack
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably remove this line now.

@arekbulski arekbulski deleted the patch-struct-precompile branch March 13, 2018 05:58
@arekbulski
Copy link
Member Author

I made same upgrade to Construct, and the speedup was also within margin of error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants