11#![ allow( missing_docs) ]
22
33mod bench_complex_replace_source;
4+ mod bench_source_map;
45
56use std:: collections:: HashMap ;
67
@@ -16,6 +17,10 @@ use rspack_sources::{
1617} ;
1718
1819use bench_complex_replace_source:: benchmark_complex_replace_source;
20+ use bench_source_map:: {
21+ benchmark_parse_source_map_from_json, benchmark_source_map_clone,
22+ benchmark_stringify_source_map_to_json,
23+ } ;
1924
2025const HELLOWORLD_JS : & str = include_str ! ( concat!(
2126 env!( "CARGO_MANIFEST_DIR" ) ,
@@ -41,14 +46,6 @@ const BUNDLE_JS_MAP: &str = include_str!(concat!(
4146 env!( "CARGO_MANIFEST_DIR" ) ,
4247 "/benches/fixtures/transpile-rollup/files/bundle.js.map"
4348) ) ;
44- const ANTD_MIN_JS : & str = include_str ! ( concat!(
45- env!( "CARGO_MANIFEST_DIR" ) ,
46- "/benches/fixtures/antd-mini/antd.min.js"
47- ) ) ;
48- const ANTD_MIN_JS_MAP : & str = include_str ! ( concat!(
49- env!( "CARGO_MANIFEST_DIR" ) ,
50- "/benches/fixtures/antd-mini/antd.min.js.map"
51- ) ) ;
5249
5350fn benchmark_concat_generate_string ( b : & mut Bencher ) {
5451 let sms_minify = SourceMapSource :: new ( SourceMapSourceOptions {
@@ -251,6 +248,18 @@ fn bench_rspack_sources(criterion: &mut Criterion) {
251248 group
252249 . bench_function ( "complex_replace_source" , benchmark_complex_replace_source) ;
253250
251+ group. bench_function (
252+ "parse_source_map_from_json" ,
253+ benchmark_parse_source_map_from_json,
254+ ) ;
255+
256+ group. bench_function ( "source_map_clone" , benchmark_source_map_clone) ;
257+
258+ group. bench_function (
259+ "stringify_source_map_to_json" ,
260+ benchmark_stringify_source_map_to_json,
261+ ) ;
262+
254263 group. finish ( ) ;
255264}
256265
0 commit comments