codevis
codevis copied to clipboard
output to image tiles
Rendering to one large image requires allocating that uncompressed image in memory. This is prohibitively expensive when rendering large repositories. Rendering the 30 million line Linux Kernel as readable would require allocating around 1.3TB of memory, just to render the image. Another bottleneck would be that, after rendering, saving the entire image to one PNG file would involve compressing the entire image using only a single thread.
A solution to this, might be to slice the image up into tiles, and only cache a certain number of tiles in memory. This means cached tiles (ones used recently) could be written to quickly for rendering. And once we are done writing to them, they could be compressed to a PNG and offloaded to Disk. Saving memory, and allowing image compression to be made parallel.