More optimizations and a fix for is_vararg_type
#254
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are all low-level optimizations. The cumulative effect is to go from ~18us/iteration in the
summer
benchmark to ~16us/iteration. One of the commits, theis_vararg_type
, actually leads to a 3% hit on that benchmark, but it fixes what seems to be an outright mistake. (Before 22a8b2c it was not possible to step into any function that receivedUnion{}
as an argument; the case that I observed was forpromote_result
.)On the
summer
benchmark, it seems the only remaining case of dynamic dispatch arises from JuliaLang/julia#31565.While performance improvements are always nice, my real goal in doing this is to prepare the way for a trial of the effect of lowered-code inlining (ref. #204 (comment)). Since I am hoping it has a dramatic effect, it would be a shame if it were "spoiled" by pre-existing bottlenecks, so I thought I'd start by getting rid of them even though currently they aren't terribly important.
To develop inlining, I think the best approach would be to first take a simple case, like
summer
, and "inline by hand" to see if it provides as much improvement as I hope. If so, then it will be worth building out the more general machinery.