-
Notifications
You must be signed in to change notification settings - Fork 35
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
make recode! type stable #407
Merged
nalimilan
merged 17 commits into
JuliaData:master
from
tiemvanderdeure:typestable_recode
Jan 3, 2025
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1db6279
make recode! type stable
tiemvanderdeure ef10966
move optimize_pair away from main function
tiemvanderdeure 1688fb2
improve type stability of recode_in
tiemvanderdeure b412ce4
un-inline recode_in
tiemvanderdeure 0581607
pass first and last pairs as tuples
tiemvanderdeure 06b9265
recode_in is always false for identical types
tiemvanderdeure 74123a6
revert changes to recode_in, inline findfirst
tiemvanderdeure 15a09db
do not splat pairs passed to `_recode!`
tiemvanderdeure c419cf5
require julia 1.6
tiemvanderdeure 8e2db47
Revert "require julia 1.6"
tiemvanderdeure 2a446da
define inlined findfirstrecode
tiemvanderdeure 445469e
use `Compat.@inline`
tiemvanderdeure 91de203
avoid `isnothing`
tiemvanderdeure 539a3ba
allow compat v4
tiemvanderdeure 25af087
various minor changes
tiemvanderdeure b08a4ba
drop second import Compat
tiemvanderdeure 04695fa
whitespace and comments
tiemvanderdeure File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks problematic when
pairs[j]
is an array as it will create aSet
for each item. Have you investigated whymap(optimize_pair, pairs)
isn't inferred correctly? In theory it should, and I think I had carefully checked performance when I wrote that function so I'm surprised it's not the case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pairs[j]
is never an array, it is always aPair
. I just got rid of themap
and moved it inside the loop, but it still iterates over the exact same thing, so I don't think that should ever be problematic.I was also surprised that
map(optimize_pair, pairs)
wasn't inferred, some change in the compiler must have triggered this. I stumbled into this easy fix, so then I didn't investigate further.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean when the first element is an array to that the call hits
optimize_pair(pair::Pair{<:AbstractArray})
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that currently we create a
Set
once for each pair, and with this change we would create it for each pair for each entry in the input array.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's in the nested loop. I don't know how I missed that.