Closed ceedubs closed 2 months ago
Also, I was curious if there's maybe some problem with Text.++
but if you don't print out the result at the end, it's instantaneous for all three.
I have no idea why, but this is way better now. For n = 10k
I get 500ms instead of 25 seconds. For n = 100k
it is on the order of a second or two.
The pretty-printer is really slow for long
Text
values. I could see the pretty-printer being slow when printing nested data structures in which it's attempting to align neatly, but it's slow even with just a flatText
value.As you increase the length of the string, the slow down seems to be greater than linear. Consider the following watch expression:
On my computer here are the results:
Normally you probably aren't printing huge strings in watch expressions, so it's probably not that big of a deal. One context in which it can be a pain is when a program throws a
Failure
that has a data structure with a long string inside theAny
value. This can cause your ucm session to hang for minutes at a time.