Skip to content

Conversation

@yutannihilation
Copy link
Contributor

This tries to address #504 (comment)

In the case of a scalar argument, DAffine2Iterator and DAffine3Iterator now hold Option<f64> instead of expanded array. I think this needs to be benchmarked to see if this change is worth, so I set this pull request as a draft.

@yutannihilation
Copy link
Contributor Author

I finally added some benchmarks. It seems the result shows this doesn't make difference..., so let's keep the current implementation!

Current main branch

---------------------------------------------------------------------------------------------- benchmark: 3 tests ---------------------------------------------------------------------------------------------
Name (time in ms)                                     Min               Max              Mean            StdDev            Median               IQR            Outliers       OPS            Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_st_affine_2d[array-SedonaDBSingleThread]      2.7364 (1.0)      2.8716 (1.01)     2.7668 (1.0)      0.0211 (1.36)     2.7627 (1.0)      0.0243 (1.15)        81;16  361.4301 (1.0)         353           1
test_st_affine_2d[mixed-SedonaDBSingleThread]      2.7562 (1.01)     2.8516 (1.0)      2.7835 (1.01)     0.0155 (1.0)      2.7828 (1.01)     0.0211 (1.0)          98;7  359.2600 (0.99)        356           1
test_st_affine_2d[scalar-SedonaDBSingleThread]     2.7736 (1.01)     3.0790 (1.08)     2.8028 (1.01)     0.0317 (2.04)     2.7974 (1.01)     0.0235 (1.12)        14;12  356.7848 (0.99)        281           1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

This branch

---------------------------------------------------------------------------------------------- benchmark: 3 tests ---------------------------------------------------------------------------------------------
Name (time in ms)                                     Min               Max              Mean            StdDev            Median               IQR            Outliers       OPS            Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_st_affine_2d[array-SedonaDBSingleThread]      2.7400 (1.0)      2.8557 (1.01)     2.7755 (1.0)      0.0192 (1.33)     2.7730 (1.0)      0.0241 (1.25)        103;3  360.2989 (1.0)         346           1
test_st_affine_2d[mixed-SedonaDBSingleThread]      2.7645 (1.01)     2.8371 (1.0)      2.7950 (1.01)     0.0144 (1.0)      2.7936 (1.01)     0.0193 (1.0)         102;4  357.7813 (0.99)        351           1
test_st_affine_2d[scalar-SedonaDBSingleThread]     2.7962 (1.02)     3.1533 (1.11)     2.8457 (1.03)     0.0622 (4.32)     2.8209 (1.02)     0.0381 (1.98)        12;12  351.4086 (0.98)         92           1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

@yutannihilation yutannihilation deleted the refactor/st_affine-dont-expand branch January 22, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant