Skip to content

WIP Benchmark Improvements #4

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/dates/bench-dates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
hyperfine --warmup 10 --export-json=results.json \
'./sqlite-regex.sh' \
'./regexp.sh' \
'./sqlean-re.sh'
'./sqlean-re.sh'
2 changes: 1 addition & 1 deletion benchmarks/dates/regexp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
sqlite3 test.db '.load ../regexp' \
'select count(*) from corpus where line regexp "([0-9])([0-9])([0-9])([0-9])-([0-9])([0-9])-([0-9])([0-9])"'
'select count(*) from corpus where line regexp "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]"'
193 changes: 88 additions & 105 deletions benchmarks/dates/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,105 @@
"results": [
{
"command": "./sqlite-regex.sh",
"mean": 0.054372564830784335,
"stddev": 0.0005315813126198082,
"median": 0.054373242870000005,
"user": 0.04359116519607843,
"system": 0.005847851078431375,
"min": 0.05331200287000001,
"max": 0.055514036870000005,
"mean": 0.11267520686500002,
"stddev": 0.029391610330499925,
"median": 0.10629417782500002,
"user": 0.08536712000000002,
"system": 0.011847024999999997,
"min": 0.102419562825,
"max": 0.252516121825,
"times": [
0.055139827870000005,
0.05409116287,
0.05445735787000001,
0.053842791870000004,
0.05448646387,
0.055514036870000005,
0.05400693587,
0.055154393870000006,
0.05416289187000001,
0.05395684287000001,
0.054107605870000006,
0.054620449870000004,
0.05519709887,
0.05398021787000001,
0.054373242870000005,
0.05487026887,
0.053872738870000006,
0.05497840687,
0.05343802787,
0.053459206870000005,
0.054260989870000005,
0.053631891870000004,
0.054111958870000004,
0.05395722287,
0.05451430587,
0.053698185870000005,
0.05438437687000001,
0.055285750870000004,
0.054758866870000006,
0.05426507387000001,
0.05491254887,
0.05534420587,
0.05383498087000001,
0.05445113287,
0.054479982870000006,
0.05331200287000001,
0.05429368687,
0.054001591870000004,
0.05479302087000001,
0.05374784187000001,
0.054810163870000005,
0.054740056870000005,
0.05444112887,
0.054216403870000006,
0.05425796587,
0.055065487870000006,
0.054823834870000004,
0.05469258987,
0.053751407870000004,
0.05397611387,
0.05447606287
0.10913872782500002,
0.10526252182500001,
0.10815751282500001,
0.10531610382500001,
0.105438179825,
0.11364773382500001,
0.10658175582500001,
0.10662998982500001,
0.107044779825,
0.10425893182500001,
0.10836027982500002,
0.10422059082500001,
0.252516121825,
0.11496441782500001,
0.10379165082500001,
0.10360743082500001,
0.10702090782500001,
0.10251035782500001,
0.10366562882500001,
0.10629417782500002,
0.104358793825,
0.102419562825,
0.10682055282500001,
0.10597068082500001,
0.11888277982500002
]
},
{
"command": "./regexp.sh",
"mean": 0.12548822508739133,
"stddev": 0.0011727640357036106,
"median": 0.12519553887,
"user": 0.11441889239130433,
"system": 0.005927785434782608,
"min": 0.12384031187,
"max": 0.12927648487,
"mean": 0.25997581682500004,
"stddev": 0.024898321763919803,
"median": 0.249294825825,
"user": 0.22347412000000003,
"system": 0.013309364999999998,
"min": 0.241774834825,
"max": 0.319424051825,
"times": [
0.12521587087,
0.12384031187,
0.12480195587000001,
0.12549902687,
0.12601430687,
0.12481248987000002,
0.12519553887,
0.12638769587,
0.12604039187000002,
0.12426679487,
0.12513222387,
0.12517647987,
0.12433811687000002,
0.12591836487000002,
0.12578433887,
0.12568511887,
0.12763933087,
0.12493951187000002,
0.12609870087,
0.12927648487,
0.12427449287,
0.12492496587000002,
0.12496666287
0.290193496825,
0.319424051825,
0.241774834825,
0.256489086825,
0.249630323825,
0.247342144825,
0.246143203825,
0.251682829825,
0.24895932782500002,
0.24811886782500003
]
},
{
"command": "./sqlean-re.sh",
"mean": 0.35747110417000005,
"stddev": 0.019674148400044274,
"median": 0.34542798687,
"user": 0.3338626749999999,
"system": 0.006953555,
"min": 0.34252614387,
"max": 0.39998933287,
"mean": 0.439621356325,
"stddev": 0.007868634482063867,
"median": 0.43852355232500007,
"user": 0.4151294200000001,
"system": 0.012904165,
"min": 0.427948924825,
"max": 0.452410292825,
"times": [
0.36573534187,
0.36690300387,
0.34263379087,
0.34604847087,
0.37801525287,
0.39998933287,
0.34252614387,
0.34459688187,
0.34480750287,
0.34345531987
0.43873102282500004,
0.43592116482500004,
0.44692509282500004,
0.431044881825,
0.427948924825,
0.43831608182500004,
0.433394053825,
0.44546314882500004,
0.446058898825,
0.452410292825
]
},
{
"command": "./sqlean-re-old.sh",
"mean": 0.792800548725,
"stddev": 0.14631192742771013,
"median": 0.702050492825,
"user": 0.67282412,
"system": 0.017852265,
"min": 0.688680482825,
"max": 1.043339850825,
"times": [
0.704442968825,
1.010896312825,
0.945591040825,
0.759589707825,
0.6903072868250001,
0.6887304818250001,
0.6996580168250001,
0.6967693378250001,
1.043339850825,
0.688680482825
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dates/sqlean-re.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
sqlite3 test.db '.load ../re' \
'select count(*) from corpus where line regexp "([0-9])([0-9])([0-9])([0-9])-([0-9])([0-9])-([0-9])([0-9])"'
'select count(*) from corpus where line regexp "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]"'
5 changes: 5 additions & 0 deletions benchmarks/random/bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
hyperfine --warmup 10 --export-json=results.json \
'./sqlite-regex.sh' \
'./regexp.sh' \
'./sqlean-re.sh'
3 changes: 3 additions & 0 deletions benchmarks/random/regexp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sqlite3 test.db '.load ../regexp' \
'select count(*) from strings where val regexp "1[3-4]";'
78 changes: 78 additions & 0 deletions benchmarks/random/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"results": [
{
"command": "./sqlite-regex.sh",
"mean": 0.1742572313175,
"stddev": 0.005392827326259962,
"median": 0.17231639638000001,
"user": 0.15581114999999998,
"system": 0.011448619999999998,
"min": 0.16904181338000002,
"max": 0.18774281538,
"times": [
0.17320623738000002,
0.16904181338000002,
0.17510701938000003,
0.17113916838,
0.17024163138,
0.17161788338000003,
0.17057605138,
0.16998865538000002,
0.17301490938000003,
0.17995066838,
0.18774281538,
0.18327223138,
0.17813933638,
0.17435727538,
0.17055851538000003,
0.17016148938000003
]
},
{
"command": "./regexp.sh",
"mean": 0.2273043020466667,
"stddev": 0.004043807716351632,
"median": 0.22712539788000002,
"user": 0.20874265,
"system": 0.012063078333333331,
"min": 0.22283077438,
"max": 0.23762479038000003,
"times": [
0.22706372238000003,
0.22446529338,
0.22395511738,
0.22360731238000003,
0.23106041838000002,
0.22718707338000002,
0.22843294638000003,
0.22829566938,
0.23762479038000003,
0.22283077438,
0.22536540038000002,
0.22776310638000002
]
},
{
"command": "./sqlean-re.sh",
"mean": 0.28892881498,
"stddev": 0.005089316670240326,
"median": 0.28804239438,
"user": 0.27235390000000004,
"system": 0.011376695,
"min": 0.28380435538000004,
"max": 0.30253571438000004,
"times": [
0.28941750838,
0.28637030138,
0.28909260038,
0.28643868938,
0.30253571438000004,
0.28833422538000003,
0.28631053438000004,
0.28775056338000005,
0.28380435538000004,
0.28923365738
]
}
]
}
3 changes: 3 additions & 0 deletions benchmarks/random/sqlean-re.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sqlite3 test.db '.load ../re' \
'select count(*) from strings where val regexp "1[3-4]";'
3 changes: 3 additions & 0 deletions benchmarks/random/sqlite-regex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sqlite3 test.db '.load ../../dist/release/regex0' \
'select count(*) from strings where val regexp "1[3-4]";'