diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 790ddb57f..e55392d38 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -79,7 +79,8 @@ export default defineConfig({ { text: 'Path-tables', link: '/reference/path-tables' }, { text: 'Globs', link: '/reference/glob' }, { text: 'HTTP API', link: '/reference/http-api' }, - { text: 'SDK', link: '/reference/sdk' } + { text: 'SDK', link: '/reference/sdk' }, + { text: 'Speed', link: '/speed' } ] }, { diff --git a/docs/speed.json b/docs/speed.json new file mode 100644 index 000000000..839756af4 --- /dev/null +++ b/docs/speed.json @@ -0,0 +1,931 @@ +{ + "commit": "462b3c6afccefeb91cf93153141a82a330c318e3", + "date": "2026-10-14T01:49:05Z", + "machine": { + "platform": "Linux-7.0.0-28-generic-x86_64-with-glibc2.39", + "cpu": "AMD Ryzen 9 9950X 16-Core Processor", + "cpus": 32 + }, + "versions": { + "bash": "GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)", + "find": "find (GNU findutils) 4.9.0", + "rg": "ripgrep 14.1.0", + "xargs": "xargs (GNU findutils) 4.9.0", + "inotifywait": "inotifywait 3.22.6.0" + }, + "pairs": 100, + "cases": [ + { + "name": "./*", + "pairs": 100, + "fastest": "rg", + "ratio_vs_fastest": 1.4252311011098913, + "dirsql_median_s": 0.6645903754979372, + "startup": { + "dirsql": 0.05082461470738053, + "native": 0.000513753853738308 + }, + "natives": { + "find": { + "native_median_s": 0.6047677379101515, + "ratio": { + "min": 0.7399250479342063, + "median": 1.013215101564438, + "max": 1.0646487482522133, + "spread": 0.3204884133849 + } + }, + "fd": { + "native_median_s": 0.5016325246542692, + "ratio": { + "min": 0.49487041982817914, + "median": 1.2256589210785458, + "max": 1.5389544801625075, + "spread": 0.8518553101343753 + } + }, + "rg": { + "native_median_s": 0.4266068674623966, + "ratio": { + "min": 0.41627967470626087, + "median": 1.4252311011098913, + "max": 1.5937739325978977, + "spread": 0.8261777735376875 + } + }, + "bash-glob": { + "native_median_s": 14.462628276087344, + "ratio": { + "min": 0.03515911862964026, + "median": 0.04209698058707113, + "max": 0.04377788192034701, + "spread": 0.20473590196998015 + } + } + }, + "skipped": [] + }, + { + "name": "./**", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.389554286873405, + "dirsql_median_s": 0.26737085031345487, + "startup": { + "dirsql": 0.05777155654504895, + "native": 0.0010039913468062878 + }, + "natives": { + "git-ls-files": { + "native_median_s": 0.5586132858879864, + "ratio": { + "min": 0.29781266430389336, + "median": 0.37687170818515325, + "max": 0.46298448020391036, + "spread": 0.43827066960109873 + } + }, + "fd": { + "native_median_s": 0.1521212076768279, + "ratio": { + "min": 1.2405158283548827, + "median": 1.389554286873405, + "max": 1.6242954276541912, + "spread": 0.2761889930639843 + } + }, + "rg": { + "native_median_s": 0.1962207150645554, + "ratio": { + "min": 0.9511857015187796, + "median": 1.0928065563197102, + "max": 1.5323278115922807, + "spread": 0.5317886379000483 + } + } + }, + "skipped": [] + }, + { + "name": "./**/*.js", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 2.162472056528549, + "dirsql_median_s": 0.6924992231652141, + "startup": { + "dirsql": 0.04512234404683113, + "native": 0.0003999774344265461 + }, + "natives": { + "find": { + "native_median_s": 1.1808431060053408, + "ratio": { + "min": 0.33742034978855134, + "median": 0.5491589120936664, + "max": 0.7257782266596077, + "spread": 0.7071866964526594 + } + }, + "fd": { + "native_median_s": 0.30308040138334036, + "ratio": { + "min": 1.4326748222202603, + "median": 2.162472056528549, + "max": 2.738450473084335, + "spread": 0.6038346932261669 + } + }, + "rg": { + "native_median_s": 0.5670286864042282, + "ratio": { + "min": 0.9365316921474459, + "median": 1.1416050620421532, + "max": 1.4396357367814643, + "spread": 0.44069885581450013 + } + } + }, + "skipped": [] + }, + { + "name": "./**/*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.6075107521595067, + "dirsql_median_s": 0.3001542780548334, + "startup": { + "dirsql": 0.04317475529387593, + "native": 0.0004403255879878998 + }, + "natives": { + "find": { + "native_median_s": 0.684691967908293, + "ratio": { + "min": 0.12069943282149223, + "median": 0.484006243162017, + "max": 0.7392184551112306, + "spread": 1.2779153802830068 + } + }, + "fd": { + "native_median_s": 0.16567404428496957, + "ratio": { + "min": 0.4161007250796655, + "median": 1.6075107521595067, + "max": 2.3301354145763202, + "spread": 1.1906823558880513 + } + }, + "rg": { + "native_median_s": 0.26808103267103434, + "ratio": { + "min": 0.6834321861776953, + "median": 0.985871038431263, + "max": 1.6469654942692438, + "spread": 0.9773421375931087 + } + }, + "bash-globstar": { + "native_median_s": 24.289611471351236, + "ratio": { + "min": 0.0029763587251734674, + "median": 0.010508798723467955, + "max": 0.056618114601992627, + "spread": 5.104461250840012 + } + } + }, + "skipped": [] + }, + { + "name": "./**/*.md (dotfiles)", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.8145378196300403, + "dirsql_median_s": 0.09214010322466493, + "startup": { + "dirsql": 0.04171129688620567, + "native": 0.00040817540138959885 + }, + "natives": { + "find": { + "native_median_s": 0.21169967902824283, + "ratio": { + "min": 0.07672964175857519, + "median": 0.2485400019514153, + "max": 0.3222289709232173, + "spread": 0.9877658615800301 + } + }, + "fd": { + "native_median_s": 0.028017914853990078, + "ratio": { + "min": 0.3691682140858597, + "median": 1.8145378196300403, + "max": 2.8272917361369223, + "spread": 1.3546829917010164 + } + }, + "rg": { + "native_median_s": 0.042140376288443804, + "ratio": { + "min": 1.0182401859908854, + "median": 1.2269581636461946, + "max": 1.880805380891604, + "spread": 0.7030110890964721 + } + } + }, + "skipped": [] + }, + { + "name": "./**/*.md (symlinks)", + "pairs": 100, + "fastest": "bash-globstar", + "ratio_vs_fastest": 0.1180603584055411, + "dirsql_median_s": 0.19396950118243694, + "startup": { + "dirsql": 0.05182130774483085, + "native": 0.0005222498439252377 + }, + "natives": { + "bash-globstar": { + "native_median_s": 1.2660114169120789, + "ratio": { + "min": 0.08202200700395504, + "median": 0.1180603584055411, + "max": 0.19387032690057568, + "spread": 0.9473825203242064 + } + } + }, + "skipped": [] + }, + { + "name": "./**/.*", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 0.9152246467452294, + "dirsql_median_s": 0.06670410512015224, + "startup": { + "dirsql": 0.04171129688620567, + "native": 0.00040817540138959885 + }, + "natives": { + "find": { + "native_median_s": 0.16991779347881675, + "ratio": { + "min": 0.0688181262917886, + "median": 0.14565105913724055, + "max": 0.24382255997993443, + "spread": 1.201532173708719 + } + }, + "fd": { + "native_median_s": 0.028039528522640467, + "ratio": { + "min": 0.5690015617856576, + "median": 0.9152246467452294, + "max": 1.5380163757436045, + "spread": 1.05877263839431 + } + }, + "rg": { + "native_median_s": 0.02904764050617814, + "ratio": { + "min": 0.6591862444482206, + "median": 0.8841535566718317, + "max": 1.6346170101631685, + "spread": 1.103236828438157 + } + } + }, + "skipped": [] + }, + { + "name": "./**/[[:digit:]]*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.4463925983258132, + "dirsql_median_s": 0.12827033223584294, + "startup": { + "dirsql": 0.04374499246478081, + "native": 0.0004091830924153328 + }, + "natives": { + "find": { + "native_median_s": 0.5384321152232587, + "ratio": { + "min": 0.08148277916545896, + "median": 0.15677131619285123, + "max": 0.18575907845733633, + "spread": 0.6651490963028118 + } + }, + "fd": { + "native_median_s": 0.0588988596573472, + "ratio": { + "min": 0.33916334994720043, + "median": 1.4463925983258132, + "max": 1.73036516133723, + "spread": 0.9618424575736445 + } + }, + "rg": { + "native_median_s": 0.128511106595397, + "ratio": { + "min": 0.5778611963026407, + "median": 0.6683747756881517, + "max": 0.9241939452690268, + "spread": 0.5181714833714446 + } + } + }, + "skipped": [] + }, + { + "name": "./**/[a-c]*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.9418960436821378, + "dirsql_median_s": 0.19051358895376325, + "startup": { + "dirsql": 0.04374499246478081, + "native": 0.0004091830924153328 + }, + "natives": { + "find": { + "native_median_s": 0.5361233735457063, + "ratio": { + "min": 0.2263853783898733, + "median": 0.27273096229737676, + "max": 0.920150098614638, + "spread": 2.5437695609650173 + } + }, + "fd": { + "native_median_s": 0.0764900422655046, + "ratio": { + "min": 1.2417372170047953, + "median": 1.9418960436821378, + "max": 8.243830079024812, + "spread": 3.6058021153094053 + } + }, + "rg": { + "native_median_s": 0.13713165279477835, + "ratio": { + "min": 0.7530750727240906, + "median": 1.0831990214959812, + "max": 4.4952163336682025, + "spread": 3.4547125566785746 + } + } + }, + "skipped": [] + }, + { + "name": "./**/file?.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.8390424645493098, + "dirsql_median_s": 0.12953275442123413, + "startup": { + "dirsql": 0.04374499246478081, + "native": 0.0004091830924153328 + }, + "natives": { + "find": { + "native_median_s": 0.5135061889886856, + "ratio": { + "min": 0.135980071866109, + "median": 0.16705810542778116, + "max": 0.44760378657503186, + "spread": 1.8653612400964112 + } + }, + "fd": { + "native_median_s": 0.047051497269421816, + "ratio": { + "min": 1.4734900629428196, + "median": 1.8390424645493098, + "max": 4.880964244926996, + "spread": 1.8528523662009286 + } + }, + "rg": { + "native_median_s": 0.12807788094505668, + "ratio": { + "min": 0.5309850492962176, + "median": 0.6787145035619674, + "max": 1.7535542938141568, + "spread": 1.8013011923301523 + } + } + }, + "skipped": [] + }, + { + "name": "./**/node_modules/pkg/*.js", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.2960642324610074, + "dirsql_median_s": 0.5069544278085232, + "startup": { + "dirsql": 0.04512234404683113, + "native": 0.0003999774344265461 + }, + "natives": { + "find": { + "native_median_s": 1.3213499649427831, + "ratio": { + "min": 0.30211621221446144, + "median": 0.3547797134277262, + "max": 0.41909527753468206, + "spread": 0.3297230954668184 + } + }, + "fd": { + "native_median_s": 0.3553189905360341, + "ratio": { + "min": 1.022756219952672, + "median": 1.2960642324610074, + "max": 1.510037884541971, + "spread": 0.37597030485443866 + } + }, + "rg": { + "native_median_s": 0.38030867278575897, + "ratio": { + "min": 1.0582544021301787, + "median": 1.2170625674599145, + "max": 1.4175344233392144, + "spread": 0.295202589262831 + } + } + }, + "skipped": [] + }, + { + "name": "./**/{a,b}*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 2.0585678792449658, + "dirsql_median_s": 0.17535279225558043, + "startup": { + "dirsql": 0.04374499246478081, + "native": 0.0004091830924153328 + }, + "natives": { + "find": { + "native_median_s": 0.5674326010048389, + "ratio": { + "min": 0.21164926197715245, + "median": 0.23148351626650948, + "max": 0.2652604144319263, + "spread": 0.23159814279411034 + } + }, + "fd": { + "native_median_s": 0.06409170711413026, + "ratio": { + "min": 1.8138845353664401, + "median": 2.0585678792449658, + "max": 2.4800576561731673, + "spread": 0.32360998513736833 + } + }, + "rg": { + "native_median_s": 0.13392447726801038, + "ratio": { + "min": 0.8760883559244298, + "median": 0.9886645621353751, + "max": 1.1950193615153368, + "spread": 0.3225876781727276 + } + } + }, + "skipped": [] + }, + { + "name": "./*/*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 2.103168600943996, + "dirsql_median_s": 0.6173731535673141, + "startup": { + "dirsql": 0.04336583008989692, + "native": 0.00041067134588956833 + }, + "natives": { + "find": { + "native_median_s": 1.2862132266163826, + "ratio": { + "min": 0.3829413887258897, + "median": 0.44374855079293385, + "max": 0.4698357624801821, + "spread": 0.19581894656111204 + } + }, + "fd": { + "native_median_s": 0.2724251435138285, + "ratio": { + "min": 1.8855870175286613, + "median": 2.103168600943996, + "max": 2.3430156819189754, + "spread": 0.2174950045303071 + } + }, + "rg": { + "native_median_s": 0.47721981070935726, + "ratio": { + "min": 1.1287892600353675, + "median": 1.2027785096694212, + "max": 1.3264995396353454, + "spread": 0.16437796153700632 + } + } + }, + "skipped": [] + }, + { + "name": "./.cache/**/*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 1.8750918024454417, + "dirsql_median_s": 0.06931171705946326, + "startup": { + "dirsql": 0.04171129688620567, + "native": 0.00040817540138959885 + }, + "natives": { + "find": { + "native_median_s": 0.09505288163200021, + "ratio": { + "min": 0.23844778869154987, + "median": 0.2915264826087963, + "max": 0.3691468494485757, + "spread": 0.44832654511327125 + } + }, + "fd": { + "native_median_s": 0.01504199206829071, + "ratio": { + "min": 1.4731665818660415, + "median": 1.8750918024454417, + "max": 2.5572814962182817, + "spread": 0.5781663132111016 + } + }, + "rg": { + "native_median_s": 0.026355950627475977, + "ratio": { + "min": 0.8575998393898103, + "median": 1.0511611445924274, + "max": 1.598774995903245, + "spread": 0.7051013636932086 + } + } + }, + "skipped": [] + }, + { + "name": "./a/b/**/*.md", + "pairs": 100, + "fastest": "fd", + "ratio_vs_fastest": 2.6395204307750944, + "dirsql_median_s": 0.14879646757617593, + "startup": { + "dirsql": 0.04317475529387593, + "native": 0.0004403255879878998 + }, + "natives": { + "find": { + "native_median_s": 0.1605646819807589, + "ratio": { + "min": 0.27155181831764214, + "median": 0.6633944142429227, + "max": 1.2507734842460376, + "spread": 1.4760776468790446 + } + }, + "fd": { + "native_median_s": 0.039891429245471954, + "ratio": { + "min": 1.7267235674838017, + "median": 2.6395204307750944, + "max": 5.539963073523928, + "spread": 1.444671335588173 + } + }, + "rg": { + "native_median_s": 0.0476693082600832, + "ratio": { + "min": 1.1465349791491792, + "median": 2.2332186371172, + "max": 3.77754150140363, + "spread": 1.1781231262026113 + } + }, + "bash-globstar": { + "native_median_s": 1.6930465600453317, + "ratio": { + "min": 0.03183114415322659, + "median": 0.06356535357982859, + "max": 0.14050207619016195, + "spread": 1.7095937632197844 + } + } + }, + "skipped": [] + }, + { + "name": "./docs/", + "pairs": 100, + "fastest": "rg", + "ratio_vs_fastest": 1.553477842919154, + "dirsql_median_s": 0.09875010745599866, + "startup": { + "dirsql": 0.05182130774483085, + "native": 0.0005222498439252377 + }, + "natives": { + "find": { + "native_median_s": 0.049924051854759455, + "ratio": { + "min": 0.44844777170857936, + "median": 0.8865461233361773, + "max": 1.8156510979268532, + "spread": 1.5421682981065068 + } + }, + "fd": { + "native_median_s": 0.030036467127501965, + "ratio": { + "min": 0.8276085132801542, + "median": 1.5261404109013066, + "max": 3.42335083221781, + "spread": 1.7008541942773567 + } + }, + "rg": { + "native_median_s": 0.029316918924450874, + "ratio": { + "min": 0.7858381308335222, + "median": 1.553477842919154, + "max": 3.410712653323333, + "spread": 1.6896761897532993 + } + }, + "bash-glob": { + "native_median_s": 0.36131938081234694, + "ratio": { + "min": 0.08297725229748028, + "median": 0.13045685563895193, + "max": 0.26734663258042607, + "spread": 1.413259421131538 + } + } + }, + "skipped": [] + }, + { + "name": "SELECT path, size, mtime FROM './**/*'", + "pairs": 100, + "fastest": "fd+xargs-stat", + "ratio_vs_fastest": 0.3235799572275418, + "dirsql_median_s": 0.6021403819322586, + "startup": { + "dirsql": 0.04881615750491619, + "native": 0.0005126670002937317 + }, + "natives": { + "find": { + "native_median_s": 2.1140231522731483, + "ratio": { + "min": 0.16531256682499798, + "median": 0.2637872975615604, + "max": 0.5187958057585941, + "spread": 1.3400313138698547 + } + }, + "fd+xargs-stat": { + "native_median_s": 1.742570803500712, + "ratio": { + "min": 0.22449302282194952, + "median": 0.3235799572275418, + "max": 0.5750554231944357, + "spread": 1.0833872511021143 + } + } + }, + "skipped": [] + }, + { + "name": "dossier", + "pairs": 100, + "fastest": "find+sort", + "ratio_vs_fastest": 0.7228566638082013, + "dirsql_median_s": 1.2697407118976116, + "startup": { + "dirsql": 0.047647406347095966, + "native": 0.0005206293426454067 + }, + "natives": { + "find+sort": { + "native_median_s": 1.6745033948682249, + "ratio": { + "min": 0.36512471937302987, + "median": 0.7228566638082013, + "max": 0.956676842458855, + "spread": 0.8183532817825474 + } + } + }, + "skipped": [] + }, + { + "name": "frontmatter", + "pairs": 100, + "fastest": "fd+xargs-P", + "ratio_vs_fastest": 2.4095204547374824, + "dirsql_median_s": 0.26238039368763566, + "startup": { + "dirsql": 0.04049963876605034, + "native": 0.00039654597640037537 + }, + "natives": { + "find+awk": { + "native_median_s": 1.2870315061882138, + "ratio": { + "min": 0.15895938672615403, + "median": 0.17238575840692094, + "max": 0.21266609721957688, + "spread": 0.31154957920970944 + } + }, + "find+xargs-P": { + "native_median_s": 0.10526509629562497, + "ratio": { + "min": 1.7436095362624138, + "median": 2.152379112014465, + "max": 2.9583406127437297, + "spread": 0.5643666906544261 + } + }, + "fd+xargs-P": { + "native_median_s": 0.09208264946937561, + "ratio": { + "min": 2.0592310116298007, + "median": 2.4095204547374824, + "max": 2.930915124698539, + "spread": 0.3617666375709222 + } + } + }, + "skipped": [] + }, + { + "name": "join", + "pairs": 100, + "fastest": "find+join", + "ratio_vs_fastest": 0.41540942787675106, + "dirsql_median_s": 0.6275208671577275, + "startup": { + "dirsql": 0.06408161576837301, + "native": 0.000562470406293869 + }, + "natives": { + "find+join": { + "native_median_s": 1.3584670661948621, + "ratio": { + "min": 0.3308432749846113, + "median": 0.41540942787675106, + "max": 0.557633521083667, + "spread": 0.5459439070948162 + } + } + }, + "skipped": [] + }, + { + "name": "jsonl", + "pairs": 100, + "fastest": "jq+xargs-P", + "ratio_vs_fastest": 1.7296374861655641, + "dirsql_median_s": 0.8902361649088562, + "startup": { + "dirsql": 0.04639138001948595, + "native": 0.0005492004565894604 + }, + "natives": { + "jq": { + "native_median_s": 1.838538933545351, + "ratio": { + "min": 0.3092080551683473, + "median": 0.46050968225126443, + "max": 0.5684997310154839, + "spread": 0.5630536899453532 + } + }, + "jq+xargs-P": { + "native_median_s": 0.48580322321504354, + "ratio": { + "min": 1.0342743643670855, + "median": 1.7296374861655641, + "max": 2.08464695097001, + "spread": 0.6072790367948703 + } + } + }, + "skipped": [] + }, + { + "name": "notebook", + "pairs": 100, + "fastest": "python", + "ratio_vs_fastest": 0.8744208486860523, + "dirsql_median_s": 1.462386173196137, + "startup": { + "dirsql": 0.04729705723002553, + "native": 0.000545185524970293 + }, + "natives": { + "python": { + "native_median_s": 1.6009856974706054, + "ratio": { + "min": 0.6531823970717672, + "median": 0.8744208486860523, + "max": 1.1112931851917809, + "spread": 0.5239019504262661 + } + } + }, + "skipped": [] + }, + { + "name": "transcripts", + "pairs": 100, + "fastest": "find+python", + "ratio_vs_fastest": 0.5251599400414295, + "dirsql_median_s": 0.6688711191527545, + "startup": { + "dirsql": 0.04383886372670531, + "native": 0.0004687458276748657 + }, + "natives": { + "find+python": { + "native_median_s": 1.1891633863560855, + "ratio": { + "min": 0.43204983022992943, + "median": 0.5251599400414295, + "max": 0.6394844434807796, + "spread": 0.3949932152754945 + } + }, + "find+xargs-P": { + "native_median_s": 1.3170048808678985, + "ratio": { + "min": 0.39742972917950886, + "median": 0.48030201676902373, + "max": 0.5665173631047792, + "spread": 0.3520443971122949 + } + }, + "fd+xargs-P": { + "native_median_s": 1.3271472500637174, + "ratio": { + "min": 0.4044203404405252, + "median": 0.47446099970953837, + "max": 0.5942513630743389, + "spread": 0.4000982646624841 + } + } + }, + "skipped": [] + }, + { + "name": "watch", + "pairs": 100, + "fastest": "inotifywait", + "ratio_vs_fastest": 1.152027792496878, + "dirsql_median_s": 0.0003759157843887806, + "startup": { + "dirsql": 0.0, + "native": 0.0 + }, + "natives": { + "inotifywait": { + "native_median_s": 0.0003305911086499691, + "ratio": { + "min": 0.7313964542040972, + "median": 1.152027792496878, + "max": 1.6483629078046584, + "spread": 0.795958621460989 + } + } + }, + "skipped": [] + } + ] +} diff --git a/docs/speed.md b/docs/speed.md new file mode 100644 index 000000000..8b0db20ab --- /dev/null +++ b/docs/speed.md @@ -0,0 +1,267 @@ +# dirsql performance suite + +- Commit: 462b3c6afccefeb91cf93153141a82a330c318e3 +- Date: 2026-10-14T01:49:05Z +- Machine: platform: Linux-7.0.0-28-generic-x86_64-with-glibc2.39, cpu: AMD Ryzen 9 9950X 16-Core Processor, cpus: 32 +- Versions: bash: GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu), find: find (GNU findutils) 4.9.0, rg: ripgrep 14.1.0, xargs: xargs (GNU findutils) 4.9.0, inotifywait: inotifywait 3.22.6.0 +- Method: 100 paired runs per case, interleaved; ratios are dirsql over the native after each side's startup, median across pairs +- Cadence: rerun with `just bench-suite` after a change to how dirsql walks, matches, queries or serializes, and when this report is more than 30 days old + +| Case | Fastest native | dirsql / fastest | Spread | vs 1.0x | +|---|---|---|---|---| +| `./*` | rg | 1.43x | 83% | over | +| `./**` | fd | 1.39x | 28% | over | +| `./**/*.js` | fd | 2.16x | 60% | over | +| `./**/*.md` | fd | 1.61x | 119% | over | +| `./**/*.md (dotfiles)` | fd | 1.81x | 135% | over | +| `./**/*.md (symlinks)` | bash-globstar | 0.12x | 95% | ok | +| `./**/.*` | fd | 0.92x | 106% | ok | +| `./**/[[:digit:]]*.md` | fd | 1.45x | 96% | over | +| `./**/[a-c]*.md` | fd | 1.94x | 361% | over | +| `./**/file?.md` | fd | 1.84x | 185% | over | +| `./**/node_modules/pkg/*.js` | fd | 1.30x | 38% | over | +| `./**/{a,b}*.md` | fd | 2.06x | 32% | over | +| `./*/*.md` | fd | 2.10x | 22% | over | +| `./.cache/**/*.md` | fd | 1.88x | 58% | over | +| `./a/b/**/*.md` | fd | 2.64x | 144% | over | +| `./docs/` | rg | 1.55x | 169% | over | +| `SELECT path, size, mtime FROM './**/*'` | fd+xargs-stat | 0.32x | 108% | ok | +| `dossier` | find+sort | 0.72x | 82% | ok | +| `frontmatter` | fd+xargs-P | 2.41x | 36% | over | +| `join` | find+join | 0.42x | 55% | ok | +| `jsonl` | jq+xargs-P | 1.73x | 61% | over | +| `notebook` | python | 0.87x | 52% | ok | +| `transcripts` | find+python | 0.53x | 39% | ok | +| `watch` | inotifywait | 1.15x | 80% | over | + +## `./*` + +dirsql median 0.665s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| bash-glob | 14.463 | 0.04x | 0.04x | 0.04x | 20% | +| fd | 0.502 | 1.23x | 0.49x | 1.54x | 85% | +| find | 0.605 | 1.01x | 0.74x | 1.06x | 32% | +| rg | 0.427 | 1.43x | 0.42x | 1.59x | 83% | + +## `./**` + +dirsql median 0.267s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.152 | 1.39x | 1.24x | 1.62x | 28% | +| git-ls-files | 0.559 | 0.38x | 0.30x | 0.46x | 44% | +| rg | 0.196 | 1.09x | 0.95x | 1.53x | 53% | + +## `./**/*.js` + +dirsql median 0.692s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.303 | 2.16x | 1.43x | 2.74x | 60% | +| find | 1.181 | 0.55x | 0.34x | 0.73x | 71% | +| rg | 0.567 | 1.14x | 0.94x | 1.44x | 44% | + +## `./**/*.md` + +dirsql median 0.300s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| bash-globstar | 24.290 | 0.01x | 0.00x | 0.06x | 510% | +| fd | 0.166 | 1.61x | 0.42x | 2.33x | 119% | +| find | 0.685 | 0.48x | 0.12x | 0.74x | 128% | +| rg | 0.268 | 0.99x | 0.68x | 1.65x | 98% | + +## `./**/*.md (dotfiles)` + +dirsql median 0.092s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.028 | 1.81x | 0.37x | 2.83x | 135% | +| find | 0.212 | 0.25x | 0.08x | 0.32x | 99% | +| rg | 0.042 | 1.23x | 1.02x | 1.88x | 70% | + +## `./**/*.md (symlinks)` + +dirsql median 0.194s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| bash-globstar | 1.266 | 0.12x | 0.08x | 0.19x | 95% | + +## `./**/.*` + +dirsql median 0.067s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.028 | 0.92x | 0.57x | 1.54x | 106% | +| find | 0.170 | 0.15x | 0.07x | 0.24x | 120% | +| rg | 0.029 | 0.88x | 0.66x | 1.63x | 110% | + +## `./**/[[:digit:]]*.md` + +dirsql median 0.128s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.059 | 1.45x | 0.34x | 1.73x | 96% | +| find | 0.538 | 0.16x | 0.08x | 0.19x | 67% | +| rg | 0.129 | 0.67x | 0.58x | 0.92x | 52% | + +## `./**/[a-c]*.md` + +dirsql median 0.191s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.076 | 1.94x | 1.24x | 8.24x | 361% | +| find | 0.536 | 0.27x | 0.23x | 0.92x | 254% | +| rg | 0.137 | 1.08x | 0.75x | 4.50x | 345% | + +## `./**/file?.md` + +dirsql median 0.130s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.047 | 1.84x | 1.47x | 4.88x | 185% | +| find | 0.514 | 0.17x | 0.14x | 0.45x | 187% | +| rg | 0.128 | 0.68x | 0.53x | 1.75x | 180% | + +## `./**/node_modules/pkg/*.js` + +dirsql median 0.507s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.355 | 1.30x | 1.02x | 1.51x | 38% | +| find | 1.321 | 0.35x | 0.30x | 0.42x | 33% | +| rg | 0.380 | 1.22x | 1.06x | 1.42x | 30% | + +## `./**/{a,b}*.md` + +dirsql median 0.175s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.064 | 2.06x | 1.81x | 2.48x | 32% | +| find | 0.567 | 0.23x | 0.21x | 0.27x | 23% | +| rg | 0.134 | 0.99x | 0.88x | 1.20x | 32% | + +## `./*/*.md` + +dirsql median 0.617s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.272 | 2.10x | 1.89x | 2.34x | 22% | +| find | 1.286 | 0.44x | 0.38x | 0.47x | 20% | +| rg | 0.477 | 1.20x | 1.13x | 1.33x | 16% | + +## `./.cache/**/*.md` + +dirsql median 0.069s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd | 0.015 | 1.88x | 1.47x | 2.56x | 58% | +| find | 0.095 | 0.29x | 0.24x | 0.37x | 45% | +| rg | 0.026 | 1.05x | 0.86x | 1.60x | 71% | + +## `./a/b/**/*.md` + +dirsql median 0.149s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| bash-globstar | 1.693 | 0.06x | 0.03x | 0.14x | 171% | +| fd | 0.040 | 2.64x | 1.73x | 5.54x | 144% | +| find | 0.161 | 0.66x | 0.27x | 1.25x | 148% | +| rg | 0.048 | 2.23x | 1.15x | 3.78x | 118% | + +## `./docs/` + +dirsql median 0.099s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| bash-glob | 0.361 | 0.13x | 0.08x | 0.27x | 141% | +| fd | 0.030 | 1.53x | 0.83x | 3.42x | 170% | +| find | 0.050 | 0.89x | 0.45x | 1.82x | 154% | +| rg | 0.029 | 1.55x | 0.79x | 3.41x | 169% | + +## `SELECT path, size, mtime FROM './**/*'` + +dirsql median 0.602s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd+xargs-stat | 1.743 | 0.32x | 0.22x | 0.58x | 108% | +| find | 2.114 | 0.26x | 0.17x | 0.52x | 134% | + +## `dossier` + +dirsql median 1.270s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| find+sort | 1.675 | 0.72x | 0.37x | 0.96x | 82% | + +## `frontmatter` + +dirsql median 0.262s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd+xargs-P | 0.092 | 2.41x | 2.06x | 2.93x | 36% | +| find+awk | 1.287 | 0.17x | 0.16x | 0.21x | 31% | +| find+xargs-P | 0.105 | 2.15x | 1.74x | 2.96x | 56% | + +## `join` + +dirsql median 0.628s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| find+join | 1.358 | 0.42x | 0.33x | 0.56x | 55% | + +## `jsonl` + +dirsql median 0.890s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| jq | 1.839 | 0.46x | 0.31x | 0.57x | 56% | +| jq+xargs-P | 0.486 | 1.73x | 1.03x | 2.08x | 61% | + +## `notebook` + +dirsql median 1.462s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| python | 1.601 | 0.87x | 0.65x | 1.11x | 52% | + +## `transcripts` + +dirsql median 0.669s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| fd+xargs-P | 1.327 | 0.47x | 0.40x | 0.59x | 40% | +| find+python | 1.189 | 0.53x | 0.43x | 0.64x | 39% | +| find+xargs-P | 1.317 | 0.48x | 0.40x | 0.57x | 35% | + +## `watch` + +dirsql median 0.000s + +| Native | Median s | dirsql / native | Min | Max | Spread | +|---|---|---|---|---|---| +| inotifywait | 0.000 | 1.15x | 0.73x | 1.65x | 80% | diff --git a/packages/python/e2e-attestations/bot-1470-speed-page-1011.json b/packages/python/e2e-attestations/bot-1470-speed-page-1011.json new file mode 100644 index 000000000..08a8ee048 --- /dev/null +++ b/packages/python/e2e-attestations/bot-1470-speed-page-1011.json @@ -0,0 +1,7 @@ +{ + "command": "uv run python -m pytest tests/e2e/glob_speed_recursive_test.py tests/e2e/stat_speed_test.py -x -q", + "ran_at": 1791767913, + "exit_code": 0, + "commit": "236f11457ee26440323331067d3c95ae57b59eee", + "branch": "bot/1470-speed-page-1011" +} diff --git a/packages/python/tests/e2e/bench_report.py b/packages/python/tests/e2e/bench_report.py index 554702371..98416d366 100644 --- a/packages/python/tests/e2e/bench_report.py +++ b/packages/python/tests/e2e/bench_report.py @@ -66,6 +66,11 @@ def render_markdown(report): " are dirsql over the native after each side's startup, median across" " pairs" ), + ( + "- Cadence: rerun with `just bench-suite` after a change to how dirsql" + " walks, matches, queries or serializes, and when this report is more" + " than 30 days old" + ), "", "| Case | Fastest native | dirsql / fastest | Spread | vs 1.0x |", "|---|---|---|---|---|", @@ -74,13 +79,13 @@ def render_markdown(report): stats = case["natives"][case["fastest"]]["ratio"] verdict = "over" if case["ratio_vs_fastest"] > 1.0 else "ok" lines.append( - f"| {case['name']} | {case['fastest']} | {case['ratio_vs_fastest']:.2f}x" + f"| `{case['name']}` | {case['fastest']} | {case['ratio_vs_fastest']:.2f}x" f" | {stats['spread']:.0%} | {verdict} |" ) for case in report["cases"]: lines += [ "", - f"## {case['name']}", + f"## `{case['name']}`", "", f"dirsql median {case['dirsql_median_s']:.3f}s", "", diff --git a/packages/python/tests/integration/hermetic/bench_report_test.py b/packages/python/tests/integration/hermetic/bench_report_test.py index dbb35df7a..43b1657a4 100644 --- a/packages/python/tests/integration/hermetic/bench_report_test.py +++ b/packages/python/tests/integration/hermetic/bench_report_test.py @@ -135,13 +135,18 @@ def it_states_commit_date_machine_and_versions(): def it_lists_each_case_with_its_ratio_to_the_fastest_native(): md = render_markdown(sample_report()) - assert "| slow-case | bash-globstar | 3.00x |" in md - assert "| fast-case | find | 0.50x |" in md + assert "| `slow-case` | bash-globstar | 3.00x |" in md + assert "| `fast-case` | find | 0.50x |" in md def it_flags_cases_above_the_fastest_native(): md = render_markdown(sample_report()) - assert "slow-case | bash-globstar | 3.00x | 0% | over" in md - assert "fast-case | find | 0.50x | 0% | ok" in md + assert "`slow-case` | bash-globstar | 3.00x | 0% | over" in md + assert "`fast-case` | find | 0.50x | 0% | ok" in md + + def it_names_the_cadence_that_makes_staleness_checkable(): + md = render_markdown(sample_report()) + assert "30 days" in md + assert "just bench-suite" in md def it_details_every_native_and_the_skipped_ones(): md = render_markdown(sample_report()) diff --git a/packages/python/tests/integration/hermetic/speed_page_test.py b/packages/python/tests/integration/hermetic/speed_page_test.py new file mode 100644 index 000000000..b24d3e5b5 --- /dev/null +++ b/packages/python/tests/integration/hermetic/speed_page_test.py @@ -0,0 +1,18 @@ +"""The committed speed page is the rendering of the committed suite report.""" + +import json +from pathlib import Path + +from tests.e2e.bench_report import render_markdown + +DOCS = Path(__file__).resolve().parents[5] / "docs" + + +def describe_speed_page(): + def it_is_the_rendering_of_the_committed_report(): + report = json.loads((DOCS / "speed.json").read_text()) + assert (DOCS / "speed.md").read_text() == render_markdown(report) + + def it_is_reachable_from_the_sidebar(): + config = (DOCS / ".vitepress" / "config.ts").read_text() + assert "link: '/speed'" in config