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

Implement a .contains() method for JSON strings #1431

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

jviotti
Copy link
Member

@jviotti jviotti commented Jan 10, 2025

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark (linux/llvm)

Benchmark suite Current: 9cfcb8f Previous: 4b04d73 Ratio
JSON_Array_Of_Objects_Unique 411.19623912538094 ns/iter 445.1658283192557 ns/iter 0.92
JSON_Parse_1 30408.30122198806 ns/iter 29969.246862281914 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 58.73893166288106 ns/iter 54.69452167440643 ns/iter 1.07
JSON_Equality_Helm_Chart_Lock 139.346432477628 ns/iter 145.74450222918298 ns/iter 0.96
Regex_Lower_S_Or_Upper_S_Asterisk 2.2144347039577235 ns/iter 2.20022864160664 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.2026561537283187 ns/iter 2.193531428313369 ns/iter 1.00
Regex_Period_Asterisk 2.2118133777452242 ns/iter 2.2128287716203614 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.223845863601647 ns/iter 2.191307434774555 ns/iter 1.01
Regex_Period_Plus 2.7992548734401095 ns/iter 2.486323042170805 ns/iter 1.13
Regex_Period 2.7972603702677654 ns/iter 2.4859844836476954 ns/iter 1.13
Regex_Caret_Period_Plus_Dollar 2.8052925050223103 ns/iter 2.2710142581093438 ns/iter 1.24
Regex_Caret_Group_Period_Plus_Group_Dollar 2.80129631985231 ns/iter 2.2765616233953105 ns/iter 1.23
Regex_Caret_Period_Asterisk_Dollar 3.4180447864550816 ns/iter 2.48695450832223 ns/iter 1.37
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.419769084337791 ns/iter 2.4861893176483925 ns/iter 1.38
Regex_Caret_X_Hyphen 12.665952935189729 ns/iter 12.52856247108536 ns/iter 1.01
Regex_Period_Md_Dollar 73.56269314912824 ns/iter 73.70581651740909 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 5.59551307996843 ns/iter 7.149466252312237 ns/iter 0.78
Regex_Caret_Period_Range_Dollar 2.7992947783225404 ns/iter 2.4938970230158755 ns/iter 1.12
Regex_Nested_Backtrack 500.72187600000007 ns/iter 491.679554149494 ns/iter 1.02
Pointer_Object_Traverse 44.35420708652524 ns/iter 44.788569441834994 ns/iter 0.99
Pointer_Object_Try_Traverse 52.598343689344475 ns/iter 53.193323097873595 ns/iter 0.99
Pointer_Push_Back_Pointer_To_Weak_Pointer 351.93926296461746 ns/iter 354.7159460770064 ns/iter 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark (macos/llvm)

Benchmark suite Current: 9cfcb8f Previous: 4b04d73 Ratio
JSON_Array_Of_Objects_Unique 349.4899636080632 ns/iter 342.6489024557436 ns/iter 1.02
JSON_Parse_1 22879.624189710394 ns/iter 21705.226241549248 ns/iter 1.05
JSON_Fast_Hash_Helm_Chart_Lock 50.880061605621314 ns/iter 51.44898973050822 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 146.86253337912785 ns/iter 131.93544163518078 ns/iter 1.11
Regex_Lower_S_Or_Upper_S_Asterisk 1.6838277623179334 ns/iter 1.5694098007288662 ns/iter 1.07
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.6771261687980268 ns/iter 1.5747650687678212 ns/iter 1.07
Regex_Period_Asterisk 1.6820100166095993 ns/iter 1.5713696147351714 ns/iter 1.07
Regex_Group_Period_Asterisk_Group 1.6845902382199045 ns/iter 1.5720335801048975 ns/iter 1.07
Regex_Period_Plus 2.0095663546933 ns/iter 1.8900372415409974 ns/iter 1.06
Regex_Period 2.0096638271809977 ns/iter 1.8855641136840815 ns/iter 1.07
Regex_Caret_Period_Plus_Dollar 2.0423158089411655 ns/iter 1.8848963733772441 ns/iter 1.08
Regex_Caret_Group_Period_Plus_Group_Dollar 2.1895206472175297 ns/iter 1.8852162281215603 ns/iter 1.16
Regex_Caret_Period_Asterisk_Dollar 1.6815884804263939 ns/iter 1.5692751711659874 ns/iter 1.07
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6944845767010515 ns/iter 1.570022786134582 ns/iter 1.08
Regex_Caret_X_Hyphen 6.7650205464347986 ns/iter 6.30523988713433 ns/iter 1.07
Regex_Period_Md_Dollar 72.53215077674726 ns/iter 69.48670971486591 ns/iter 1.04
Regex_Caret_Slash_Period_Asterisk 5.047618659706428 ns/iter 6.710547224593167 ns/iter 0.75
Regex_Caret_Period_Range_Dollar 2.182446732454428 ns/iter 2.0361345717246513 ns/iter 1.07
Regex_Nested_Backtrack 773.4896611236129 ns/iter 725.8954708932023 ns/iter 1.07
Pointer_Object_Traverse 15.967844071184377 ns/iter 15.247473910253499 ns/iter 1.05
Pointer_Object_Try_Traverse 33.41060307221323 ns/iter 31.508737475598654 ns/iter 1.06
Pointer_Push_Back_Pointer_To_Weak_Pointer 189.7156663348497 ns/iter 173.22369903074818 ns/iter 1.10

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark (linux/gcc)

