@@ -182,8 +182,9 @@ fn bench_instance(c: &mut Criterion) {
182
182
fn bench_cache ( c : & mut Criterion ) {
183
183
let mut group = c. benchmark_group ( "Cache" ) ;
184
184
185
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
185
186
let options = CacheOptions :: new (
186
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
187
+ temp_dir . path ( ) ,
187
188
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
188
189
MEMORY_CACHE_SIZE ,
189
190
DEFAULT_MEMORY_LIMIT ,
@@ -237,9 +238,10 @@ fn bench_cache(c: &mut Criterion) {
237
238
} ) ;
238
239
}
239
240
241
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
240
242
group. bench_function ( "instantiate from fs" , |b| {
241
243
let non_memcache = CacheOptions :: new (
242
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
244
+ temp_dir . path ( ) ,
243
245
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
244
246
Size :: new ( 0 ) ,
245
247
DEFAULT_MEMORY_LIMIT ,
@@ -259,9 +261,10 @@ fn bench_cache(c: &mut Criterion) {
259
261
} ) ;
260
262
} ) ;
261
263
264
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
262
265
group. bench_function ( "instantiate from fs unchecked" , |b| {
263
266
let non_memcache = CacheOptions :: new (
264
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
267
+ temp_dir . path ( ) ,
265
268
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
266
269
Size :: new ( 0 ) ,
267
270
DEFAULT_MEMORY_LIMIT ,
@@ -326,9 +329,10 @@ fn bench_cache(c: &mut Criterion) {
326
329
}
327
330
328
331
fn bench_instance_threads ( c : & mut Criterion ) {
332
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
329
333
c. bench_function ( "multi-threaded get_instance" , |b| {
330
334
let options = CacheOptions :: new (
331
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
335
+ temp_dir . path ( ) ,
332
336
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
333
337
MEMORY_CACHE_SIZE ,
334
338
DEFAULT_MEMORY_LIMIT ,
@@ -413,8 +417,9 @@ fn bench_instance_threads(c: &mut Criterion) {
413
417
fn bench_combined ( c : & mut Criterion ) {
414
418
let mut group = c. benchmark_group ( "Combined" ) ;
415
419
420
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
416
421
let options = CacheOptions :: new (
417
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
422
+ temp_dir . path ( ) ,
418
423
capabilities_from_csv ( "cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,iterator,staking" ) ,
419
424
MEMORY_CACHE_SIZE ,
420
425
DEFAULT_MEMORY_LIMIT ,
0 commit comments