Optimize performance-sensitive code by eliminating unnecessary work:
// Prefer cheap value first to avoid extra computation
const useHtmlLabels = node.useHtmlLabels || getEffectiveHtmlLabels(getConfig());
forEach/map/render loops.
const config = getConfig();
data.nodes.forEach((item) => {
// use cached config
});
// Idea: shared label transform + optional lazy import of heavy lib
export async function renderMathLabels(input) {
const { katex } = await import('katex');
return katex.renderToString(/*...*/);
}
Enter the URL of a public GitHub repository