Skip to content

Add some basic benchmarks #27

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mordae
Copy link

@mordae mordae commented Apr 1, 2022

They measure almost all possible combinations of conversions for short, medium and large strings.
String conversions were omitted, because they are by definition always hopelessly slow.

@mordae mordae force-pushed the bench branch 2 times, most recently from 20dc3f9 to 2e6ccea Compare April 1, 2022 22:21
They measure almost all possible combinations of conversions for short,
medium and large strings.

String conversions were omitted, because they are by definition always
hopelessly slow.

Signed-off-by: Jan Hamal Dvořák <[email protected]>
Copy link
Owner

@soenkehahn soenkehahn left a comment

Choose a reason for hiding this comment

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

I'm not sure how much value benchmarks in string-conversions would have. This package just relays to other conversion functions from other libraries. So if one of the conversions is slow, there's not a lot that we could do about it.

Why do you think it'd be useful to add these?

I saw that you added e.g. altSBStoLT. Are these alternative conversions that are different from the ones we use currently? If yes, is any of the alternatives faster?

@mordae
Copy link
Author

mordae commented Apr 12, 2022

Alternative LazyByteString to LazyText seems significantly faster, but I have only measured the situation after text-2.0. It could have been totally different before.

I believe that since we are picking a default of sorts for the user, we should make sure to pick the best conversion approach and this choice should be informed -- at least a little -- by some measurements.

For easy to grok HTML output use:

cabal run bench -- -o benchmark.html

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.

2 participants