-
-
Notifications
You must be signed in to change notification settings - Fork 202
Implement Virtual Fields for Zero-Overhead Records #9193
Copy link
Copy link
Closed
Labels
aicoreCore framework functionalityCore framework functionalityenhancementNew feature or requestNew feature or requestperformancePerformance improvements and optimizationsPerformance improvements and optimizations
Description
Objective
Implement virtual: true support in Neo.data.RecordFactory and update DevIndex.model.Contributor to utilize it.
Motivation
The DevIndex.model.Contributor currently generates 60+ fields for yearly stats (e.g., y2020, cy2020). Despite claims of "Zero Overhead", these are currently stored as individual properties on every record instance, causing significant memory duplication.
Implementation Plan
- Update
Neo.data.RecordFactory:- Support
virtual: truein field configs. - Getter Logic: Virtual fields will define a getter on the prototype that executes
field.calculate(this[dataSymbol]). - Storage Logic:
assignDefaultValuesandsetRecordFieldsmust skip virtual fields to ensure they are never written to the instance data.
- Support
- Update
DevIndex.model.Contributor:- Update
addYearFieldsto setvirtual: truefor all year-based fields (y...,cy...,py...). - Ensure the
calculatefunctions for these fields use efficient O(1) array lookups.
- Update
Outcome
True "Zero Overhead" for calculated year fields, reducing memory footprint for the 50k+ contributor dataset while maintaining O(1) access performance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
aicoreCore framework functionalityCore framework functionalityenhancementNew feature or requestNew feature or requestperformancePerformance improvements and optimizationsPerformance improvements and optimizations