Skip to content

Conversation

@svbergmann
Copy link

  • Reused a single RbelHtmlRenderingToolkit per /getMessagesWithHtml request instead of constructing a new one per message, and added a reset hook to clear per‑message JSON note tags. This reduces object churn and prevents note tag accumulation across messages.
  • Ensured full HTML document rendering resets the note tags between messages too, so output stays correct and memory stays bounded.

Why this works for performance:

  • The toolkit holds an ObjectMapper and a noteTags map that grows during rendering. Creating a new toolkit for every message or letting noteTags grow across messages increases allocations and GC pressure.
  • Reusing one toolkit per request avoids repeated heavyweight instantiation.
  • Resetting noteTags before each message keeps memory bounded and prevents mismatched note replacements across messages, preserving correct rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant