@@ -139,8 +139,9 @@ fn bench_instance(c: &mut Criterion) {
139
139
fn bench_cache ( c : & mut Criterion ) {
140
140
let mut group = c. benchmark_group ( "Cache" ) ;
141
141
142
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
142
143
let options = CacheOptions :: new (
143
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
144
+ temp_dir . path ( ) . to_path_buf ( ) ,
144
145
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
145
146
MEMORY_CACHE_SIZE ,
146
147
DEFAULT_MEMORY_LIMIT ,
@@ -194,9 +195,10 @@ fn bench_cache(c: &mut Criterion) {
194
195
} ) ;
195
196
}
196
197
198
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
197
199
group. bench_function ( "instantiate from fs" , |b| {
198
200
let non_memcache = CacheOptions :: new (
199
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
201
+ temp_dir . path ( ) . to_path_buf ( ) ,
200
202
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
201
203
Size :: new ( 0 ) ,
202
204
DEFAULT_MEMORY_LIMIT ,
@@ -216,9 +218,10 @@ fn bench_cache(c: &mut Criterion) {
216
218
} ) ;
217
219
} ) ;
218
220
221
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
219
222
group. bench_function ( "instantiate from fs unchecked" , |b| {
220
223
let non_memcache = CacheOptions :: new (
221
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
224
+ temp_dir . path ( ) . to_path_buf ( ) ,
222
225
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
223
226
Size :: new ( 0 ) ,
224
227
DEFAULT_MEMORY_LIMIT ,
@@ -283,9 +286,10 @@ fn bench_cache(c: &mut Criterion) {
283
286
}
284
287
285
288
fn bench_instance_threads ( c : & mut Criterion ) {
289
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
286
290
c. bench_function ( "multi-threaded get_instance" , |b| {
287
291
let options = CacheOptions :: new (
288
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
292
+ temp_dir . path ( ) . to_path_buf ( ) ,
289
293
capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
290
294
MEMORY_CACHE_SIZE ,
291
295
DEFAULT_MEMORY_LIMIT ,
@@ -370,8 +374,9 @@ fn bench_instance_threads(c: &mut Criterion) {
370
374
fn bench_combined ( c : & mut Criterion ) {
371
375
let mut group = c. benchmark_group ( "Combined" ) ;
372
376
377
+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
373
378
let options = CacheOptions :: new (
374
- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
379
+ temp_dir . path ( ) . to_path_buf ( ) ,
375
380
capabilities_from_csv ( "cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,iterator,staking" ) ,
376
381
MEMORY_CACHE_SIZE ,
377
382
DEFAULT_MEMORY_LIMIT ,
0 commit comments