Skip to content

optimize arm64 bitpacking#6

Merged
fpetkovski merged 3 commits intooptimize-pack-puregofrom
optimize-pack-arm64
Oct 26, 2025
Merged

optimize arm64 bitpacking#6
fpetkovski merged 3 commits intooptimize-pack-puregofrom
optimize-pack-arm64

Conversation

@achille-roussel
Copy link
Contributor

Based on #5, this change adds specializations for ARM64, with vectorized bit packing for bit widths 1 to 8.

goos: darwin
goarch: arm64
pkg: github.com/parquet-go/bitpack
cpu: Apple M2 Pro
                     │ /tmp/bench_pack_purego.txt │      /tmp/bench_pack_arm64.txt      │
                     │           sec/op           │   sec/op     vs base                │
PackInt32/bitWidth=1                 101.35n ± 1%   26.39n ± 1%  -73.96% (p=0.000 n=10)
PackInt32/bitWidth=2                  90.77n ± 2%   29.83n ± 1%  -67.14% (p=0.000 n=10)
PackInt32/bitWidth=3                  93.82n ± 1%   28.11n ± 1%  -70.04% (p=0.000 n=10)
PackInt32/bitWidth=4                  97.97n ± 2%   30.03n ± 1%  -69.35% (p=0.000 n=10)
PackInt32/bitWidth=8                 112.05n ± 2%   23.12n ± 1%  -79.36% (p=0.000 n=10)
PackInt64/bitWidth=1                 100.80n ± 1%   26.43n ± 2%  -73.78% (p=0.000 n=10)
PackInt64/bitWidth=2                 105.80n ± 3%   29.98n ± 1%  -71.67% (p=0.000 n=10)
PackInt64/bitWidth=3                  95.33n ± 2%   28.22n ± 3%  -70.40% (p=0.000 n=10)
PackInt64/bitWidth=4                  96.04n ± 2%   30.11n ± 3%  -68.65% (p=0.000 n=10)
PackInt64/bitWidth=8                 101.55n ± 1%   23.50n ± 4%  -76.85% (p=0.000 n=10)
geomean                               99.38n        27.45n       -72.38%

                     │ /tmp/bench_pack_purego.txt │       /tmp/bench_pack_arm64.txt        │
                     │            B/s             │      B/s       vs base                 │
PackInt32/bitWidth=1                 4.707Gi ± 1%   18.065Gi ± 1%  +283.81% (p=0.000 n=10)
PackInt32/bitWidth=2                 5.253Gi ± 2%   15.988Gi ± 1%  +204.36% (p=0.000 n=10)
PackInt32/bitWidth=3                 5.082Gi ± 1%   16.964Gi ± 1%  +233.78% (p=0.000 n=10)
PackInt32/bitWidth=4                 4.867Gi ± 2%   15.877Gi ± 1%  +226.23% (p=0.000 n=10)
PackInt32/bitWidth=8                 4.255Gi ± 2%   20.620Gi ± 1%  +384.64% (p=0.000 n=10)
PackInt64/bitWidth=1                 9.461Gi ± 1%   36.090Gi ± 2%  +281.45% (p=0.000 n=10)
PackInt64/bitWidth=2                 9.014Gi ± 3%   31.816Gi ± 1%  +252.97% (p=0.000 n=10)
PackInt64/bitWidth=3                 10.00Gi ± 2%    33.79Gi ± 3%  +237.82% (p=0.000 n=10)
PackInt64/bitWidth=4                 9.930Gi ± 2%   31.670Gi ± 3%  +218.93% (p=0.000 n=10)
PackInt64/bitWidth=8                 9.393Gi ± 1%   40.576Gi ± 4%  +332.00% (p=0.000 n=10)
geomean                              6.786Gi         24.56Gi       +261.99%

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
@achille-roussel achille-roussel self-assigned this Oct 26, 2025
@achille-roussel achille-roussel added the enhancement New feature or request label Oct 26, 2025
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
@fpetkovski fpetkovski merged commit d2e796c into optimize-pack-purego Oct 26, 2025
4 checks passed
@fpetkovski fpetkovski deleted the optimize-pack-arm64 branch October 26, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants