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

rustc_span: add span_data_to_lines_and_cols to caching source map view #79012

Merged
merged 3 commits into from
Jan 12, 2021

Conversation

tgnottingham
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 2020
@tgnottingham
Copy link
Contributor Author

This is a performance mitigation for #76256. The improvement is about the smallest I'd feel justified in creating PR for, and I'm not totally sure the improvement justifies the added complexity. But I'm doing my due diligence.

@lqd
Copy link
Member

lqd commented Nov 13, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Nov 13, 2020

⌛ Trying commit 86a35a4b64dff6b358e7513012985387c24507c8 with merge dbf6d2754823752951e168718a5fa4b318adf742...

@bors
Copy link
Contributor

bors commented Nov 13, 2020

☀️ Try build successful - checks-actions
Build commit: dbf6d2754823752951e168718a5fa4b318adf742 (dbf6d2754823752951e168718a5fa4b318adf742)

@rust-timer
Copy link
Collaborator

Queued dbf6d2754823752951e168718a5fa4b318adf742 with parent f036a8f, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (dbf6d2754823752951e168718a5fa4b318adf742): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-perf

@camelid
Copy link
Member

camelid commented Dec 4, 2020

Note: this seems to have very small perf improvements.

@tgnottingham
Copy link
Contributor Author

tgnottingham commented Dec 4, 2020

Yeah, I don't have strong feelings on whether or not to push forward with this. I'll note that cycles, cpu-clock, and task-clock stats saw moderate improvements even though instruction counts saw very small improvements. But it's possible that was just luck with the variance.

I'll rebase and get another perf run. If those stats show improvements again, I'd feel stronger about trying to merge this.

Gives a performance increase over calling byte_pos_to_line_and_col
twice, partially because it decreases the function calling overhead,
potentially because it doesn't populate the line cache with lines that
turn out to belong to invalid spans, and likely because of some other
incidental improvements made possible by having more context available.
@lqd
Copy link
Member

lqd commented Dec 4, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Dec 4, 2020

⌛ Trying commit 75de828 with merge 57b7048fd4b5f30335c7a76b1c80b42e1c630b52...

@bors
Copy link
Contributor

bors commented Dec 4, 2020

☀️ Try build successful - checks-actions
Build commit: 57b7048fd4b5f30335c7a76b1c80b42e1c630b52 (57b7048fd4b5f30335c7a76b1c80b42e1c630b52)

@rust-timer
Copy link
Collaborator

Queued 57b7048fd4b5f30335c7a76b1c80b42e1c630b52 with parent e9dd18c, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (57b7048fd4b5f30335c7a76b1c80b42e1c630b52): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-perf

@jyn514
Copy link
Member

jyn514 commented Jan 11, 2021

The second perf run was a lot more promising :) up to -.7% on instruction counts.

@estebank
Copy link
Contributor

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jan 11, 2021

📌 Commit 75de828 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 11, 2021
@estebank
Copy link
Contributor

CC @rust-lang/compiler
It's added complexity and marginal improvements, but it improves some worst-case scenarios.

@bors
Copy link
Contributor

bors commented Jan 11, 2021

⌛ Testing commit 75de828 with merge fe531d5...

@bors
Copy link
Contributor

bors commented Jan 12, 2021

☀️ Test successful - checks-actions
Approved by: estebank
Pushing fe531d5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 12, 2021
@bors bors merged commit fe531d5 into rust-lang:master Jan 12, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 12, 2021
@tgnottingham tgnottingham deleted the span_data_to_lines_and_cols branch January 20, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants