Closed wasamasa closed 7 months ago
Runtime is rather finely bound at O(n^2), probably O(n^3) with the silly data structures we have in lisp (linked lists). I don't really store the memory most optimally (if you print it out you can get an exponential serialization), but I think that emacs does some structure sharing internally so it too should be at most quadratic (in short, each possible line stores the reference to all parents who store references to all parents...). I don't really know how to debug this though.
Alright, what you could do is measuring memory usage after each call of the function and see whether it correlates to the error message. That's it for my ideas though, other than doing a rewrite with vectors.
I'm going to close this and investigate more if there will be issues. I rewrote the algorithm since then I think :D
I get this when rendering the first chapter of Mastering Emacs with Cambria at a font size greater than 17. Reducing the font size makes Emacs proceed normally. I've always assumed the algorithm to be problematic with regards to runtime, not memory usage. Any ideas how I can debug this?