Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add bench case for cached source #147

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: test case
  • Loading branch information
SyMind committed Dec 16, 2024
commit c7e2ab157df81850729ad1e7e6d666a47af06594
4 changes: 3 additions & 1 deletion benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ fn benchmark_source_for_replace_large_minified_source_with_cache(b: &mut Bencher
replace_source.replace(430, 437, "__webpack_require__", None);
replace_source.replace(438, 445, "/*! dayjs */\"./node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/dayjs.min.js\"", None);
replace_source.replace(494, 498, "this", None);
let replace_source = replace_source.boxed();

let cached = CachedSource::new(replace_source.boxed());
let concat_source = ConcatSource::new(vec![replace_source.clone(), replace_source]);
let cached = CachedSource::new(concat_source);

b.iter(|| {
cached.source();
Expand Down
Loading