kalebburnham / Majikthise-Python

0 stars 0 forks source link

Replace np.uint64 with c_uint64 numbers. #23

Open kalebburnham opened 1 year ago

kalebburnham commented 1 year ago

A speed test of the northOne() function saw a speed improvement of around 370 nanoseconds/call to 100 nanoseconds/call when swapping the data type of the number. Since these numbers are used everywhere, this should lead to a drastic speed improvement overall.

kalebburnham commented 1 year ago

A speed test using the bit scan forward gives around a 50% speed improvement, from ~900 nanoseconds to 400-500 nanoseconds.

kalebburnham commented 1 year ago

Passing in an int rather than a c_uint64 (to avoid .value calls) shaves it down even further to 350 nanoseconds.