-
Notifications
You must be signed in to change notification settings - Fork 85
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
reduce allocations #176
reduce allocations #176
Conversation
I believe materializing the array isn't necessary.
Can you please double check that it works locally? The tests are failing and the errors seem related to the change. It would be nice to remove the allocation indeed. |
Sure, I'll take a look. |
So I ran the tests again (on 1.7.0-rc1); it includes two errors, but both of them I also had before the change. Using Since there were some allocations left I also changed the |
Codecov Report
@@ Coverage Diff @@
## master #176 +/- ##
==========================================
- Coverage 86.93% 86.76% -0.17%
==========================================
Files 106 106
Lines 2303 2305 +2
==========================================
- Hits 2002 2000 -2
- Misses 301 305 +4
Continue to review full report at Codecov.
|
That is awesome. I made a small change and am just waiting for tests to finish running. Would you mind adding tests with |
I can merge as is as well, let me know. I am in the process of releasing a new version of the package and would like to include this PR :) |
Sure, I'm currently trying to figure out where to place the test (probably in polytopes.jl). However, the variables for the current |
I think polytopes.jl is a good place for the Feel free to remove allocations in other places in the future, these improvements are always welcome 💯 |
Well, I'll try my best 👍 I have experimented quite a bit now but I assume it's not very helpful to add a test with some random number of allocations (16 in this case, or 32 from the REPL). Edit: making my triangle |
Maybe you are running into the precompilation issue? Have you tried running |
I did that yes, I added a test for the triangle
gives
I looks like a problem with globals to me (especially since using A quick search gave invenia/NamedDims.jl#115 (comment) |
We can always push without allocation tests if you feel they are not helpful. |
I think it would be good to add that test, however, I don't know yet how to make it work so for now I would go forward without it and add it later when we found a good solution. |
Thanks for the improvement 💯 Feel free to submit more of those :) |
I believe materializing the array isn't necessary.