Skip to content

tests: ip*_properties: avoid parsing the IP over and over again#156357

Open
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:slow-test
Open

tests: ip*_properties: avoid parsing the IP over and over again#156357
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:slow-test

Conversation

@RalfJung
Copy link
Copy Markdown
Member

@RalfJung RalfJung commented May 9, 2026

This test somehow takes 12s to execute in Miri (on CI, i.e. on a slow machine), despite not having any loop. I suspect it's caused by us for some reason re-parsing the same string again and again. Let's just not do that.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 9, 2026
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 9, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, nia-e

($s:expr) => {
Ipv6Addr::from_str($s).unwrap()
};
}
Copy link
Copy Markdown
Member Author

@RalfJung RalfJung May 9, 2026

Choose a reason for hiding this comment

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

For some reason someone even added a macro instead of just let-binding the result of this function call...?!?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was in fact let-bound before c34bcc6, when for some reason it got turned into macros that repeat the function call again and again. That commit is part of #60145. That PR says the macros make it easier to add more tests and will give better errors on panics, which might be true for the check! macro but is definitely not true for the ip! macro.

@RalfJung RalfJung changed the title tests: ipv6_properties: avoid parsing the IP over and over again tests: ip*_properties: avoid parsing the IP over and over again May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants