3 ms·
CPUs are more generic though and pretty much every single GPU accelerated text drawing operation i've seen allocates permanent GPU resources (textures mainly).
by Crinus 7y ago
CPUs are more generic though and pretty much every single GPU accelerated text drawing operation i've seen allocates permanent GPU resources (textures mainly). It isn't impossible to not do that, but if you only allocate the necessary resources for the GPU on an as-needed basis and then release them once you're done, you are introducing latency which invalidates any gains you may have. The alacritty terminal linked elsewhere in this post, for example, keeps a bunch of atlases around with hundreds of glyphs which are local to each instance of the program (thus using both CPU and GPU resources) and for macOS and Windows ignoring any system-wide glyph caching the APIs it uses may already have (caches that will be created - and thus resource allocated - anyway when it tries to rasterize those glyphs for its own use).
FWIW yeah, i agree that most people do not really need 4K displays but that is another matter.
- comex 7y ago> CPUs are more generic though Which is exactly why you want to save the GPU for what it does best – drawing pixels. > and pretty much every single GPU accelerated text drawing operation i've seen allocates permanent GPU resources (textures mainly). Makes sense as a concern, and it's not something I've looked into. (I don't use alacritty.) On the other hand, how much memory are we actually talking about? On my system (total screen resolution 2880x1800), a typical terminal glyph has a roughly 14x16 bounding box; let's bump that up to 20x20 to account for padding. Stored as 8-bit RGBA, that would take 1600 bytes. An atlas of "hundreds" of glyphs would then be expected to take up on the order of hundreds of KB... which seems pretty negligible? A larger font, multiple atlases, or more characters per atlas would require more memory, but I still don't see how you get to an amount worth worrying about. I could be missing something.
- bigiain 7y agoI'm sure my rose-tinted glasses memories of the olden days are entirely unfounded, but I've written code using a VT100 plugged into a VAX 11/780, and the first machine I had at home was an Osbourne 1, with a 4kHz Z80 processor and 64kb of ram (the top 4kb of which was the memory mapped video ram)... It seems the increase in utility we've got from being able to use teraflops of massively parallel GPU with Gigabytes of ram available - doesn't exactly match the 6 orders of magnitude or so more resource use... "It scrolls soooo smoothly, and you can use the poop emoji in your source code!!!" ;-) </old_man type='grumpy'>
- Crinus 7y agoOne important thing you are missing is that you are focusing on a single instance of a single program doing that. These caches are not shared among programs and unless you are only running a single program at a time in your OS, if every program does such resource abuse (not necessarily this particular type of abuse, but in not caring about resources in general) then you get a slow computer. Computers feel as slow as ever (which was the topic a few nodes above) despite being much faster in theory not because of a single program but because all (or well, the overwhelming majority) the programs in your computer abuse resources - even if a little. It is death from a thousand little abuses.