[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Murcake/optimize array load #160

Merged
merged 6 commits into from
Dec 19, 2021
Merged

Commits on Dec 18, 2021

  1. make length/size naming consistent for packed arrays

    Now 'length' or 'len' refers to the number of cells in an
         array. 'size' refers to the number of bytes. We used to mix them
         and it made things confusing.
    temyurchenko committed Dec 18, 2021
    Configuration menu
    Copy the full SHA
    859aa50 View commit details
    Browse the repository at this point in the history
  2. fix shifted array copy

    It was just wrong and it just never came up for some reason. Added
         some tests to detect in the future.
    temyurchenko committed Dec 18, 2021
    Configuration menu
    Copy the full SHA
    8ad8dbf View commit details
    Browse the repository at this point in the history
  3. store calldata shifted 12 bytes to the right

    The reason for the shift is to optimize for the hot-path. Most of the
         calldata read positions follow the same pattern: 'n * 32 +
         4' (the first four bytes in calldata in Solidity represent a
         function selector). Thus, most of the calldata reads are
         /unaligned/ in regards to bit packing. In order to align them, we
         perform the 12-byte shift.
    temyurchenko committed Dec 18, 2021
    Configuration menu
    Copy the full SHA
    b81e863 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8ee513a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    39ba3e9 View commit details
    Browse the repository at this point in the history
  6. optimize 'copy_from_memory_aligned'

    remove usage of comparisons and inefficient bit manipulations
    temyurchenko committed Dec 18, 2021
    Configuration menu
    Copy the full SHA
    1395734 View commit details
    Browse the repository at this point in the history