File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,15 @@ pub fn run(function_path: PathBuf, input_path: PathBuf) -> Result<FunctionRunRes
4444
4545 linker. module ( & mut store, "Function" , & module) ?;
4646
47+ let instance = linker. instantiate ( & mut store, & module) ?;
48+
4749 let start = Instant :: now ( ) ;
4850
49- let instance = linker. instantiate ( & mut store, & module) ?;
51+ let module_result = instance
52+ . get_typed_func :: < ( ) , ( ) , _ > ( & mut store, "_start" ) ?
53+ . call ( & mut store, ( ) ) ;
54+
55+ runtime = start. elapsed ( ) ;
5056
5157 // This is a hack to get the memory usage. Wasmtime requires a mutable borrow to a store for caching.
5258 // We need this mutable borrow to fall out of scope so that we can mesure memory usage.
@@ -67,12 +73,6 @@ pub fn run(function_path: PathBuf, input_path: PathBuf) -> Result<FunctionRunRes
6773 . sum :: < u64 > ( )
6874 * KB_PER_PAGE ;
6975
70- let module_result = instance
71- . get_typed_func :: < ( ) , ( ) , _ > ( & mut store, "_start" ) ?
72- . call ( & mut store, ( ) ) ;
73-
74- runtime = start. elapsed ( ) ;
75-
7676 match module_result {
7777 Ok ( _) => { }
7878 Err ( e) => {
You can’t perform that action at this time.
0 commit comments