Benchmark suite Current: 9cfcb8f Previous: 4b04d73 Ratio
Pointer_Object_Traverse 43.7588058973521 ns/iter 50.18702809651256 ns/iter 0.87
Pointer_Object_Try_Traverse 22.42438355926441 ns/iter 24.622513914266523 ns/iter 0.91
Pointer_Push_Back_Pointer_To_Weak_Pointer 213.69201352121826 ns/iter 213.17270709021975 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.1386255228213535 ns/iter 3.1231955616085556 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.131656612562803 ns/iter 3.130828609019674 ns/iter 1.00
Regex_Period_Asterisk 3.1272615771540524 ns/iter 3.122312645712708 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.122591392275129 ns/iter 3.122895313002317 ns/iter 1.00
Regex_Period_Plus 3.12565452688171 ns/iter 3.1273323382859193 ns/iter 1.00
Regex_Period 3.127559851010146 ns/iter 3.126788947460779 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.133475264121222 ns/iter 3.1316186871732135 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.125016320176896 ns/iter 3.1233518534670113 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.729876311199004 ns/iter 3.1290650749377256 ns/iter 1.19
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.729571191056901 ns/iter 3.126457674540122 ns/iter 1.19
Regex_Caret_X_Hyphen 12.43526834426652 ns/iter 12.431149374894764 ns/iter 1.00
Regex_Period_Md_Dollar 89.32963444676007 ns/iter 89.25451018058364 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.152536344748236 ns/iter 7.14604530308933 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.041276699673332 ns/iter 4.039906061789911 ns/iter 1.00
Regex_Nested_Backtrack 823.495433792738 ns/iter 833.3509879230805 ns/iter 0.99
JSON_Array_Of_Objects_Unique 378.35509722355715 ns/iter 377.4044799985154 ns/iter 1.00
JSON_Parse_1 32728.402375473925 ns/iter 33185.93026466167 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 63.38460152059161 ns/iter 62.94871641328834 ns/iter 1.01
JSON_Equality_Helm_Chart_Lock 143.27420518330007 ns/iter 146.9782408346559 ns/iter 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark (windows/msvc)

Benchmark suite Current: 9cfcb8f Previous: 4b04d73 Ratio
JSON_Array_Of_Objects_Unique 416.55256955060605 ns/iter 435.00737500011155 ns/iter 0.96
JSON_Parse_1 80048.85044642205 ns/iter 83702.96874998319 ns/iter 0.96
JSON_Fast_Hash_Helm_Chart_Lock 53.975990000003556 ns/iter 59.704940000006 ns/iter 0.90
JSON_Equality_Helm_Chart_Lock 232.7783110738265 ns/iter 228.0587357077244 ns/iter 1.02
Regex_Lower_S_Or_Upper_S_Asterisk 8.55959460464513 ns/iter 8.532138392856682 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 7.816703536533736 ns/iter 8.04193255338269 ns/iter 0.97
Regex_Period_Asterisk 7.7602912946428395 ns/iter 8.327903534250876 ns/iter 0.93
Regex_Group_Period_Asterisk_Group 8.036987910548838 ns/iter 8.034918526784095 ns/iter 1.00
Regex_Period_Plus 7.753295758927692 ns/iter 8.135332999397985 ns/iter 0.95
Regex_Period 7.964770946586055 ns/iter 8.051205767629174 ns/iter 0.99
Regex_Caret_Period_Plus_Dollar 7.864510679175819 ns/iter 7.912025857533314 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 8.455018973214022 ns/iter 8.832472728425117 ns/iter 0.96
Regex_Caret_Period_Asterisk_Dollar 8.05674107142908 ns/iter 7.789064062500017 ns/iter 1.03
Regex_Caret_Group_Period_Asterisk_Group_Dollar 8.151196838611654 ns/iter 8.23741737394046 ns/iter 0.99
Regex_Caret_X_Hyphen 12.07978392857204 ns/iter 11.566604687502036 ns/iter 1.04
Regex_Period_Md_Dollar 142.9187079054157 ns/iter 142.00964767811402 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 11.779641911697615 ns/iter 11.935163116364066 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 9.320995312501523 ns/iter 8.964932102834474 ns/iter 1.04
Regex_Nested_Backtrack 589.8583035713858 ns/iter 586.6695535713365 ns/iter 1.01
Pointer_Object_Traverse 56.26304999999547 ns/iter 55.89243749998981 ns/iter 1.01
Pointer_Object_Try_Traverse 75.91472098214932 ns/iter 75.99424107141317 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 172.87257793503514 ns/iter 191.31794565335926 ns/iter 0.90

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit 74edf62 into main Jan 10, 2025
13 checks passed
@jviotti jviotti deleted the string-contains branch January 10, 2025 17:50
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