hckhanh
fast-url
BlogDocsChangelog

Optimize core URL building functions (20-40% performance improvement)

#81
Comparing
copilot/optimize-library-performance
(
abd77fe
) with
main
(
6a497ac
)
CodSpeed Performance Gauge
-57%
Improvements
13
Regressions
1
Untouched
143
Skipped
22

Benchmarks

Skipped (22)

Failed

Base URL with trailing slash + path
benchmark/urlcat.bench.ts::createUrl benchmarks::Simple cases
Regression
CodSpeed Performance Gauge
-57%
31 µs71.6 µs

Improved

Concatenate base URL and path only
benchmark/urlcat.bench.ts::createUrl benchmarks::Simple cases
CodSpeed Performance Gauge
+22%
82.5 µs67.5 µs
Path params with special characters
benchmark/urlcat.bench.ts::createUrl benchmarks::Medium complexity
CodSpeed Performance Gauge
+20%
112.8 µs94 µs
URL with port number
benchmark/urlcat.bench.ts::createUrl benchmarks::Real-world patterns
CodSpeed Performance Gauge
+15%
98.8 µs86.1 µs
Empty template
benchmark/subst.bench.ts::subst benchmarks::Parameter count scaling
CodSpeed Performance Gauge
+14%
67.8 µs59.3 µs
Base template only (no path)
benchmark/urlcat.bench.ts::createUrl benchmarks::Edge cases
CodSpeed Performance Gauge
+14%
98.2 µs86 µs
Resource with ID and nested resource
benchmark/urlcat.bench.ts::createUrl benchmarks::Real-world patterns
CodSpeed Performance Gauge
+14%
102 µs89.5 µs
Single path parameter
benchmark/urlcat.bench.ts::createUrl benchmarks::Simple cases
CodSpeed Performance Gauge
+14%
85 µs74.7 µs
Boolean and number params
benchmark/urlcat.bench.ts::createUrl benchmarks::Edge cases
CodSpeed Performance Gauge
+13%
113.1 µs99.7 µs
Three parameters (original)
benchmark/subst.bench.ts::subst benchmarks::Parameter count scaling
CodSpeed Performance Gauge
+13%
78.6 µs69.7 µs
Empty params object
benchmark/urlcat.bench.ts::createUrl benchmarks::Edge cases
CodSpeed Performance Gauge
+11%
26.7 µs24 µs
Join URL with trailing slash
benchmark/join.bench.ts::join benchmarks::URL path separators
CodSpeed Performance Gauge
+11%
16.5 µs14.9 µs
Deep path with 5 parameters
benchmark/urlcat.bench.ts::createUrl benchmarks::Complex cases
CodSpeed Performance Gauge
+10%
118.1 µs107 µs
REST API endpoint with pagination
benchmark/urlcat.bench.ts::createUrl benchmarks::Real-world patterns
CodSpeed Performance Gauge
+10%
85.7 µs77.7 µs

Passed

