Skip to content
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 equality checks faster and fix hash #16

Merged
merged 7 commits into from
Oct 31, 2020

Conversation

oxinabox
Copy link
Member

@oxinabox oxinabox commented Oct 28, 2020

solves #15

With this PR:

julia> @btime $(ShortString15("abc")) == "abc";
  10.935 ns (0 allocations: 0 bytes)

julia> @btime $(ShortString15("abc")) == "abd";
  11.152 ns (0 allocations: 0 bytes)

Without this PR

julia> @btime $(ShortString15("abc")) == "abc";
  79.701 ns (3 allocations: 224 bytes)

julia> @btime $(ShortString15("abc")) == "abd";
  80.259 ns (3 allocations: 224 bytes)

This also correct the hash closing #21

src/base.jl Show resolved Hide resolved
@oxinabox
Copy link
Member Author

once we have this, it would be useful to tag a release as I want to use this for something

@oxinabox oxinabox changed the title Make equality checks faster Make equality checks faster and fix hash Oct 30, 2020
src/base.jl Show resolved Hide resolved
src/hash.jl Show resolved Hide resolved
src/base.jl Show resolved Hide resolved
src/base.jl Show resolved Hide resolved
src/base.jl Outdated Show resolved Hide resolved
src/base.jl Outdated Show resolved Hide resolved
@xiaodaigh xiaodaigh merged commit 0f4f72c into JuliaString:master Oct 31, 2020
@xiaodaigh
Copy link
Collaborator

Thanks!

Copy link
Member Author

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants