Improve render performance#29
Conversation
|
This is awesome, thanks! |
|
@kschweppe could you update RenderSpec to match the way the new rendering works? It's currently calling addIndent in a couple tests. Also main is now passing CI if you want to merge |
|
Ah I missed the test. I just added elementLines :: Int -> Int -> Element -> [Line]
elementLines indent depth elm = ... |
|
We can remove addIndent, I just want to make sure the output is indenting correctly, so the tests would need to be updated. |
I don't mind if the argument meaning changes, as long as the output is properly indented. |
* Use Builder for concatenation * Avoid unnecessary allocations for indentation
|
Okay, should be good now. Btw, I needed to add |
|
Can't wait to get this into a release! Nice work! |
I noticed
renderLinesis causing a significant performance bottleneck when rendering large tables. This can easily be addressed by usingBuilderinstead ofText.Another small improvement is to construct
Linedirectly with the correct indent to avoid unnecessary allocations caused by callingaddIndent, which is called quite often.Before:
After: