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

Possible Performance Optimisations #226

Open
Zentrik opened this issue Dec 21, 2023 · 0 comments
Open

Possible Performance Optimisations #226

Zentrik opened this issue Dec 21, 2023 · 0 comments

Comments

@Zentrik
Copy link

Zentrik commented Dec 21, 2023

I'm just creating this as a reference.

There are various problems with this package from a performance standpoint, largely relating to dynamic dispatches and heap allocations. I investigated this a while ago so I might be wrong on some counts but the main problems are

  • The default parameters is a dictionary with values being Any, this introduces type instabilities all over the place;
  • Unnecessary allocations, e.g. see Zentrik@34d9f82 for two specific examples. There are various other places that would benefit from pre-allocating memory.

I made some improvements on my fork, which eliminate almost all dynamic dispatches and heap allocations, in these two commits Zentrik@34d9f82, Zentrik@f842769. Note my fork is specialised specifically for my case, i.e. it hardcodes the optimisation algorithm that is used and forces Float32's in various places and might use a fork of various packages that speeds them up as well. However, I don't see any reason that these optimisations require these specialisations, it was just easier to do that.

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

No branches or pull requests

1 participant