-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Document all the performance #16301
Copy link
Copy link
Closed
Labels
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is, I guess, a metabug.
As I discuss in #16267, I believe that libcollections should provide both high-level asymptotic performance as well as practical performance guidelines (e.g.
Vec.pushis faster thanRingBuf.pushandDList.pushfor most workloads) for all relevant functions and methods.The biggest open question in my mind is whether performance should be indistinguishable from regular documentation, or take on a special form that Rustdoc can manipulate. For instance, perf docs could be prefixed by
//?or placed in an annotation like[#perf-time(O(1) amor.)]. The former would need further special syntax to differentiate time/space information, the latter would need some augmentation to permit extended discussion.Regardless of the form it takes, making this available to Rustdoc would allow some cool stuff like Traits including a performance table for their implementers. See Qt's Algorithmic Complexity section for an example of what these tables might look like.
I would also suggest we adopt the following notation conventions, or something similar: