Skip to content

Conversation

@abhiaagarwal
Copy link
Contributor

Description

Creates a new cargo profile for the python build, applying a few techniques from min-sized-rust. Sets up maturin to build with said profile.

Related Issue(s)

Relates to #3876

Documentation

The size of the wheel on my system is:

❯ du -sh *
20M     deltalake-1.2.1-cp39-abi3-macosx_11_0_arm64.whl

The equivalent wheel in pypi is 43.3 MB

Signed-off-by: Abhi Agarwal <[email protected]>
@abhiaagarwal abhiaagarwal changed the title Reduce wheel size chore: reduce wheel size Oct 20, 2025
@github-actions github-actions bot added the binding/python Issues for the Python package label Oct 20, 2025
@github-actions
Copy link

ACTION NEEDED

delta-rs follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
maturin-version: v1.6.0 # https://github.com/PyO3/maturin/issues/2154
Copy link
Collaborator

Choose a reason for hiding this comment

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

Haha completely forgot about this pin 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the issue seemed to be resolved upstream so I removed the pin

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.74%. Comparing base (a22a97e) to head (76bc3e0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3878      +/-   ##
==========================================
- Coverage   73.76%   73.74%   -0.03%     
==========================================
  Files         151      151              
  Lines       39396    39374      -22     
  Branches    39396    39374      -22     
==========================================
- Hits        29061    29036      -25     
- Misses       9023     9027       +4     
+ Partials     1312     1311       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ion-elgreco
Copy link
Collaborator

@abhiaagarwal could you benchmark the opt-level? Because I prefer performance over size

rtyler
rtyler previously approved these changes Oct 21, 2025
@rtyler rtyler enabled auto-merge (rebase) October 21, 2025 13:54
@ion-elgreco ion-elgreco disabled auto-merge October 23, 2025 06:06
@abhiaagarwal
Copy link
Contributor Author

Sorry for the long response @ion-elgreco, busy work week

------------------------------------------------------------------------------------------------ benchmark 'optimize': 8 tests -------------------------------------------------------------------------------------------------
Name (time in ms)                                        Min                   Max                  Mean              StdDev                Median                 IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_optimize[5] (0004_opt-s)             701.8682 (1.0)        763.7821 (1.0)        740.1488 (1.0)       25.9167 (1.0)        749.3526 (1.0)       40.6509 (1.0)           1;0  1.3511 (1.0)           5           1
test_benchmark_optimize[5] (0003_opt-3)             727.5015 (1.04)       999.2721 (1.31)       825.6983 (1.12)     109.1081 (4.21)       826.5721 (1.10)     142.4912 (3.51)          1;0  1.2111 (0.90)          5           1
test_benchmark_optimize[1] (0003_opt-3)           2,245.6781 (3.20)     2,448.2633 (3.21)     2,349.4006 (3.17)      94.8573 (3.66)     2,348.3425 (3.13)     182.4450 (4.49)          2;0  0.4256 (0.32)          5           1
test_benchmark_optimize[1] (0004_opt-s)           2,250.6945 (3.21)     2,400.1447 (3.14)     2,323.2403 (3.14)      71.4606 (2.76)     2,297.8569 (3.07)     134.4806 (3.31)          3;0  0.4304 (0.32)          5           1
test_benchmark_optimize_minio[5] (0003_opt-3)     2,919.3402 (4.16)     3,086.0622 (4.04)     3,010.6747 (4.07)      73.1944 (2.82)     3,026.0123 (4.04)     131.4865 (3.23)          2;0  0.3322 (0.25)          5           1
test_benchmark_optimize_minio[5] (0004_opt-s)     2,969.8785 (4.23)     3,191.4877 (4.18)     3,083.4676 (4.17)      82.5259 (3.18)     3,105.6618 (4.14)     103.3143 (2.54)          2;0  0.3243 (0.24)          5           1
test_benchmark_optimize_minio[1] (0003_opt-3)     5,471.7072 (7.80)     5,683.7225 (7.44)     5,598.6214 (7.56)      82.9117 (3.20)     5,598.2698 (7.47)     113.5542 (2.79)          2;0  0.1786 (0.13)          5           1
test_benchmark_optimize_minio[1] (0004_opt-s)     5,599.6722 (7.98)     5,737.9225 (7.51)     5,656.0024 (7.64)      57.2926 (2.21)     5,662.3110 (7.56)      89.6479 (2.21)          1;0  0.1768 (0.13)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------- benchmark 'read': 4 tests -----------------------------------------------------------------------------------------
Name (time in ms)                                Min                Max               Mean            StdDev             Median               IQR            Outliers      OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_read (0004_opt-s)             19.7620 (2.16)     21.1703 (1.0)      20.2840 (1.0)      0.5651 (1.0)      20.2546 (1.0)      0.7796 (1.0)           1;0  49.2998 (1.0)           5           1
test_benchmark_read (0003_opt-3)             29.0665 (3.17)     32.7290 (1.55)     30.9064 (1.52)     1.5328 (2.71)     31.2962 (1.55)     2.5826 (3.31)          2;0  32.3558 (0.66)          5           1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------- benchmark 'write': 4 tests -----------------------------------------------------------------------------------------------
Name (time in ms)                                  Min                   Max                  Mean              StdDev                Median                 IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_write (0004_opt-s)             260.2292 (1.0)        292.1685 (1.0)        272.5069 (1.0)       13.0628 (1.0)        265.7534 (1.0)       18.5604 (1.0)           1;0  3.6696 (1.0)           5           1
test_benchmark_write (0003_opt-3)             320.3244 (1.23)       363.1621 (1.24)       336.0561 (1.23)      17.5938 (1.35)       331.7694 (1.25)      26.1690 (1.41)          1;0  2.9757 (0.81)          5           1
test_benchmark_write_minio (0004_opt-s)       956.3183 (3.67)       997.8247 (3.42)       974.8245 (3.58)      18.9490 (1.45)       964.7154 (3.63)      32.7966 (1.77)          1;0  1.0258 (0.28)          5           1
test_benchmark_write_minio (0003_opt-3)     1,103.9973 (4.24)     1,637.2456 (5.60)     1,272.8492 (4.67)     211.0044 (16.15)    1,227.3465 (4.62)     195.7828 (10.55)         1;1  0.7856 (0.21)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This numbers seem too noisy to be definitive, but opt-s seems to be more performant on average than opt-3, which is certainly surprising!

@abhiaagarwal
Copy link
Contributor Author

I added a few warmup rounds on the benchmark, and it seems like opt-3 is indeed faster.

------------------------------------------------------------------------------------------------ benchmark 'optimize': 8 tests -------------------------------------------------------------------------------------------------
Name (time in ms)                                          Min                   Max                  Mean             StdDev                Median                IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_optimize[5] (0005_opt-s-2)             691.7115 (1.0)        699.4408 (1.0)        696.1653 (1.0)       3.7187 (1.0)        698.0257 (1.0)       6.7994 (1.0)           1;0  1.4364 (1.0)           5           1
test_benchmark_optimize[5] (0006_opt-3-2)             712.9068 (1.03)       752.8451 (1.08)       726.3552 (1.04)     17.2562 (4.64)       716.9160 (1.03)     25.4627 (3.74)          1;0  1.3767 (0.96)          5           1
test_benchmark_optimize[1] (0005_opt-s-2)           2,231.0520 (3.23)     2,367.3122 (3.38)     2,301.1620 (3.31)     56.8469 (15.29)    2,317.9184 (3.32)     94.7398 (13.93)         2;0  0.4346 (0.30)          5           1
test_benchmark_optimize[1] (0006_opt-3-2)           2,289.9705 (3.31)     2,400.9028 (3.43)     2,330.1158 (3.35)     43.4341 (11.68)    2,315.7443 (3.32)     53.3813 (7.85)          1;0  0.4292 (0.30)          5           1
test_benchmark_optimize_minio[5] (0006_opt-3-2)     2,934.9652 (4.24)     3,010.2338 (4.30)     2,967.2295 (4.26)     35.1692 (9.46)     2,946.7703 (4.22)     61.1286 (8.99)          1;0  0.3370 (0.23)          5           1
test_benchmark_optimize_minio[5] (0005_opt-s-2)     2,951.8838 (4.27)     3,030.6367 (4.33)     2,991.1300 (4.30)     27.8929 (7.50)     2,992.2369 (4.29)     22.8429 (3.36)          2;0  0.3343 (0.23)          5           1
test_benchmark_optimize_minio[1] (0005_opt-s-2)     5,502.8577 (7.96)     5,625.8387 (8.04)     5,545.8004 (7.97)     50.2840 (13.52)    5,538.0719 (7.93)     70.0437 (10.30)         1;0  0.1803 (0.13)          5           1
test_benchmark_optimize_minio[1] (0006_opt-3-2)     5,528.7860 (7.99)     5,637.2912 (8.06)     5,581.4631 (8.02)     41.1993 (11.08)    5,586.0167 (8.00)     58.0035 (8.53)          2;0  0.1792 (0.12)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------ benchmark 'read': 4 tests -------------------------------------------------------------------------------------------
Name (time in ms)                                  Min                Max               Mean             StdDev             Median                IQR            Outliers      OPS            Rounds  Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_read (0006_opt-3-2)             26.2282 (2.50)     27.4591 (1.0)      27.0719 (1.15)      0.4866 (1.0)      27.2135 (1.21)      0.4409 (1.0)           1;1  36.9387 (0.87)          5           1
test_benchmark_read (0005_opt-s-2)             28.9538 (2.76)     56.4783 (2.06)     37.4612 (1.59)     11.1847 (22.99)    35.7564 (1.59)     12.1522 (27.57)         1;0  26.6943 (0.63)          5           1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------- benchmark 'write': 4 tests -----------------------------------------------------------------------------------------------
Name (time in ms)                                    Min                   Max                  Mean             StdDev                Median                IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_write (0006_opt-3-2)             278.9487 (1.0)        290.5397 (1.0)        284.5154 (1.0)       5.5542 (1.0)        283.5683 (1.0)      10.7708 (1.0)           2;0  3.5147 (1.0)           5           1
test_benchmark_write (0005_opt-s-2)             286.5343 (1.03)       313.9543 (1.08)       300.5772 (1.06)     12.4751 (2.25)       306.0773 (1.08)     22.0201 (2.04)          3;0  3.3269 (0.95)          5           1
test_benchmark_write_minio (0006_opt-3-2)       945.1273 (3.39)       973.2493 (3.35)       958.5207 (3.37)     11.3832 (2.05)       956.4379 (3.37)     18.5218 (1.72)          2;0  1.0433 (0.30)          5           1
test_benchmark_write_minio (0005_opt-s-2)     1,002.8602 (3.60)     1,073.9860 (3.70)     1,042.7032 (3.66)     28.3228 (5.10)     1,038.6112 (3.66)     42.5626 (3.95)          2;0  0.9590 (0.27)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Signed-off-by: Abhi Agarwal <[email protected]>
Signed-off-by: Abhi Agarwal <[email protected]>
@ion-elgreco ion-elgreco enabled auto-merge (squash) October 25, 2025 06:03
@ion-elgreco ion-elgreco merged commit b2ca3b3 into delta-io:main Oct 25, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

binding/python Issues for the Python package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants