Hacker News new | ask | show | jobs
by jclem 2450 days ago
Thanks!

It’s parsing the entire Markdown content on each key press right now, which is definitely suboptimal for a product but fine for my needs.

It should certainly be possible to make this more efficient by either doing some smarter diffing of the in-progress document or using an operation-based update mechanism.

LiveView doesn’t yet have event debouncing built in, but it’s in the works, I believe, and that would help, as well.

That said, it’s currently fast enough writing a post of this length that while writing, I notice no significant lag in the live updates. By the time I stop typing and look at the preview, it’s up to date.

1 comments

They rolled out debounce and throttle fairly recently. There's also some very compelling work on a component abstraction (runs in same Liveview process).