static-frame / arraykit

Python C Extensions for StaticFrame
Other
8 stars 2 forks source link

Implement slice_to_ascending_slice #12

Closed flexatone closed 3 years ago

chaburkland commented 3 years ago

I had a hunch this might not be a good candidate for a C-refactor, but my recent excursion seems to prove it.

I was able to clean up the python code and its speed by ~10% (and fix a bunch of obscure edge case failures), but writing it in C does not improve speed. I'm consistently getting ~-2% speed loss when compared against the new and improved Python.

Here is the modified Python code (I accidentally included it in a different PR: https://github.com/InvestmentSystems/static-frame/pull/333/files#diff-d1100de14891195ec5cecde35768a06a097b005cee9afe3e7e34648a54a48837L1042).

Also, here is my branch which contains the C code that doesn't offer any tangible improvement: https://github.com/chaburkland/arraykit/tree/12/slice_to_ascending_slice