We have a regression since we started reclaiming love Text fragments
more aggressively in commit 69c5d844cc. Pressing pageup no longer knows
about any line's screen lines. Not fixed yet.
All signs so far seem to be that CPU is cheap for this application, but
memory is expensive. It's easy to get sluggish if the GC comes on.
After some experiments using https://github.com/yaukeywang/LuaMemorySnapshotDump,
one source of memory leaks is rendered fragments (https://love2d.org/wiki/Text
objects). I need to render text in approximately word-sized fragments to
mostly break lines more intelligently at word boundaries.
I've attached the files I used for my experiments (suffixed with a '.')
There's definitely still a leak in fragments. The longer I edit, the
more memory goes to them.
file:write can write multiple args one after another; no need to
concatenate them first.
I'm starting to pay attention to memory usage after the experience of
turning off the JIT.
I've tried to keep the time period of the blinking similar to my
terminal.
Honestly I'm no longer sure if any of my experiments are showing a
statistically significant result. Let's see how it feels over a period
of time.
I'm testing this by moving the cursor around with my eyes closed, then
starting a stopwatch as I open my eyes. This seems to help a bit. I'm
able to acquire the cursor in 2s. At least the 10s outliers I used to
have with the circle or thin line don't seem to be happening.
Problem: repeatedly copying (relatively large) sections of text quickly
makes the app sluggish until it has to be killed. (Thanks John Blommers
for the report.)
When I instrument with prints, the sluggishness seems to happen in
random draw() calls many times after I perform the copy.
I don't know for sure, but I'm initially checking if the cause is
garbage generated by repeated string concatenation.
This attempt doesn't seem to make any difference.
This still isn't ideal. On my Linux laptop for some reason the window
receives a signal to maximize itself soon after (but sometime after) the
program starts.