Benchmarks for cargo-public-api and related crates.
Currently experimental.
Here is a list of things that probably would significantly improve the performance of the public-api
crate:
- Make
UnprocessedItem::parent_path
containVec<Rc<PathComponent>>
instead ofVec<PathComponent>
. That should give a noticeble performance boost sincePathComponent
is cloned a lot, and wrapping it inside of anRc
should significantly reduce the number of heap allocations. - Use multiple threads to process
ItemProcessor::work_queue
(and useArc
instead ofRc
above) - Instead of rendering
impl
s to group them in the output (which according to my profiling takes a long time), use something like aDisambiguatedDefPathData
with adisambiguator: u32
.