Sitelet https://github.com/Vectorized/solady/pull/1426
Skip to content

✨ LibSort hasDuplicate - #1426

Merged
Vectorized merged 11 commits into
mainfrom
has-duplicate
Jun 6, 2025
Merged

Vectorized merged 11 commits into
mainfrom
has-duplicate

Conversation

@Vectorized

@Vectorized Vectorized commented Jun 6, 2025 •

Copy link
Copy Markdown
Owner

Description

O(n).

If only there's some CLZ opcode.

Anyways, the main bulk of gas is in the linear-probing loop.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Ran forge fmt?
  • Ran forge test?

Pull requests with an incomplete checklist will be thrown out.

@github-actions

github-actions Bot commented Jun 6, 2025 •

Copy link
Copy Markdown

Gas Snapshot Comparison Report

Generated at commit : 8687bcd, Compared to commit : b609a9c

Contract Name Test Name Main Gas PR Gas Diff
LibSortTest testInsertionSortInts() 80499 80477 -22
testInsertionSortPsuedorandom() 63574 63619 45
testSearchSorted() 118972 118950 -22
testSearchSortedAddresses() 251950 251994 44
testSearchSortedBasicCases() 2244 2222 -22
testSearchSortedEdgeCases() 1595 1617 22
testSearchSortedWithEmptyArray() 731 687 -44
testSortAddressesPsuedorandom() 146898 146920 22
testSortAddressesPsuedorandomBrutalizeUpperBits() 198982 198939 -43
testSortAddressesReversed() 45523 45501 -22
testSortAddressesSorted() 41114 41137 23
testSortBasicCase() 1120 1142 22
testSortInts() 893975 893932 -43
testSortMostlySame() 66058 66081 23
testSortOriginalMostlySame() 208029 208007 -22
testSortOriginalPsuedorandom() 283638 283683 45
testSortOriginalReversed() 156305 156327 22
testSortPsuedorandom() 140167 140190 23
testSortSorted() 34523 34545 22
testSortedDifferenceDifferential() 183034 183079 45
testSortedUnionDifferential() 216799 216844 45
testUniquifySorted() 1688 1710 22
testUniquifySortedWithEmptyArray() 528 550 22
test__codesize() 23514 25452 1938
testHasDuplicateGas() - 297755 -
testHasDuplicateOriginalGas() - 451379 -

@Vectorized
Vectorized merged commit 2650456 into main Jun 6, 2025
@Vectorized
Vectorized deleted the has-duplicate branch June 26, 2025 19:24
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.

1 participant