-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WIP]: speed up rope iteration and serving #4008
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
crates/turbo-tasks-fs/src/rope.rs
Outdated
@@ -686,6 +702,22 @@ impl From<RopeElem> for StackElem { | |||
} | |||
} | |||
|
|||
trait PtrEq { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need a new trait for this?
Could add a small helper function for Bytes
, but even that might be more overhead to read than just copy pasting 2 times
crates/turbo-tasks-fs/src/rope.rs
Outdated
let mut left = RopeReader::new(left, index); | ||
let mut right = RopeReader::new(right, index); | ||
loop { | ||
match (left.fill_buf(), right.fill_buf()) { | ||
match (left.next(), right.next()) { | ||
// fill_buf should always return Ok, with either some number of bytes or 0 bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment probable needs to be changed
🟢 CI successful 🟢Thanks |
Benchmark for 9eac652
Click to view full benchmark
|
Appears this was not the cause, rope iteration must just be really slow. |
This reverts commit 44598d4.
Benchmark for 8674b47
Click to view full benchmark
|
Benchmark for 02d2dd6
Click to view full benchmark
|
This is just a test to see if
Bytes
equality is secretly very slow. It uses slice equality, which usesmemcmp
for&[u8]
. But maybememcmp
doesn't have the obvious optimization for pointer equality? This is the only reason that I can think of leading to the performance improvements in #3955. The rope traversal can't be that expensive, right?