Delete unused refs from the tuple argument entirely#221
Merged
penelopeysm merged 2 commits intomainfrom Mar 27, 2026
Merged
Conversation
|
Libtask.jl documentation for PR #221 is available at: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Followup to #220. That PR optimises Libtask such that unnecessary calls to
get_ref_at/set_ref_at!are excised from the IR. However, the unusedRefs themselves are still kept around in the tuple that is passed as the first argument to theOpaqueClosure. This PR gets rid of them, essentially by renumbering any refs that survive from 1 to N and transforming the IR appropriately.Running the benchmarks on the TapedTasks in
src/benchmarksreveal some nice improvements:Rosenbrock
main: 2.134 ms (687 allocs: 6.272 MiB)
this PR: 2.017 ms (291 allocs: 6.259 MiB)
Ackley
main: 24.955 ms (699582 allocs: 18.306 MiB)
this PR: 22.578 ms (699528 allocs: 18.304 MiB)
matrix_test
main: 272.083 μs (503 allocs: 593.438 KiB)
this PR: 218.250 μs (214 allocs: 583.453 KiB)
neural_net
main: 3.046 μs (54 allocs: 2.172 KiB)
this PR: 2.638 μs (35 allocs: 1.672 KiB)