Repository navigation
tsort: refactor parser and make its allocations safe - #14788
anastygnome wants to merge 2 commits into
Conversation
26c9ff4 to
7cce22e
Compare
Merging this PR will degrade performance by 4.76%2 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
d46ebb9 to
7626a29
Compare
| Read(#[from] ReadError), | ||
|
|
||
| /// The input requires more memory than is available. | ||
| #[error("{}", translate!("common-memory-exhausted"))] |
There was a problem hiding this comment.
consider using a different error message: common-out-of-memory
but then we should refactor shuf-error-memory-exhausted as a follow-up.
There was a problem hiding this comment.
done, I may get around to cleaning up the locale someday, due to the astronomical commits from AI, people just duplicated error messages everywhere
There was a problem hiding this comment.
Indeed, I'm currently attempting to reduce the duplication and handle errors in a more holistic way.
| #[error("{}", translate!("common-memory-exhausted"))] | ||
| OutOfMemory(io::Error), |
There was a problem hiding this comment.
| #[error("{}", translate!("common-memory-exhausted"))] | |
| OutOfMemory(io::Error), | |
| #[error("{}", translate!("error-out-of-memory"))] | |
| OutOfMemory(#[from] std::collections::TryReserveError), |
the call sites become much nicer
There was a problem hiding this comment.
I'm not a fan: the idea is to expand this to all io errors later on, not just the collection calls.
There was a problem hiding this comment.
A little more generic:
pub(crate) enum Error {
...
#[error(transparent)]
OutOfMemory(#[from] OutOfMemoryError),
...
}
#[derive(Debug, thiserror::Error)]
#[error("{}", translate!("error-out-of-memory"))]
pub(crate) enum OutOfMemoryError {
TryReserve(#[from] std::collections::TryReserveError)
}that needs .map_err(OutOfMemoryError::from) at the call sites.
There was a problem hiding this comment.
In fact, this seems like a good candidate to extract to uucore.
There was a problem hiding this comment.
exactly, I rather we merge this PR, then extract this to uucore? We'll have to wait for rustc to get the allocation failure hook back into std
|
@sylvestre : seems ready to me |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
@sylvestre had to rebase to check the ci |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
72c5c4d to
4667c48
Compare
No description provided.