Skip to content

Simplify format checks - #107

Open
blakeembrey wants to merge 1 commit into
masterfrom
be/control-check
Open

Simplify format checks#107
blakeembrey wants to merge 1 commit into
masterfrom
be/control-check

Conversation

@blakeembrey

Copy link
Copy Markdown
Member

Marginal perf bump by validating control characters together. Small simplification on object validation for bytes.

Before:

 ✓ src/format.bench.ts > format 4276ms
     name                                       hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · format with simple credentials   3,758,643.72  0.0001  3.4189  0.0003  0.0003  0.0003  0.0004  0.0015  ±1.43%  1879322
   · format with long credentials     2,887,119.72  0.0002  0.2407  0.0003  0.0003  0.0004  0.0005  0.0026  ±0.34%  1443560
   · format with unicode credentials  3,628,485.19  0.0002  0.2014  0.0003  0.0003  0.0003  0.0004  0.0010  ±0.30%  1814243
   · format with special characters   3,538,610.78  0.0002  6.7937  0.0003  0.0003  0.0003  0.0004  0.0014  ±2.68%  1769306

After:

 ✓ src/format.bench.ts > format 4275ms
     name                                       hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · format with simple credentials   3,810,883.80  0.0002  0.6533  0.0003  0.0003  0.0003  0.0004  0.0015  ±0.34%  1905442
   · format with long credentials     2,866,106.83  0.0002  0.2182  0.0003  0.0003  0.0004  0.0005  0.0014  ±0.34%  1433054
   · format with unicode credentials  3,657,358.93  0.0002  0.3126  0.0003  0.0003  0.0003  0.0004  0.0008  ±0.32%  1828680
   · format with special characters   3,490,155.23  0.0002  0.1538  0.0003  0.0003  0.0003  0.0004  0.0009  ±0.27%  1745078

It's not a huge improvement so we could just leave it, but I don't see any reason not to include it 🤷

@blakeembrey
blakeembrey requested a review from Phillip9587 July 31, 2026 16:59
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fcfd3a3) to head (6e23775).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #107   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           41        38    -3     
  Branches        13        10    -3     
=========================================
- Hits            41        38    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants