Reduce the number of dependencies
jonhoo opened this issue · comments
$ cargo tree --no-indent | sed 's/ (\*)//' | sort -u | wc -l
126
My guess is that some of these are unnecessary. Let's see if we can't do something to help improve build times.
Hey @jonhoo I tried building the project locally without each one of the non dev deps but the project would only build with all of them. What is the path you were thinking for this?
When I try to cargo build
the project locally I get:
--> src/collapse/perf.rs:4:5
|
4 | use symbolic_demangle::demangle;
| ^^^^^^^^^^^^^^^^^ use of undeclared type or module `symbolic_demangle`
error[E0433]: failed to resolve: use of undeclared type or module `symbolic_demangle`
--> src/collapse/dtrace.rs:332:45
|
332 | self.transform_function_name(frame, symbolic_demangle::demangle)
| ^^^^^^^^^^^^^^^^^ use of undeclared type or module `symbolic_demangle`
error: aborting due to 2 previous errors
Ah, sorry, to be clear, it's not as though we currently list unused dependencies, but rather I would like to see us re-write parts of the code so that we can remove dependencies. I'm not sure what the issue you are pointing to with symbolic_demangle
is -- it compiles fine for me locally?
I think we should be able to remove symbolic_demangle
as a dependency.
#133 and #134 added to our collapsers the ability to fix partially demangled Rust symbols with no external dependencies. I originally implemented #132 to work around the same problem, but it required you to pass --no-demangle
to perf script, or -xmangled
to dtrace since symbolic_demangle
doesn't work when the symbols are partially demangled. Now that we are able to take the mostly demangled symbols the profiling tools give us and fix them up from there, the demangle
option on the collapsers seems to be unnecessary.
What do you think?
Now we're down to 109 dependencies after #144.
$ cargo tree --no-indent | sed 's/ (\*)//' | sort -u | wc -l
109