logo

Caching Performance

Examples / Caching Performance

Caching Performance

Explore how the built-in TokenCache optimizes re-renders by caching parsed markdown tokens.

Controls

Statistics

Render count 0
Average time 0ms
Cache size size() { this.prune(); return this.cache.size; }

Render Log

Click "Render" to start tracking performance.

Markdown Input

1498 characters

Rendered Output

Click "Render" to see the markdown output.

How Token Caching Works

  • First render parses markdown into tokens and stores them in an LRU cache.
  • Subsequent renders of the same content skip parsing and use cached tokens (50-200x faster).
  • The cache uses LRU eviction and TTL expiration to manage memory automatically.