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

Try ShortText or Basement.String instead of Text for strings in Expr #1032

Open
sjakobi opened this issue Jun 27, 2019 · 8 comments
Open

Try ShortText or Basement.String instead of Text for strings in Expr #1032

sjakobi opened this issue Jun 27, 2019 · 8 comments
Labels
performance All the slow and inefficient things

Comments

@sjakobi
Copy link
Collaborator

sjakobi commented Jun 27, 2019

See http://hackage.haskell.org/package/text-short-0.1.2/docs/Data-Text-Short.html#t:ShortText
and http://hackage.haskell.org/package/basement-0.0.10/docs/Basement-String.html#t:String.

Both are UTF8 which could be a benefit.

@sjakobi sjakobi added the performance All the slow and inefficient things label Jun 27, 2019
@sjakobi
Copy link
Collaborator Author

sjakobi commented Jun 28, 2019

For reference, there was a slightly related discussion on string interning on discourse

@ocharles
Copy link
Member

Is there anyway we could get that archive into our Discourse instance?

@Gabriella439
Copy link
Collaborator

@ocharles: Not that I know of

@ocharles
Copy link
Member

Presumably you are repyling to "Is there any automated way we could that archive into our Discourse instance?" which isn't quite what I'm asking. We could certainly manually restore the backup by going through this archive, assuming Discourse gives us a way to manually create posts or something. Maybe not worth doing now though...

@sjakobi
Copy link
Collaborator Author

sjakobi commented Jun 28, 2019

Is there anyway we could get that archive into our Discourse instance?

You can find some threads via this Google search: https://www.google.de/search?q=site%3Adiscourse.dhall-lang.org/t/

Then click on the green arrow next to each URL to access the cache.

@ocharles
Copy link
Member

Sorry to derail this issue, but maybe we should mention that on Discourse itself. Possibly pinned, though maybe that's not important.

@sjakobi
Copy link
Collaborator Author

sjakobi commented Jun 28, 2019

Sorry to derail this issue, but maybe we should mention that on Discourse itself.

See https://discourse.dhall-lang.org/t/sorry-i-deleted-the-forum-history/11/6

Let's continue this discussion to Discourse.

@sjakobi
Copy link
Collaborator Author

sjakobi commented Jul 1, 2019

I've tried converting the core data structures in Dhall.Core and Dhall.Eval to use ShortText instead of Text on the sjakobi/1032-text-short branch.

So far I've only seen tiny speedups for normalizing cpkg's pkg-set.dhall. The deep-nested-large-record benchmark got slightly slower. It's possible that the benefits would be more pronounced on very large projects.

Since many of the libraries that dhall talks to use Text, there's a bit of additional conversion overhead. Which is sad, as many of these libraries eventually convert their UTF16 Text to UTF8 again… Let's hope that text-utf8 eventually takes off!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance All the slow and inefficient things
Projects
None yet
Development

No branches or pull requests

3 participants