You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've been using clojure.pprint/pprint for my pretty-printing needs so far, but it's really quite slow. I can't use Fipp because I don't want to take any dependencies (and because of e.g. https://github.com/brandonbloom/fipp/issues/37), so I thought I'd have a go at making my own pretty-printer.
What I have so far is dozens, sometimes hundreds of times faster than clojure.pprint/pprint, and 12x-15x faster than fipp.edn/pprint at Fipp's own benchmark. (It also allocates 10-25x fewer bytes than clojure.pprint/pprint or fipp.edn/pprint.) The implementation (https://github.com/eerohele/tab/blob/b5f1c0dd86349d05184d59746a017d9ed27e852d/src/tab/impl/pprint.clj) is ~200 lines of code. There are some benchmark results here: https://github.com/eerohele/tab/actions/runs/6348406766/job/17244962062#step:7:365
One tradeoff is that it's not customizable like clojure.pprint or Fipp, but that's not something I really need.
Anyway, I figured I'd throw this out there in case anyone needs something like this, or if anyone has any ideas for improving the current impl.
Perhaps it's worth inlining this in Orchard, given it's both quite simple and fast.
The text was updated successfully, but these errors were encountered:
Emacs is the bottleneck when rendering a lot of text in general. :-) I think it does better with pprinted content than average, mostly because there are no very long lines, which have been a historical weakness of its text rendering engine.
The following thread on the Clojurians Slack caught my attention https://clojurians.slack.com/archives/C04CAKAGADU/p1695973819828719
Perhaps it's worth inlining this in Orchard, given it's both quite simple and fast.
The text was updated successfully, but these errors were encountered: