-
Notifications
You must be signed in to change notification settings - Fork 9
Change IteratorSize on EnumerableMap to just pass through from underl… #28
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
==========================================
- Coverage 79.74% 79.36% -0.38%
==========================================
Files 19 19
Lines 474 475 +1
==========================================
- Hits 378 377 -1
- Misses 96 98 +2
Continue to review full report at Codecov.
|
|
On one hand this looks fine, but on the other hand I'm worried that I probably introduced the more elaborate thing for some reason. Of course, now I can't remember/think of one... We could probably get the same semantics as the old version but without the perf problems by using a generated function? |
|
Most of the other definitions of (Base.IteratorSize(S) isa Base.HasLength || Base.IteratorSize(S) isa Base.HasShape) ? Base.HasLength() : Base.SizeUnknown()so I wonder if you were going for a similar type thing here? Using the above definition would be much better, since it's inferrable. |
|
Oh, another quick question while we're here: any reason we don't declare |
|
Yes, I think the two And yes, adding a |
|
Have you also tried |
|
@quinnj let me know if you want to try @nalimilan's suggestion or just merge this right away! |
|
Updated. |
…ying iterator
In a benchmark I'm running this made about a 10% impact on performance; the problem is that the current code is non-compile-time inferrable, so it involved doing runtime dispatch on a trait meant to be compile-time friendly.