perf: Make render contexts and debug caches lazily allocated (#3980)