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

[stdio][windows] Use MBTWC and WCTMB #107110

Merged
merged 1 commit into from
Feb 27, 2023
Merged

Conversation

strega-nil
Copy link
Contributor

MultiByteToWideChar and WideCharToMultiByte are extremely well optimized, and therefore should probably be used when we know we can (specifically in the Windows stdio stuff).

Fixes #107092

@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ChrisDenton (or someone else) soon.

Please see the contribution instructions for more information.

@rustbot rustbot added 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. labels Jan 20, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@bors
Copy link
Contributor

bors commented Feb 12, 2023

☔ The latest upstream changes (presumably #105671) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

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

If you could rebase then I think I'll be inclined to merge this. It does seem to be a perf improvement, at least on some machines and I do think it's useful to leverage OS APIs where we can. I only have one small note...

library/std/src/sys/windows/stdio.rs Show resolved Hide resolved
@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@strega-nil
Copy link
Contributor Author

@ChrisDenton rebased! (sorry, I was busy with work)

@ChrisDenton
Copy link
Member

That's fine, there's no rush!

@bors r+

@bors
Copy link
Contributor

bors commented Feb 26, 2023

📌 Commit 7f25580 has been approved by ChrisDenton

It is now in the queue for this repository.

@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 Feb 26, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Feb 26, 2023
[stdio][windows] Use MBTWC and WCTMB

`MultiByteToWideChar` and `WideCharToMultiByte` are extremely well optimized, and therefore should probably be used when we know we can (specifically in the Windows stdio stuff).

Fixes rust-lang#107092
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 27, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#104265 (Move IpAddr, SocketAddr and V4+V6 related types to `core`)
 - rust-lang#107110 ([stdio][windows] Use MBTWC and WCTMB)
 - rust-lang#108308 (Allow building serde and serde_derive in parallel)
 - rust-lang#108363 (Move the unused extern crate check back to the resolver.)
 - rust-lang#108519 (Bages for easy access links to Rust community)
 - rust-lang#108522 (Commit some new solver tests)
 - rust-lang#108523 (Avoid `&str` to `String` conversions)
 - rust-lang#108533 (diagnostics: avoid querying `associated_item` in the resolver)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3fe4023 into rust-lang:master Feb 27, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

[performance][windows][stdio] write_valid_utf8_to_console should almost certainly call MultiByteToWideChar
4 participants