Skip to content

Add benchmark for UTF-8 decoding #1493

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

Merged
merged 3 commits into from
Mar 2, 2016

Conversation

PatrickPijnappel
Copy link
Contributor

What's in this pull request?

Adds a performance test for UTF-8 decoding.

I didn't pre-multiply N, since the README suggest that, but the other benchmarks all seem to be premultiplying it. What's the preferred approach here?


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

@gribozavr
Copy link
Contributor

I'd recommend adding multiple long runs of 2-byte and 3-byte characters into the test string. That's the typical case, whereas mixed-language case is not.

@gribozavr
Copy link
Contributor

What do you mean by 'pre-multiply'?

@PatrickPijnappel
Copy link
Contributor Author

The other benchmark do for i in 0...1000*N { ... } (or times whatever constant), while the README suggests for i in 0...N { ... }

@gribozavr
Copy link
Contributor

@gottesmm What's your recommendation?

@lplarson
Copy link
Contributor

lplarson commented Mar 1, 2016

We only pre-multiply if a single iteration (N=1) doesn't provide a stable duration to multiply off of to reach a one second sample. If you're seeing a one second sample time, don't pre-multiply.

@lplarson
Copy link
Contributor

lplarson commented Mar 2, 2016

@swift-ci Please test

@PatrickPijnappel
Copy link
Contributor Author

Ok this test case probably needs a pre-applied multiplier because the setup code otherwise would skew the results, will add one.

@PatrickPijnappel
Copy link
Contributor Author

@lplarson I looked at the benchmark script and added some clarifications to the benchmark README for future reference (#1514).

lplarson added a commit that referenced this pull request Mar 2, 2016
@lplarson lplarson merged commit e05fc61 into swiftlang:master Mar 2, 2016
@PatrickPijnappel PatrickPijnappel deleted the utf8-benchmark branch March 2, 2016 23:17
@PatrickPijnappel
Copy link
Contributor Author

@nadavrot I accidentally benchmarked that against an old build, it does take longer. Adjusment in #1521.

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.

4 participants