Navigation Menu

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

Drop BytesIO from CodeStream, ~7.5% import block speedup #1777

Merged
merged 3 commits into from May 15, 2019

Commits on May 15, 2019

  1. CodeStream speedup ~6.8%

    - Inline CodeStream.__next__() into CodeStream.peek
    - Drop underlying BytesIO from code_stream
    - Drop CodeStream.pc indirection
    - Use __slots__
    
    Saw these improvements in total import_block() time:
    
    method    old      new     saved
    __iter__  4.53% -> 1.58% = 2.95%
    read      2.31% -> 0.56% = 1.75%
    pc()      1.12% -> ~0%   = 1.12%
    peek      1.07% -> 0.09% = 0.98%
    --------------------------------
    Total lift                 6.8%
    
    Tested against mainnet blocks: (7620447, 7620450, 7620453, 7620454)
    carver committed May 15, 2019
    Copy the full SHA
    3840c0d View commit details
    Browse the repository at this point in the history
  2. 0.85% import_block speedup in push_xx opcodes

    Usually, the data read from bytecode is the right length, so we can skip
    the ljust if it's not. Also, got rid of an unnecessary strip.
    carver committed May 15, 2019
    Copy the full SHA
    b9837ef View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    134d202 View commit details
    Browse the repository at this point in the history