You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(mongodb): string interning pool for BSON document tree keys and categorical values #1536
In MongoDocumentTreeView (lib/features/mongodb/mongo_document_tree_view.dart), displaying large MongoDB collections allocates hundreds of thousands of duplicate string instances for common BSON keys (_id, createdAt, status, type, userId) across documents in the collection view.
This leads to high heap usage and garbage collection stalls during collection browsing.
Solution
Introduce a scoped StringInternPool in the MongoDB document tree engine.
Intern repetitive field names and frequent string values when converting and rendering BSON nodes.
Benefits
35-50% reduction in memory consumption when browsing large MongoDB collections.
Smoother scrolling and tree expansion in document view.
MongoDocumentTreeView receives already-decoded Maps; the page size is _defaultLimit = 25 documents, so we are talking about hundreds of strings, not hundreds of thousands.
If interning were ever wanted it would belong in the driver's BSON decode, not in the view, and the claimed 35-50% memory saving has no measurement behind it.
Activity
ZhuchkaTriplesix commentedon Oct 12, 2026
Closing: not supported by the code or by numbers.
MongoDocumentTreeViewreceives already-decodedMaps; the page size is_defaultLimit = 25documents, so we are talking about hundreds of strings, not hundreds of thousands.