@@ -20,7 +20,7 @@ use uv_client::{BaseClientBuilder, Connectivity, RegistryClientBuilder};
2020use uv_distribution_filename:: { SourceDistExtension , WheelFilename } ;
2121use uv_distribution_types:: Requirement ;
2222use uv_install_wheel:: { InstallState , Layout , LinkMode } ;
23- use uv_preview:: Preview ;
23+ use uv_preview:: { Preview , PreviewFeature } ;
2424use uv_pypi_types:: Scheme ;
2525use uv_python:: PythonEnvironment ;
2626use uv_resolver:: Manifest ;
@@ -108,32 +108,41 @@ fn unpack_sdist_many_files(c: &mut Criterion<WallTime>) {
108108 . build ( )
109109 . expect ( "Failed to create Tokio runtime" ) ;
110110
111- c. bench_function ( "unpack_sdist_many_files" , |b| {
112- b. iter_batched (
113- || {
114- (
115- runtime
116- . block_on ( fs_err:: tokio:: File :: open ( archive. path ( ) ) )
117- . expect ( "Failed to open temporary archive" ) ,
118- create_sdist_extraction_directory ( ) ,
119- )
120- } ,
121- |( archive, extracted_sdist) | {
122- let files = runtime
123- . block_on ( uv_extract:: stream:: archive (
124- MANY_FILES_SDIST_FILENAME ,
125- archive,
126- SourceDistExtension :: TarGz ,
127- extracted_sdist. path ( ) ,
128- ) )
129- . expect ( "Failed to unpack sdist" ) ;
130- let source_tree = uv_extract:: strip_component ( extracted_sdist. path ( ) )
131- . expect ( "Failed to strip top-level sdist directory" ) ;
132- black_box ( ( files, extracted_sdist, source_tree) )
133- } ,
134- BatchSize :: PerIteration ,
135- ) ;
136- } ) ;
111+ for ( name, preview_features) in [
112+ ( "unpack_sdist_many_files/astral_tokio_tar" , & [ ] [ ..] ) ,
113+ (
114+ "unpack_sdist_many_files/tar_codec" ,
115+ & [ PreviewFeature :: TarCodec ] [ ..] ,
116+ ) ,
117+ ] {
118+ let _preview = uv_preview:: test:: with_features ( preview_features) ;
119+ c. bench_function ( name, |b| {
120+ b. iter_batched (
121+ || {
122+ (
123+ runtime
124+ . block_on ( fs_err:: tokio:: File :: open ( archive. path ( ) ) )
125+ . expect ( "Failed to open temporary archive" ) ,
126+ create_sdist_extraction_directory ( ) ,
127+ )
128+ } ,
129+ |( archive, extracted_sdist) | {
130+ let files = runtime
131+ . block_on ( uv_extract:: stream:: archive (
132+ MANY_FILES_SDIST_FILENAME ,
133+ archive,
134+ SourceDistExtension :: TarGz ,
135+ extracted_sdist. path ( ) ,
136+ ) )
137+ . expect ( "Failed to unpack sdist" ) ;
138+ let source_tree = uv_extract:: strip_component ( extracted_sdist. path ( ) )
139+ . expect ( "Failed to strip top-level sdist directory" ) ;
140+ black_box ( ( files, extracted_sdist, source_tree) )
141+ } ,
142+ BatchSize :: PerIteration ,
143+ ) ;
144+ } ) ;
145+ }
137146}
138147
139148fn unzip_wheel_many_files ( c : & mut Criterion < WallTime > ) {
0 commit comments