Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Move to using bit sets for ScriptExtension#3

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Manishearth merged 2 commits intomasterfrombits
Jan 12, 2020
Merged

Conversation

@Manishearth
Copy link
Member

@ManishearthManishearth commentedJan 11, 2020
edited
Loading

Should be much faster and cleaner, since the actual implementation is no longer using a ton of autogenerated enum matches and is instead using bit operations in the handwritten part of the crate.

Fixes#2

Probably won't merge till I add tests.

@ManishearthManishearthforce-pushed thebits branch 4 times, most recently fromd03aa82 to0609daeCompareJanuary 11, 2020 10:31
@Manishearth
Copy link
MemberAuthor

Some tests exist, I kinda want to add more including some manual ones (and maybe pull in quickcheck)

@Manishearth
Copy link
MemberAuthor

I also need to check perf of the important operations

@Manishearth
Copy link
MemberAuthor

Manishearth commentedJan 11, 2020
edited
Loading

Benchmark numbers:

New:test tests::bench_ext_intersection    ... bench:           2 ns/iter (+/- 0)test tests::bench_ext_to_script       ... bench:           5 ns/iter (+/- 0)test tests::bench_script_to_ext       ... bench:           1 ns/iter (+/- 0)test tests::bench_script_intersection ... bench:           3 ns/iter (+/- 0)test tests::bench_to_vec              ... bench:         156 ns/iter (+/- 37)test tests::bench_string_ext          ... bench:       7,175 ns/iter (+/- 655)Old:test tests::bench_ext_intersection    ... bench:           5 ns/iter (+/- 0)test tests::bench_ext_to_script       ... bench:           0 ns/iter (+/- 0)test tests::bench_script_to_ext       ... bench:           0 ns/iter (+/- 0)test tests::bench_script_intersection ... bench:           7 ns/iter (+/- 0)test tests::bench_to_vec              ... bench:          14 ns/iter (+/- 1)test tests::bench_string_ext          ... bench:       7,292 ns/iter (+/- 631)

It's better for most operations except for conversions and to_vec (which is to be expected). The common one -- converting aScript to aScriptExtension -- is still pretty fast. The actual lookup operation seems to dominate for matching.

The perf wins (and losses) don't really matter here, but it's always good to start measuring early. IMO this PR is worth it just for moving all the weird stuff out of autogeneration.

@ManishearthManishearthforce-pushed thebits branch 13 times, most recently frome34e1a8 toee222f7CompareJanuary 12, 2020 06:25
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Potentially store ScriptExtension as a set of bitfields

2 participants

@Manishearth

[8]ページ先頭

©2009-2025 Movatter.jp