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

Some minor cleanup and improvements to unicode.py #30695

Merged
merged 5 commits into from
Jan 12, 2016

Conversation

ranma42
Copy link
Contributor

@ranma42 ranma42 commented Jan 4, 2016

and the associated update of tables.rs

The last commit is related to my comment to #29734.

The methods related to char width are dead code since
464cdff; remove them.
Make unicode.py generate a tables.rs which is more conformant to usual
Rust formatting (as per `rustfmt`).
Do not hand-code `Result::ok` or `cmp` in tables.rs.
As mentioned in rust-lang#29734, the range comparison closure can be improved.

The LLVM IR and the assembly from the new version are much simpler and
unfortunately we cannot rely on the compiler to optimise this much, as
it would need to know that `lo <= hi`.

Besides from simpler code, there might also be a performance
advantage, although it is unlikely to appear on benchmarks, as we are
doing a binary search, which should always involve few comparisons.

The code is available on the playpen for ease of comparison:
http://is.gd/4raMmH
with a new version generated by src/etc/unicode.py.
@rust-highfive
Copy link
Collaborator

r? @pnkfelix

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

@alexcrichton
Copy link
Member

@bors: r+ 3fff634

Thanks!

@bors
Copy link
Contributor

bors commented Jan 12, 2016

⌛ Testing commit 3fff634 with merge 7cffc9b...

bors added a commit that referenced this pull request Jan 12, 2016
and the associated update of tables.rs

The last commit is related to my comment to #29734.
@bors
Copy link
Contributor

bors commented Jan 12, 2016

💔 Test failed - auto-mac-64-opt

@nagisa
Copy link
Member

nagisa commented Jan 12, 2016

@bors retry

@bors bors merged commit 3fff634 into rust-lang:master Jan 12, 2016
@ranma42 ranma42 deleted the cleanup-unicode branch January 12, 2016 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants