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

remove unused static data for to_lowercase #107502

Closed
wants to merge 1 commit into from

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Jan 31, 2023

remove a ton of unused empty strings in char::to_lowercase. The last column in the lower case table is completely unused. I noticed this table when analyzing code bloat when compiling to wasm. using to_lowercase increased the binary size from 50kb to 75kb (which is mostly consisting of empty entries '\u{0}').

Removing the last column is an obvious solution, two others could be done too.

  1. The second column has only one entry. Remove that column and create a special handling for that.
  2. Group consecutive chars with the same conversion distance.

This changes only internals, public API behavior is unchanged (except probably faster).

@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2023

r? @Mark-Simulacrum

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

@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 31, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 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

remove a ton of unused empty strings in char::to_lowercase.
The last column in the lower case table is completely unused.
I noticed this table when analyzing code bloat when compiling to wasm.
using to_lowercase increased the binary size from 50kb to 75kb (which is mostly consisting of empty entries '\u{0}').

Removing the last column is an obvious solution, two others could be done too.
1. The second column has only one entry. Remove that column and create a special handling for that.
2. Group consecutive chars with the same conversion distance.
Copy link
Contributor

@eggyal eggyal left a comment

Choose a reason for hiding this comment

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

///! This file is generated by src/tools/unicode-table-generator; do not edit manually!

You'll need to modify the table generator tool rather than manually adjusting this file.

@workingjubilee workingjubilee added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 2, 2023
@JohnCSimon
Copy link
Member

@PSeitz

ping from triage - can you post your status on this PR? There hasn't been an update in a few months. Thanks!

FYI: when a PR is ready for review, send a message containing
@rustbot ready to switch to S-waiting-on-review so the PR is in the reviewer's backlog.

@PSeitz
Copy link
Contributor Author

PSeitz commented Mar 14, 2023

@JohnCSimon I need to edit the table generator instead of the resulting file. I didn't have time yet to do that

@bors
Copy link
Contributor

bors commented Mar 24, 2023

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

@Dylan-DPC
Copy link
Member

@PSeitz any updates on this?

@PSeitz
Copy link
Contributor Author

PSeitz commented May 19, 2023

@Dylan-DPC It's still on my list, but I didn't have the time yet

@Dylan-DPC
Copy link
Member

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

@Dylan-DPC Dylan-DPC closed this Aug 2, 2023
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. 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.

None yet

8 participants