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

Added the compare methods to all the byte array classes so they use the new primitiveCompareBytes #16461

Merged
merged 2 commits into from
Apr 21, 2024

Conversation

doste
Copy link
Contributor

@doste doste commented Apr 15, 2024

Now the classes ByteArray, DoubleByteArray, DoubleWordArray and ByteString uses the new primitiveCompareBytes when comparing them.
This new primitive was implemented but was never used. Now it is. This would result in a better performance (cf pharo-project/pharo-vm#759).

The comparison methods added have the fallback to use the comparison mechanism as always in case the VM used doesn't support the primitive.

@guillep
Copy link
Member

guillep commented Apr 15, 2024

oh so coooool.

Extracted from the VM PR:

  • is 3x faster than doing it directly in Pharo when the compared bytes are few.
  • is hundreds of times faster when comparing thousands of bytes.

@jecisc
Copy link
Member

jecisc commented Apr 21, 2024

The tests are passing. I'll merge so that we can test a little before the release

@jecisc jecisc merged commit 773a361 into pharo-project:Pharo12 Apr 21, 2024
1 of 2 checks passed
Copy link

welcome bot commented Apr 21, 2024

Congrats on merging your first pull request! Do another one! We try to have a list of (relatively) easy issues here: https://github.com/orgs/pharo-project/projects/8.

GitHub
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

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.

3 participants