Vectorized / solady

Optimized Solidity snippets.
MIT License
2.6k stars 346 forks source link

✨ LibBytes #1154

Closed Vectorized closed 2 weeks ago

Vectorized commented 2 weeks ago

Description

Checklist

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

Pull requests with an incomplete checklist will be thrown out.

github-actions[bot] commented 2 weeks ago

Gas Snapshot Comparison Report

Generated at commit : 655df45f3972d82bb523f12fd607b5d9701f2dde, Compared to commit : b54464182756c04312d9b2aa33979b745c733579

Contract Name Test Name Main Gas PR Gas Diff
Base64Test test__codesize() 6816 6835 19
EfficientHashLibTest testEfficientHashBytesSlice() 26774 26824 50
test__codesize() 6357 6370 13
ERC1271Test testIsValidSignature() 3059687 3061187 1500
test__codesize() 30867 30893 26
JSONParserLibTest testDecodeInvalidStringReverts() 172813 172924 111
testDecodeString() 193119 193269 150
testEmptyItem() 2913 2925 12
testParseInt() 204099 204229 130
testParseInvalidIntReverts() 210550 210681 131
testParseInvalidNumberReverts() 4067432 4068682 1250
testParseInvalidReverts() 8587164 8589165 2001
testParseInvalidStringReverts() 2116357 2117157 800
testParseInvalidUintReverts() 308736 308887 151
testParseJWTGas() 50006 50056 50
testParseObject() 46579 46603 24
testParseRecursiveObject() 94896 94907 11
testParseSimpleArray() 24122 24126 4
testParseSpecials() 260188 260199 11
testParseString() 1237179 1237483 304
testParseUint() 95589 95659 70
testParseUintFromHex() 1385870 1398110 12240
test__codesize() 38063 38090 27
LibBytesTest test__codesize() - 2798 -
LibCloneTest testCloneDeterministicWithImmutableArgs() 130054 130128 74
testCloneWithImmutableArgs() 130622 130696 74
testDeployDeterministicERC1967() 133758 133832 74
testDeployDeterministicERC1967WithImmutableArgs() 172025 172075 50
testDeployERC1967() 130900 130974 74
testDeployERC1967BeaconProxyWithImmutableArgs() 861205 861635 430
testDeployERC1967IBeaconProxyWithImmutableArgs() 972818 973208 390
testDeployERC1967IWithImmutableArgs() 168883 168933 50
testDeployERC1967WithImmutableArgs() 146628 146678 50
test__codesize() 45183 45201 18
LibStringTest testContains() 43862 44582 720
testSetAndGetStringStorage() 2309307 2346687 37380
testSimpleStringSetAndGetGas() 591462 598545 7083
testStringConcat() 4047 4317 270
testStringEndsWith() 2851 3754 903
testStringEscapeJSONHexEncode() 695393 687848 -7545
testStringIndexOf() 17395 17989 594
testStringIndicesOf() 11542 11992 450
testStringLastIndexOf() 23997 24915 918
testStringPackAndUnpackOne() 1088691 710695 -377996
testStringPackAndUnpackTwo() 875841 3267360 2391519
testStringRepeat() 4936 5341 405
testStringRepeatOriginal() 9575 9683 108
testStringReplaceLong() 8158 8230 72
testStringReplaceMedium() 7341 7405 64
testStringReplaceShort() 11589 12293 704
testStringSlice() 9239 9662 423
testStringSplit() 20233 20583 350
testStringStartsWith() 2588 3473 885
testToStringPositiveNumberBrutalized() 572276 563006 -9270
testToStringUint256MaxBrutalized() 583612 574373 -9239
testToStringZeroBrutalized() 571785 562515 -9270
test__codesize() 50266 49822 -444
LibZipTest testFlzCompressDecompress() 1254342 1255078 736
testFlzCompressDecompress2() 763987 764656 669
test__codesize() 20417 20430 13
MetadataReaderLibTest testReadBytes32String() 664725 668497 3772
testReadBytes32StringTruncated() 775102 780820 5718
testReadStringChopped() 272322 273588 1266
testReadUint() 921729 922837 1108
test__codesize() 8122 8147 25
SSTORE2Test test__codesize() 8624 8637 13
WebAuthnTest test__codesize() 10220 10233 13