Best practices and performance tips for RDKit.js
masterTo ensure a smooth user experience and efficient memory management, follow these tips:
- Offload heavy work: Run the RDKit module inside a Web Worker to prevent blocking the main UI thread during intensive cheminformatics computations.
- Memory Management: Always call
mol.delete()on molecule objects once they are no longer needed to prevent memory leaks. - SVG Styling: To make molecule SVG renders have a transparent background, use the following CSS:
.molecule-structure-svg svg rect:first-of-type { fill: transparent !important; } - Exception Handling: The package is compiled with Emscripten
-fwasm-exceptions, supporting WebAssembly.Exception.