binpacking icon indicating copy to clipboard operation
binpacking copied to clipboard

Performance without numpy

Open pirovc opened this issue 4 years ago • 6 comments

Hi @benmaier Thanks for keep improving the package. I noticed you removed numpy in the latest release. Do you know if that will impact the performance of the packing? I use it with very large datasets and would like to get a feeling before updating.

pirovc avatar Jul 06 '21 08:07 pirovc

hi, in my tests it affected runtimes by an increase of 10%. I decided to get rid of numpy to make the package pure-Python and therefore more lightweight. Would you have time to run some tests? if performance is too bad for you we could add the numpy-dependence back to an extra submodule

benmaier avatar Jul 06 '21 09:07 benmaier

I'm also realizing that this package had an increase in usage over the last years, so I should probably start adding community guidelines and discuss major changes with some core people before pushing.

benmaier avatar Jul 06 '21 09:07 benmaier

Sure I will do some tests and post here once I have some time. Since you already notice an increase I guess I will keep on the older version for now (1.1.1) because it works just fine to me.

I think keeping it pure-python is always a good thing, makes things easier to install and give support.

pirovc avatar Jul 06 '21 10:07 pirovc

you might want to consider switching to a newer version where some bugs caused by edge cases were fixed by contributors. v1.4.5 is the last version that used numpy

benmaier avatar Jul 06 '21 11:07 benmaier

What do you think of a solution where the "numpy" versions of the routines are imported at runtime per default but if the import fails, the package falls back on the pure python-solutions?

benmaier avatar Sep 15 '22 15:09 benmaier

Sounds like a nice solution if not too problematic or ugly to implement. In reality I do not actively use binpacking anymore, so this is not a problem for me at the moment (not related to the performance, just don't need the routine anymore). However I can see many applications where performance is important, so +1 to the idea.

pirovc avatar Sep 16 '22 08:09 pirovc