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

Refactor: optimize Hashmap lib with BALLs #139

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    9e9ac85 View commit details
    Browse the repository at this point in the history
  2. Refactor to Hashmap using BALLs

    Gas snapshot;
    ```
    forge snapshot --mc Hash --ffi  --fuzz-seed=11 --diff
    [⠊] Compiling...
    No files changed, compilation skipped
    
    Ran 6 tests for test/data-structures/Hashmap.t.sol:HashmapTest
    [PASS] testGetKey(bytes32) (runs: 1006, μ: 7550, ~: 7550)
    [PASS] testGetKeys(bytes32,bytes32) (runs: 1006, μ: 7623, ~: 7623)
    [PASS] testSetKey(bytes32,bytes32) (runs: 1006, μ: 28964, ~: 28984)
    [PASS] testSetKeys(bytes32,bytes32,bytes32) (runs: 1006, μ: 29153, ~:
    29153)
    [PASS] testSetKeys2D(bytes32,bytes32,bytes32,bytes32) (runs: 1006, μ:
    29497, ~: 29497)
    [PASS] testSetKeys3D(bytes32,bytes32,bytes32,bytes32,bytes32) (runs:
    1006, μ: 29888, ~: 29888)
    Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 54.73ms
    (226.84ms CPU time)
    
    Ran 1 test suite in 58.31ms (54.73ms CPU time): 6 tests passed, 0
    failed, 0 skipped (6 total tests)
    testGetKey(bytes32) (gas: 0 (0.000%))
    testGetKeys(bytes32,bytes32) (gas: 0 (0.000%))
    testSetKey(bytes32,bytes32) (gas: 0 (0.000%))
    testSetKeys(bytes32,bytes32,bytes32) (gas: 0 (0.000%))
    testSetKeys2D(bytes32,bytes32,bytes32,bytes32) (gas: -12 (-0.041%))
    testSetKeys3D(bytes32,bytes32,bytes32,bytes32,bytes32) (gas: -24
    (-0.080%))
    Overall gas change: -36 (-0.027%)
    
    ``
    eugenioclrc committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    3ccca49 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    af93705 View commit details
    Browse the repository at this point in the history
  2. Fix missing hash operations

    ```
    testGetKey(bytes32) (gas: 0 (0.000%))
    testGetKeys(bytes32,bytes32) (gas: 0 (0.000%))
    testSetKey(bytes32,bytes32) (gas: 0 (0.000%))
    testSetKeys(bytes32,bytes32,bytes32) (gas: 0 (0.000%))
    testSetKeys2D(bytes32,bytes32,bytes32,bytes32) (gas: 0 (0.000%))
    testSetKeys3D(bytes32,bytes32,bytes32,bytes32,bytes32) (gas: -9
    (-0.026%))
    Overall gas change: -9 (-0.006%)
    ``
    eugenioclrc committed May 1, 2024
    Configuration menu
    Copy the full SHA
    5c7b296 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Update SafeMath.huff

    remove `0x01 LABEL jumpi` for `LABEL jump`
    eugenioclrc authored May 17, 2024
    Configuration menu
    Copy the full SHA
    8f6cd1a View commit details
    Browse the repository at this point in the history