Skip to content

perf: add benchmark infrastructure and performance documentation#177

Merged
HugoRCD merged 9 commits intomainfrom
EVL-120
Mar 14, 2026
Merged

perf: add benchmark infrastructure and performance documentation#177
HugoRCD merged 9 commits intomainfrom
EVL-120

Conversation

@HugoRCD
Copy link
Copy Markdown
Owner

@HugoRCD HugoRCD commented Mar 14, 2026

This pull request introduces a comprehensive performance benchmarking and regression tracking system for the evlog package.
It adds automated CI workflows to benchmark both performance and bundle size on every pull request, provides a detailed markdown comparison report as a PR comment, and documents the benchmarking methodology and results.
Additionally, it introduces granular benchmark scripts for all core features and enrichers.

@HugoRCD HugoRCD self-assigned this Mar 14, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-docs Ready Ready Preview, Comment, Open in v0 Mar 14, 2026 4:39pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 14, 2026

Thank you for following the naming conventions! 🙏

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 14, 2026

npm i https://pkg.pr.new/evlog@177
npm i https://pkg.pr.new/@evlog/nuxthub@177

commit: de6af3b

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 14, 2026

Benchmark report

Performance (first run — no baseline to compare)

Benchmark ops/sec Mean p99
createUserAgentEnricher > Chrome desktop 908.7K 0.0011ms 0.0023ms
createUserAgentEnricher > Firefox Linux 1.44M 0.0007ms 0.0009ms
createUserAgentEnricher > Googlebot 1.58M 0.0006ms 0.0008ms
createUserAgentEnricher > no user-agent header 12.26M 0.0001ms 0.0001ms
createGeoEnricher > Vercel headers (full) 1.99M 0.0005ms 0.0006ms
createGeoEnricher > Cloudflare headers (country only) 458.0K 0.0022ms 0.0024ms
createGeoEnricher > no geo headers 1.21M 0.0008ms 0.0009ms
createRequestSizeEnricher > with content-length 9.08M 0.0001ms 0.0001ms
createRequestSizeEnricher > no content-length 8.21M 0.0001ms 0.0002ms
createTraceContextEnricher > with traceparent 1.92M 0.0005ms 0.0006ms
createTraceContextEnricher > with traceparent + tracestate 3.31M 0.0003ms 0.0004ms
createTraceContextEnricher > no trace headers 6.36M 0.0002ms 0.0002ms
full enricher pipeline > all enrichers (all headers present) 176.3K 0.0057ms 0.0117ms
full enricher pipeline > all enrichers (no headers) 927.3K 0.0011ms 0.0012ms
createError > string message 108.4K 0.0092ms 0.0179ms
createError > with status 106.6K 0.0094ms 0.0184ms
createError > full options 104.8K 0.0095ms 0.0189ms
createError > with cause 80.3K 0.0125ms 0.0218ms
parseError > parse EvlogError 5.55M 0.0002ms 0.0002ms
parseError > parse plain Error 14.54M 0.0001ms 0.0001ms
parseError > parse fetch-like error 14.36M 0.0001ms 0.0001ms
parseError > parse string 13.53M 0.0001ms 0.0001ms
createError + parseError round-trip > create + parse (simple) 108.2K 0.0092ms 0.0182ms
createError + parseError round-trip > create + parse (full) 78.4K 0.0128ms 0.0220ms
EvlogError serialization > toJSON() 4.22M 0.0002ms 0.0003ms
EvlogError serialization > toString() 1.37M 0.0007ms 0.0009ms
EvlogError serialization > JSON.stringify() 707.7K 0.0014ms 0.0016ms
JSON serialization (production mode) > emit + JSON.stringify 285.6K 0.0035ms 0.0068ms
pretty print (development mode) > emit + pretty print 294.9K 0.0034ms 0.0078ms
silent mode (no output) > emit silent (event build only) 289.6K 0.0035ms 0.0070ms
JSON.stringify baseline > raw JSON.stringify (same payload) 611.3K 0.0016ms 0.0025ms
createLogger > no initial context 7.58M 0.0001ms 0.0002ms
createLogger > with shallow context 7.61M 0.0001ms 0.0002ms
createLogger > with nested context 7.04M 0.0001ms 0.0002ms
createRequestLogger > with method + path 7.50M 0.0001ms 0.0002ms
createRequestLogger > with method + path + requestId 5.15M 0.0002ms 0.0002ms
log.set() > shallow merge (3 fields) 5.77M 0.0002ms 0.0002ms
log.set() > shallow merge (10 fields) 4.95M 0.0002ms 0.0003ms
log.set() > deep nested merge 2.02M 0.0005ms 0.0007ms
log.set() > multiple sequential sets 1.88M 0.0005ms 0.0007ms
log.emit() > emit minimal event 867.6K 0.0012ms 0.0015ms
log.emit() > emit with context 266.3K 0.0038ms 0.0063ms
log.emit() > emit with error 21.3K 0.0470ms 0.0989ms
log.emit() > full lifecycle (create + set + emit) 253.7K 0.0039ms 0.0082ms
log.set() payload sizes > small payload (2 fields) 643.6K 0.0016ms 0.0017ms
log.set() payload sizes > medium payload (50 fields) 54.2K 0.0184ms 0.0283ms
log.set() payload sizes > large payload (200 nested fields) 10.2K 0.0976ms 0.2038ms
head sampling > no sampling configured 156.8K 0.0064ms 0.0122ms
head sampling > with sampling rates 229.1K 0.0044ms 0.0081ms
tail sampling (shouldKeep) > no match (fast path) 14.35M 0.0001ms 0.0001ms
tail sampling (shouldKeep) > status match 14.41M 0.0001ms 0.0001ms
tail sampling (shouldKeep) > duration match 14.35M 0.0001ms 0.0001ms
tail sampling (shouldKeep) > path glob match 14.37M 0.0001ms 0.0001ms
head + tail sampling combined > full emit with sampling (likely sampled out) 848.0K 0.0012ms 0.0042ms
head + tail sampling combined > full emit with force-keep (tail sampling hit) 391.0K 0.0026ms 0.0057ms

Bundle size (first run — no baseline to compare)

Entry Raw Gzip
framework/nitro 17.44 kB 6.85 kB
logger 11.88 kB 3.64 kB
framework/next 8.93 kB 3.02 kB
adapter/sentry 6.00 kB 2.33 kB
adapter/otlp 5.71 kB 2.09 kB
enrichers 6.15 kB 1.92 kB
framework/sveltekit 4.84 kB 1.54 kB
adapter/posthog 4.78 kB 1.48 kB
adapter/fs 3.38 kB 1.42 kB
pipeline 4.17 kB 1.35 kB
utils 3.20 kB 1.34 kB
adapter/axiom 3.24 kB 1.30 kB
browser 2.93 kB 1.21 kB
error 3.06 kB 1.21 kB
framework/nestjs 2.79 kB 1.20 kB
adapter/better-stack 2.62 kB 1.08 kB
framework/elysia 2.51 kB 1.06 kB
framework/fastify 2.29 kB 1010 B
workers 2.08 kB 960 B
framework/express 1.23 kB 660 B
framework/hono 1.07 kB 593 B
toolkit 486 B 243 B
core (index) 497 B 205 B
types 11 B 31 B
Total 101.25 kB 37.66 kB

@HugoRCD HugoRCD merged commit 1e78560 into main Mar 14, 2026
13 checks passed
@HugoRCD HugoRCD deleted the EVL-120 branch March 14, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant