Avatar for the webpack user
webpack
webpack-sources
BlogDocsChangelog

feat: add Source.prototype.clearCache() to release per-instance caches

#221Merged
Comparing
claude/fix-webpack-issue-0KinR
(
6b66049
) with
main
(
68d9c8e
)
CodSpeed Performance Gauge
+15%
Improvement
1
Untouched
172
New
38

Benchmarks

211 total
cached-source: new CachedSource()
benchmark/cases/cached-source/index.bench.mjs
CodSpeed Performance Gauge
+15%
379.1 µs328.8 µs
source-map-source memory: new SourceMapSource(with inner map)
benchmark/memory/source-map-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1 KB
compat-source memory: new CompatSource(sourceLike)
benchmark/memory/compat-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1 KB
raw-source memory: new RawSource(string)
benchmark/memory/raw-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1 KB
original-source memory: new OriginalSource()
benchmark/memory/original-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1.2 KB
original-source memory: sourceAndMap({ columns: true })
benchmark/memory/original-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1.7 MB
concat-source memory: new ConcatSource(...children)
benchmark/memory/concat-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A3.7 KB
clear-cache memory: unique tasks (clearCache default)
benchmark/memory/clear-cache/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A4.2 MB
prefix-source memory: source() allocates rewritten string
benchmark/memory/prefix-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1.2 KB
original-source memory: map({ columns: true }) builds full mappings
benchmark/memory/original-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A886.5 KB
replace-source memory: construct + 100 insertions
benchmark/memory/replace-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A11 KB
cached-source memory: getCachedData() allocates BufferedMap
benchmark/memory/cached-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A504 B
replace-source memory: map({ columns: true }) splices mappings
benchmark/memory/replace-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A3.2 MB
webpack-20961: warm CHUNKS × MODULES, hold all live (baseline)
benchmark/memory/webpack-20961/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A2.4 MB
clear-cache memory: shared modules (visited set — single allocation)
benchmark/memory/clear-cache/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A648 B
clear-cache memory: shared modules (no visited set — allocates per chunk)
benchmark/memory/clear-cache/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1 MB
concat-source memory: source() concatenates children
benchmark/memory/concat-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A389.4 KB
raw-source memory: updateHash() populates _cachedHashUpdate
benchmark/memory/raw-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1.4 MB
original-source memory: map({ columns: false }) line-only mappings
benchmark/memory/original-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A283.2 KB
source-map-source memory: new SourceMapSource(simple)
benchmark/memory/source-map-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1 KB
source-map-source memory: sourceAndMap({ columns: true }) (combined inner)
benchmark/memory/source-map-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1.7 MB
raw-source memory: string-backed + buffer() materializes Buffer
benchmark/memory/raw-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A1.4 MB
cached-source memory: construct from cachedData (no warm-up)
benchmark/memory/cached-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A248 B
concat-source memory: map({ columns: true }) composes child maps
benchmark/memory/concat-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A2.7 MB
compat-source memory: CompatSource.from() short-circuits on Source
benchmark/memory/compat-source/index.bench.mjs
CodSpeed Performance Gauge
N/A
N/A392 B

Commits

Click on a commit to change the comparison range
Base
main
68d9c8e
-24.19%
feat: add Source.prototype.clearCache() to release per-instance caches
c2399b1
20 days ago
by claude
+24.01%
test: cover every SourceMapSource.clearCache() branch
9b0e1e2
20 days ago
by claude
-0.03%
feat: deduplicate clearCache recursion and add granular options
0cf202c
20 days ago
by claude
-0.01%
feat: add parsedMap option, post-minifier benchmark, getCachedData test
adbb4f8
20 days ago
by claude
+0.05%
ci: track memory benchmarks via CodSpeed memory mode
10f09d7
16 days ago
by claude
-0.09%
refactor(clearCache): collapse options to mapsOnly, always recurse
833745a
15 days ago
by claude
+0.02%
bench: add memory benchmarks for every Source subclass
3ff550a
15 days ago
by claude
-24%
feat(clearCache): restore maps/source/parsedMap options for webpack #20963
41a3fdb
14 days ago
by claude
-0.06%
bench: add webpack-20961 case modeling the PR #20963 scenario
37dc100
14 days ago
by claude
+38.89%
fix(CachedSource): honor CachedData.buffer contract after clearCache
e4c6fd5
13 days ago
by claude
-0.09%
fix(tests, bench): address second Copilot review on webpack-sources#221
cb7829b
13 days ago
by claude
+0.78%
fix(workflow): restore memory benchmark permissions
6b66049
13 days ago
by Copilot
© 2026 CodSpeed Technology
Home Terms Privacy Docs