Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use external crate for displaying tracing spans (#4781)
When debugging #4771, I had to copy-paste tracing_timings module to get a useful profiling output, which isn't ideal. So I improved and published that code to crates.io as `tracing-span-tree`. In particular, this new implementation prints the trace in the correct order, and it also has an `.aggregate(true)` mode for cases where you run the profiled code in a loop and want a summary. Example without aggregation: ``` 328.25ms vm_script_smoke_test 306.34ms run_vm 306.32ms run_wasmer 37.16µs get_key 301.50ms compile_and_serialize_wasmer 4.44ms run_method 2.53ms run_method/instantiate 128.17µs run_method/call 1.74ms run_method/drop_instance 4.50ms run_vm 4.49ms run_wasmer 31.81µs get_key 4.25ms run_method 2.45ms run_method/instantiate 45.46µs run_method/call 1.72ms run_method/drop_instance 4.43ms run_vm 4.42ms run_wasmer 22.43µs get_key 4.21ms run_method 2.41ms run_method/instantiate 42.84µs run_method/call 1.72ms run_method/drop_instance 4.81ms run_vm 4.80ms run_wasmer 22.09µs get_key 4.58ms run_method 2.40ms run_method/instantiate 419.57µs run_method/call 1.73ms run_method/drop_instance ``` Example with aggregation (unit-less number is the number of aggregated calls): ``` 333.98ms vm_script_smoke_test 325.54ms 4 run_vm 325.48ms 4 run_wasmer 307.07ms compile_and_serialize_wasmer 129.19µs 4 get_key 17.32ms 4 run_method 612.46µs 4 run_method/call 6.63ms 4 run_method/drop_instance 9.94ms 4 run_method/instantiate ``` Test Plan --------- This is a debugging utility which is not enabled in production, so I just manually verified that the output makes sense.
- Loading branch information