Complex URL with many params (original test)
benchmark/urlcat.bench.ts::createUrl benchmarks::Complex cases
CodSpeed Performance Gauge
+10%
182.3 µs166.2 µs
Join with separator at end of first part
benchmark/join.bench.ts::join benchmarks::Basic joins
CodSpeed Performance Gauge
+9%
16.9 µs15.5 µs
Array in query params
benchmark/urlcat.bench.ts::createUrl benchmarks::Edge cases
CodSpeed Performance Gauge
+8%
84.5 µs78.1 µs
Search endpoint with filters
benchmark/urlcat.bench.ts::createUrl benchmarks::Real-world patterns
CodSpeed Performance Gauge
+7%
95.7 µs89 µs
Both parts empty
benchmark/join.bench.ts::join benchmarks::Edge cases
CodSpeed Performance Gauge
+7%
12.9 µs12 µs
Two path params + two query params
benchmark/urlcat.bench.ts::createUrl benchmarks::Medium complexity
CodSpeed Performance Gauge
+7%
112.5 µs105 µs
Single query parameter
benchmark/urlcat.bench.ts::createUrl benchmarks::Simple cases
CodSpeed Performance Gauge
+7%
92.6 µs86.5 µs
Multiple query params (5 params)
benchmark/urlcat.bench.ts::createUrl benchmarks::Medium complexity
CodSpeed Performance Gauge
+7%
111.1 µs103.8 µs
Join empty first part with query
benchmark/join.bench.ts::join benchmarks::Query string separators
CodSpeed Performance Gauge
+7%
14.3 µs13.4 µs
Join with separator at start of second part
benchmark/join.bench.ts::join benchmarks::Basic joins
CodSpeed Performance Gauge
+7%
16.6 µs15.5 µs
Multiple separators in content
benchmark/join.bench.ts::join benchmarks::Edge cases
CodSpeed Performance Gauge
+6%
14.7 µs13.8 µs
Underscore parameter names
benchmark/subst.bench.ts::subst benchmarks::Parameter name patterns
CodSpeed Performance Gauge
+6%
67.6 µs63.7 µs
First part empty
benchmark/join.bench.ts::join benchmarks::Edge cases
CodSpeed Performance Gauge
+6%
14 µs13.2 µs
Join URL parts with slash
benchmark/join.bench.ts::join benchmarks::URL path separators
CodSpeed Performance Gauge
+6%
16.2 µs15.3 µs
Second part empty
benchmark/join.bench.ts::join benchmarks::Edge cases
CodSpeed Performance Gauge
+6%
14.2 µs13.5 µs
Large query string (15 params)
benchmark/urlcat.bench.ts::createUrl benchmarks::Complex cases
CodSpeed Performance Gauge
+6%
150.7 µs142.7 µs
String values
benchmark/subst.bench.ts::subst benchmarks::Different value types
CodSpeed Performance Gauge
+5%
69.8 µs66.3 µs
Complex multi-level template
benchmark/subst.bench.ts::subst benchmarks::Template complexity
CodSpeed Performance Gauge
+5%
76.7 µs73 µs
Join with leading ampersand
benchmark/join.bench.ts::join benchmarks::Query string separators
CodSpeed Performance Gauge
+4%
21 µs20.1 µs
Both parts have separator at boundary
benchmark/join.bench.ts::join benchmarks::Basic joins
CodSpeed Performance Gauge
+4%
17.2 µs16.5 µs
Parameter at end
benchmark/subst.bench.ts::subst benchmarks::Template patterns
CodSpeed Performance Gauge
+4%
64.6 µs62.2 µs
Unicode in values
benchmark/subst.bench.ts::subst benchmarks::Special characters
CodSpeed Performance Gauge
+4%
62.9 µs60.5 µs
Long strings with separator
benchmark/join.bench.ts::join benchmarks::Edge cases
CodSpeed Performance Gauge
+4%
14.7 µs14.2 µs
Boolean values
benchmark/subst.bench.ts::subst benchmarks::Different value types
CodSpeed Performance Gauge
+4%
62.8 µs60.6 µs
REST API resource path
benchmark/subst.bench.ts::subst benchmarks::Real-world patterns
CodSpeed Performance Gauge
+4%
62.8 µs60.6 µs
Parameter at beginning
benchmark/subst.bench.ts::subst benchmarks::Template patterns
CodSpeed Performance Gauge
+4%
63.3 µs61.1 µs
Medium complexity template
benchmark/subst.bench.ts::subst benchmarks::Template complexity
CodSpeed Performance Gauge
+4%
66.7 µs64.4 µs
Values with spaces
benchmark/subst.bench.ts::subst benchmarks::Special characters
CodSpeed Performance Gauge
+3%
63.1 µs61 µs
Simple single-segment template
benchmark/subst.bench.ts::subst benchmarks::Template complexity
CodSpeed Performance Gauge
+3%
61.2 µs59.2 µs
Long parameter values
benchmark/subst.bench.ts::subst benchmarks::Special characters
CodSpeed Performance Gauge
+3%
63.8 µs61.7 µs
Join URL parts both with slash
benchmark/join.bench.ts::join benchmarks::URL path separators
CodSpeed Performance Gauge
+3%
16.3 µs15.8 µs
Values with special chars
benchmark/subst.bench.ts::subst benchmarks::Special characters
CodSpeed Performance Gauge
+3%
67.1 µs64.9 µs
Parameters with static segments
benchmark/subst.bench.ts::subst benchmarks::Template patterns
CodSpeed Performance Gauge
+3%
67 µs64.9 µs
Nested resource path
benchmark/subst.bench.ts::subst benchmarks::Real-world patterns
CodSpeed Performance Gauge
+3%
66.7 µs64.6 µs
Deep nesting with IDs
benchmark/subst.bench.ts::subst benchmarks::Real-world patterns
CodSpeed Performance Gauge
+3%
68.3 µs66.2 µs
Join deep URL paths
benchmark/join.bench.ts::join benchmarks::URL path separators
CodSpeed Performance Gauge
+3%
16 µs15.6 µs
Versioned API endpoint
benchmark/subst.bench.ts::subst benchmarks::Real-world patterns
CodSpeed Performance Gauge
+3%
68.9 µs66.9 µs
CamelCase parameter names
benchmark/subst.bench.ts::subst benchmarks::Parameter name patterns
CodSpeed Performance Gauge
+3%
69.3 µs67.4 µs
Long parameter names
benchmark/subst.bench.ts::subst benchmarks::Parameter name patterns
CodSpeed Performance Gauge
+3%
68.5 µs66.6 µs
Two parameters
benchmark/subst.bench.ts::subst benchmarks::Parameter count scaling
CodSpeed Performance Gauge
+3%
70.2 µs68.3 µs
Consecutive parameters
benchmark/subst.bench.ts::subst benchmarks::Template patterns
CodSpeed Performance Gauge
+3%
68 µs66.2 µs
Short parameter names
benchmark/subst.bench.ts::subst benchmarks::Parameter name patterns
CodSpeed Performance Gauge
+3%
65.8 µs64.2 µs
Number values
benchmark/subst.bench.ts::subst benchmarks::Different value types
CodSpeed Performance Gauge
+3%
69.5 µs67.8 µs
Mixed value types
benchmark/subst.bench.ts::subst benchmarks::Different value types
CodSpeed Performance Gauge
+2%
74.5 µs72.7 µs
Date-based path
benchmark/subst.bench.ts::subst benchmarks::Real-world patterns
CodSpeed Performance Gauge
+2%
76.2 µs74.7 µs
Single parameter
benchmark/subst.bench.ts::subst benchmarks::Parameter count scaling
CodSpeed Performance Gauge
+2%
69.4 µs68.3 µs
Ampersand separator
benchmark/join.bench.ts::join benchmarks::Different separators
CodSpeed Performance Gauge
+1%
13.9 µs13.7 µs
Heavy encoding (many special chars)
benchmark/querystring.bench.ts::stringify benchmarks::Special characters and encoding
CodSpeed Performance Gauge
+1%
57.2 µs56.5 µs
Slash separator
benchmark/join.bench.ts::join benchmarks::Different separators
CodSpeed Performance Gauge
+1%
13.9 µs13.7 µs
Pipe separator
benchmark/join.bench.ts::join benchmarks::Different separators
CodSpeed Performance Gauge
+1%
13.8 µs13.7 µs
Comma separator
benchmark/join.bench.ts::join benchmarks::Different separators
CodSpeed Performance Gauge
+1%
13.8 µs13.7 µs
Analytics tracking params
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
+1%
79.4 µs78.9 µs
Join query parts with ampersand
benchmark/join.bench.ts::join benchmarks::Query string separators
CodSpeed Performance Gauge
+1%
15 µs14.9 µs
Empty object
benchmark/query.bench.ts::query benchmarks::Parameter count scaling
CodSpeed Performance Gauge
+1%
22.6 µs22.5 µs
Unicode characters
benchmark/querystring.bench.ts::stringify benchmarks::Special characters and encoding
CodSpeed Performance Gauge
0%
54 µs53.7 µs
Simple join without separators at boundaries
benchmark/join.bench.ts::join benchmarks::Basic joins
CodSpeed Performance Gauge
0%
25.1 µs25 µs
Join URL path with query string
benchmark/join.bench.ts::join benchmarks::Query string separators
CodSpeed Performance Gauge
0%
13.6 µs13.5 µs
Question mark separator
benchmark/join.bench.ts::join benchmarks::Different separators
CodSpeed Performance Gauge
0%
13.8 µs13.8 µs
Empty string values
benchmark/querystring.bench.ts::stringify benchmarks::Edge cases
CodSpeed Performance Gauge
0%
52.5 µs52.3 µs
String values only
benchmark/query.bench.ts::query benchmarks::Different value types
CodSpeed Performance Gauge
0%
60.7 µs60.5 µs
Single parameter
benchmark/query.bench.ts::query benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
58.8 µs58.6 µs
Number values only
benchmark/query.bench.ts::query benchmarks::Different value types
CodSpeed Performance Gauge
0%
57.6 µs57.4 µs
Multi-select filter params
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
0%
59.3 µs59.1 µs
Boolean values only
benchmark/query.bench.ts::query benchmarks::Different value types
CodSpeed Performance Gauge
0%
61.4 µs61.2 µs
API query with includes
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
0%
57 µs56.8 µs
E-commerce cart params
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
0%
62.9 µs62.7 µs
Two parameters
benchmark/query.bench.ts::query benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
55.9 µs55.8 µs
Search with filters
benchmark/query.bench.ts::query benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
69.4 µs69.2 µs
BigInt values
benchmark/query.bench.ts::query benchmarks::Different value types
CodSpeed Performance Gauge
0%
69 µs68.8 µs
Long template with many segments
benchmark/subst.bench.ts::subst benchmarks::Template patterns
CodSpeed Performance Gauge
0%
73.4 µs73.2 µs
Small object (2 params)
benchmark/querystring.bench.ts::stringify benchmarks::Comparison scenarios
CodSpeed Performance Gauge
0%
24 µs23.9 µs
Keys with special characters
benchmark/query.bench.ts::query benchmarks::Special characters
CodSpeed Performance Gauge
0%
51.9 µs51.8 µs
Mixed types
benchmark/query.bench.ts::query benchmarks::Different value types
CodSpeed Performance Gauge
0%
71.7 µs71.6 µs
Mixed encoding complexity
benchmark/querystring.bench.ts::stringify benchmarks::Special characters and encoding
CodSpeed Performance Gauge
0%
56.3 µs56.2 µs
Short values (5 chars)
benchmark/query.bench.ts::query benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
50 µs49.9 µs
Values with spaces
benchmark/query.bench.ts::query benchmarks::Special characters
CodSpeed Performance Gauge
0%
53 µs52.9 µs
Five parameters
benchmark/query.bench.ts::query benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
68.2 µs68.1 µs
Five parameters
benchmark/subst.bench.ts::subst benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
76.2 µs76.1 µs
Long values (50 chars)
benchmark/query.bench.ts::query benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
58.4 µs58.3 µs
Pagination params
benchmark/query.bench.ts::query benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
55.6 µs55.5 µs
Null and undefined values
benchmark/querystring.bench.ts::stringify benchmarks::Edge cases
CodSpeed Performance Gauge
0%
59.6 µs59.5 µs
Fifty parameters
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
195.5 µs195.2 µs
Array values
benchmark/query.bench.ts::query benchmarks::Different value types
CodSpeed Performance Gauge
0%
66.6 µs66.5 µs
Values with special characters
benchmark/query.bench.ts::query benchmarks::Special characters
CodSpeed Performance Gauge
0%
53 µs52.9 µs
Large object (16 params with arrays)
benchmark/querystring.bench.ts::stringify benchmarks::Comparison scenarios
CodSpeed Performance Gauge
0%
42.1 µs42.1 µs
Form submission data
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
0%
68.8 µs68.7 µs
Twenty parameters
benchmark/query.bench.ts::query benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
98.8 µs98.7 µs
Various language scripts
benchmark/querystring.bench.ts::encodeString benchmarks::Unicode and multi-byte characters
CodSpeed Performance Gauge
0%
36.2 µs36.2 µs
Ten parameters
benchmark/query.bench.ts::query benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
70.8 µs70.7 µs
Pagination params
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
0%
54.5 µs54.5 µs
Array of mixed types
benchmark/querystring.bench.ts::stringify benchmarks::Array values
CodSpeed Performance Gauge
0%
50.7 µs50.7 µs
Unicode characters
benchmark/query.bench.ts::query benchmarks::Special characters
CodSpeed Performance Gauge
0%
62.9 µs62.9 µs
BigInt values only
benchmark/querystring.bench.ts::stringify benchmarks::Value types
CodSpeed Performance Gauge
0%
71.8 µs71.7 µs
API query with includes
benchmark/query.bench.ts::query benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
63.1 µs63 µs
Original complex test
benchmark/query.bench.ts::query benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
85.7 µs85.7 µs
Mixed primitive types
benchmark/querystring.bench.ts::stringify benchmarks::Value types
CodSpeed Performance Gauge
0%
77.3 µs77.3 µs
Heavy special characters (75% encoding)
benchmark/querystring.bench.ts::encodeString benchmarks::Character type variations
CodSpeed Performance Gauge
0%
33.6 µs33.6 µs
Mixed ASCII and Unicode
benchmark/querystring.bench.ts::encodeString benchmarks::Unicode and multi-byte characters
CodSpeed Performance Gauge
0%
25.8 µs25.8 µs
File path with spaces
benchmark/querystring.bench.ts::encodeString benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
15.2 µs15.2 µs
Light encoding (spaces only)
benchmark/querystring.bench.ts::stringify benchmarks::Special characters and encoding
CodSpeed Performance Gauge
0%
50.9 µs50.9 µs
Long values (50 chars each)
benchmark/querystring.bench.ts::stringify benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
56.5 µs56.5 µs
String values only
benchmark/querystring.bench.ts::stringify benchmarks::Value types
CodSpeed Performance Gauge
0%
52.4 µs52.4 µs
Email address
benchmark/querystring.bench.ts::encodeString benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
19.9 µs19.9 µs
Medium values (20 chars)
benchmark/query.bench.ts::query benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
53.1 µs53.1 µs
Twenty parameters
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
100.1 µs100.1 µs
Ten parameters
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
70.6 µs70.6 µs
Single parameter
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
55.5 µs55.5 µs
Very long values (200 chars each)
benchmark/querystring.bench.ts::stringify benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
80.6 µs80.6 µs
Medium array (10 items)
benchmark/querystring.bench.ts::stringify benchmarks::Array values
CodSpeed Performance Gauge
0%
79.5 µs79.5 µs
Boolean values only
benchmark/querystring.bench.ts::stringify benchmarks::Value types
CodSpeed Performance Gauge
0%
52.2 µs52.2 µs
2-byte UTF-8 characters
benchmark/querystring.bench.ts::encodeString benchmarks::Unicode and multi-byte characters
CodSpeed Performance Gauge
0%
77.3 µs77.3 µs
Number values only
benchmark/querystring.bench.ts::stringify benchmarks::Value types
CodSpeed Performance Gauge
0%
57.9 µs58 µs
Special numeric values
benchmark/querystring.bench.ts::stringify benchmarks::Edge cases
CodSpeed Performance Gauge
0%
94.7 µs94.8 µs
Large array (50 items)
benchmark/querystring.bench.ts::stringify benchmarks::Array values
CodSpeed Performance Gauge
0%
1.9 ms1.9 ms
Five parameters
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
55.4 µs55.4 µs
URL path
benchmark/querystring.bench.ts::encodeString benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
24.8 µs24.9 µs
Small array (3 items)
benchmark/querystring.bench.ts::stringify benchmarks::Array values
CodSpeed Performance Gauge
0%
46.6 µs46.7 µs
Medium ASCII string (50 chars)
benchmark/querystring.bench.ts::encodeString benchmarks::String length scaling
CodSpeed Performance Gauge
0%
44.2 µs44.2 µs
Medium object (10 params)
benchmark/querystring.bench.ts::stringify benchmarks::Comparison scenarios
CodSpeed Performance Gauge
0%
30.7 µs30.7 µs
Multiple arrays
benchmark/querystring.bench.ts::stringify benchmarks::Array values
CodSpeed Performance Gauge
0%
54.5 µs54.6 µs
SQL-like query
benchmark/querystring.bench.ts::encodeString benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
15.9 µs15.9 µs
Two parameters
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
51 µs51.1 µs
Medium values (20 chars each)
benchmark/querystring.bench.ts::stringify benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
59.1 µs59.2 µs
Empty object
benchmark/querystring.bench.ts::stringify benchmarks::Parameter count scaling
CodSpeed Performance Gauge
0%
16.8 µs16.8 µs
Search query with special chars
benchmark/querystring.bench.ts::encodeString benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
14.8 µs14.9 µs
Empty arrays
benchmark/querystring.bench.ts::stringify benchmarks::Edge cases
CodSpeed Performance Gauge
0%
46.3 µs46.4 µs
Short values (5 chars each)
benchmark/querystring.bench.ts::stringify benchmarks::Value length scaling
CodSpeed Performance Gauge
0%
51.9 µs52 µs
Very long ASCII string (1000 chars)
benchmark/querystring.bench.ts::encodeString benchmarks::String length scaling
CodSpeed Performance Gauge
0%
49.5 µs49.6 µs
JSON-like string
benchmark/querystring.bench.ts::encodeString benchmarks::Real-world patterns
CodSpeed Performance Gauge
0%
24 µs24.1 µs
Very deep template (8 levels)
benchmark/subst.bench.ts::subst benchmarks::Template complexity
CodSpeed Performance Gauge
0%
83.1 µs83.3 µs
No encoding needed (pure alphanumeric)
benchmark/querystring.bench.ts::stringify benchmarks::Special characters and encoding
CodSpeed Performance Gauge
0%
48.1 µs48.3 µs
Long ASCII string (200 chars)
benchmark/querystring.bench.ts::encodeString benchmarks::String length scaling
CodSpeed Performance Gauge
0%
22.5 µs22.5 µs
4-byte UTF-8 characters (emojis)
benchmark/querystring.bench.ts::encodeString benchmarks::Unicode and multi-byte characters
CodSpeed Performance Gauge
0%
22.1 µs22.2 µs
Mixed safe and unsafe (50% encoding)
benchmark/querystring.bench.ts::encodeString benchmarks::Character type variations
CodSpeed Performance Gauge
0%
15.8 µs15.8 µs
3-byte UTF-8 characters (CJK)
benchmark/querystring.bench.ts::encodeString benchmarks::Unicode and multi-byte characters
CodSpeed Performance Gauge
0%
23.6 µs23.7 µs
Empty string
benchmark/querystring.bench.ts::encodeString benchmarks::String length scaling
CodSpeed Performance Gauge
0%
22.6 µs22.7 µs
Search with filters
benchmark/querystring.bench.ts::stringify benchmarks::Real-world use cases
CodSpeed Performance Gauge
0%
62.9 µs63.1 µs
All spaces (maximum encoding)
benchmark/querystring.bench.ts::encodeString benchmarks::Character type variations
CodSpeed Performance Gauge
0%
13.8 µs13.9 µs
Safe special characters (no encoding needed)
benchmark/querystring.bench.ts::encodeString benchmarks::Character type variations
CodSpeed Performance Gauge
0%
13.6 µs13.6 µs
Short ASCII string (10 chars)
benchmark/querystring.bench.ts::encodeString benchmarks::String length scaling
CodSpeed Performance Gauge
0%
18 µs18.1 µs
Pure alphanumeric (no encoding needed)
benchmark/querystring.bench.ts::encodeString benchmarks::Character type variations
CodSpeed Performance Gauge
-1%
13.9 µs14 µs
Ten parameters
benchmark/subst.bench.ts::subst benchmarks::Parameter count scaling
CodSpeed Performance Gauge
-2%
94.8 µs96.8 µs
Medium encoding (common special chars)
benchmark/querystring.bench.ts::stringify benchmarks::Special characters and encoding
CodSpeed Performance Gauge
-2%
51.3 µs52.4 µs

Commits

Click on a commit to change the comparison range
Base
main
6a497ac
-56.31%
Apply code formatting with biome Co-authored-by: hckhanh <6380436+hckhanh@users.noreply.github.com>
4a8a541
5 hours ago
by Copilot
-0.39%
Optimize join function for base URL with trailing slash case Reduce string operations when both parts have separator at boundary. Instead of slicing part1, removing separator, and re-adding it, simply concatenate part1 with part2 (minus separator). Performance improvement: ~19% faster for URL joining with trailing slash Co-authored-by: hckhanh <6380436+hckhanh@users.noreply.github.com>
abd77fe
3 hours ago
by Copilot
© 2025 CodSpeed Technology
Home Terms Privacy Docs