Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4207 +/- ##
==========================================
+ Coverage 99.95% 99.96% +0.01%
==========================================
Files 43 43
Lines 6308 6315 +7
==========================================
+ Hits 6305 6313 +8
+ Misses 3 2 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| Base.get(cache::_WeakCache, key, default) = get(cache.data, key, default) | ||
|
|
||
| Base.getindex(cache::_WeakCache, key) = getindex(cache.data, WeakRef(key)) |
There was a problem hiding this comment.
It was used in the tests to simplify things. I guess I can remove.
|
I think I'm just re-implementing |
|
|
||
| julia> @allocated @expression(model, @force_nonlinear(x * 2.0 * (1 + x) * x)) | ||
| 944 | ||
| 784 |
There was a problem hiding this comment.
Surprising that this decreases when we change struct to mutable struct
|
Related JuliaLang/julia#62831 |
|
I guess we should make a decision on this. |
|
I feel that we can merge as is. We can add a function later that cleans the dict if needed. Not sure that we should do this cleaning automatically. If it's documented, then it should be fine. Another option would be to clean it before |
A variant of #4204 that closes #4203
The downside to this approach is that we need to decide how frequently to filter the subexpression dictionary. If an element has been GC'd, it cannot be referenced in the future, so it is safe to remove.