[GHC] #12248: Simple program that runs 100x slower using Text or ByteString vs. String
GHC
ghc-devs at haskell.org
Thu Jun 30 03:17:56 UTC 2016
#12248: Simple program that runs 100x slower using Text or ByteString vs. String
-------------------------------------+-------------------------------------
Reporter: dsf | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Core Libraries | Version: 8.0.1
Resolution: invalid | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by rwbarton):
* status: new => closed
* resolution: => invalid
Comment:
Yes, because `String` is a linked list so you can efficiently prepend a
short `String` to a long `String`, while (strict) `ByteString` and `Text`
are flat arrays so prepending a short one to a long one requires copying
the entire long one. Different data structures for different tasks!
Anyways, bytestring and (especially) text are not part of GHC, and have
their own issue trackers.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12248#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list