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

removed modulus from main loop #36

Closed
wants to merge 2 commits into from
Closed

removed modulus from main loop #36

wants to merge 2 commits into from

Conversation

peterchenadded
Copy link
Contributor

As discussed, minor improvement to remove expensive modulus operator.

----------------------------------------------------------------------------------- benchmark: 3 tests -----------------------------------------------------------------------------------
Name (time in ms)          Min                 Max                Mean            StdDev              Median               IQR            Outliers       OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_small              5.0094 (1.0)        7.4816 (1.0)        5.3191 (1.0)      0.3314 (1.0)        5.2602 (1.0)      0.1653 (1.0)           8;9  188.0013 (1.0)         191           1
test_smooth_1000       52.8989 (10.56)     59.5790 (7.96)      54.3368 (10.22)    1.7066 (5.15)      53.6480 (10.20)    1.1022 (6.67)          2;2   18.4037 (0.10)         16           1
test_large            112.4638 (22.45)    120.6921 (16.13)    116.3287 (21.87)    2.9104 (8.78)     116.3253 (22.11)    5.0715 (30.69)         4;0    8.5963 (0.05)          9           1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------- benchmark: 3 tests -----------------------------------------------------------------------------------
Name (time in ms)          Min                 Max                Mean            StdDev              Median               IQR            Outliers       OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_small              5.1134 (1.0)        7.5196 (1.0)        5.3400 (1.0)      0.2995 (1.0)        5.2774 (1.0)      0.1251 (1.0)          7;10  187.2676 (1.0)         187           1
test_smooth_1000       53.7028 (10.50)     58.3828 (7.76)      55.1907 (10.34)    1.5705 (5.24)      54.4994 (10.33)    1.1452 (9.15)          4;4   18.1190 (0.10)         19           1
test_large            113.6079 (22.22)    122.6846 (16.32)    116.3847 (21.80)    3.6097 (12.05)    114.6583 (21.73)    4.1340 (33.04)         2;0    8.5922 (0.05)          9           1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------- benchmark: 3 tests -----------------------------------------------------------------------------------
Name (time in ms)          Min                 Max                Mean            StdDev              Median               IQR            Outliers       OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_small              5.0263 (1.0)        7.4791 (1.0)        5.2821 (1.0)      0.2391 (1.0)        5.2491 (1.0)      0.1043 (1.0)         10;12  189.3175 (1.0)         190           1
test_smooth_1000       53.2688 (10.60)     61.0834 (8.17)      54.6131 (10.34)    1.7800 (7.44)      54.0731 (10.30)    1.2326 (11.82)         2;1   18.3106 (0.10)         19           1
test_large            113.3363 (22.55)    115.6210 (15.46)    114.3397 (21.65)    0.7581 (3.17)     114.3845 (21.79)    1.0992 (10.54)         4;0    8.7459 (0.05)          9           1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@hjweide
Copy link
Owner

hjweide commented May 9, 2022

Thanks for putting this up so quickly! Let me think about this a bit and take a look over the next few days.

@peterchenadded
Copy link
Contributor Author

Sure, take your time. Probably too small to be worthwhile.

@hjweide
Copy link
Owner

hjweide commented May 9, 2022

I actually suspected that the compiler would already do this, but the improvement we observe is non-zero, so I want to think about what's actually happening here.

Required for .h to be included in sdist and also for pip to compile it without checking out the repo
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.

None yet

2 participants