Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a section on performance to collection docs #21217

Merged
merged 1 commit into from
Jan 23, 2015
Merged

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Jan 16, 2015

Not sure on what exactly should be said here, but I think this is the most important bit. This PR also establishes conventions for describing performance minimally.

I suggest to describe preformance for individual methods we use a # Performance heading. Not sure if we should have

# Performance: O(1)
details details

or

# Performance:
O(1)
details details

Since I think most methods don't need discussion, the former seems more resonable. But it's kind of weird to have info "in" the heading.

r? @steveklabnik

Verified

This commit was signed with the committer’s verified signature.
@Gankra
Copy link
Contributor Author

Gankra commented Jan 16, 2015

I guess another open question is if O(1)* notation can be used freely throughout the docs, or if amortized or amort. should be used elsewhere.

@Gankra
Copy link
Contributor Author

Gankra commented Jan 16, 2015

Also there's I guess a choice of *O(1) vs O*(1) vs O(1)*

//! important operations. For further details, see each type's documentation.
//!
//! Throughout the documentation, we will follow a few conventions. For all operations,
//! the collection's size is denoted by n. If another collection is involved in the operation, it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably have graves around the 'n'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasn't sure about this. Ideally I would use mathmode, but we don't support it. Making all the math codemode is a bit weird looking.

  • O(min(i, n-i))
  • O(min(i, n-i))
  • O(min(i, n-i))
  • O(min(i, n-i))

@steveklabnik
Copy link
Member

I like it.

@steveklabnik
Copy link
Member

@bors: r+ 3819c22 rollup

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jan 22, 2015

Verified

This commit was signed with the committer’s verified signature.
Not sure on what *exactly* should be said here, but I think this is the most important bit. This PR also establishes conventions for describing performance minimally.

I suggest to describe preformance for individual methods we use a `# Performance` heading. Not sure if we should have 

```
# Performance: O(1)
details details
```
or

```
# Performance:
O(1)
details details
```

Since I think most methods don't need discussion, the former seems more resonable. But it's kind of weird to have info "in" the heading.

r? @steveklabnik
bors added a commit that referenced this pull request Jan 23, 2015

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
- Successful merges: #21056, #21091, #21217, #21325, #21373, #21450, #21471, #21472, #21477, #21479, #21484, #21496, #21500, #21516, #21517
- Failed merges:
@bors bors merged commit 3819c22 into rust-lang:master Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants