Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix slow hash(::SubString{<:ByteString})
Cuts the #8826 vocab.jl benchmark in half.
- Loading branch information
4b4565f
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.
Oh wow. We can avoid similar problems in the future by adding a definition for
cconvert
of SubStrings inbase.jl
.4b4565f
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.
💯
4b4565f
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 thought about changing
cconvert
, but i think in most cases you'll want a NUL-terminated string.4b4565f
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 thought this was already fixed in #6058... I don't see an easy way of adding a non-benchmark regression test for this, though.
4b4565f
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.
1a670f9
4b4565f
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.
My bad.
4b4565f
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.
@stevengj I think what you are looking for is called a comment that explains why the code looks strange.
4b4565f
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.
@ivarne, fair enough; added in 2747864