Repository navigation
perf(web): migrate WebGL timeline rendering to IdBitset and optimize selection resolution - #925
Conversation
There was a problem hiding this comment.
Code Review
This pull request optimizes performance and reduces memory overhead in the KHI frontend by refactoring the log and timeline filtering mechanism to use bitsets (IdBitset) instead of instantiating and passing arrays of Log objects. It updates the WebGL renderers (TimelineEventsRenderer, TimelineRevisionsRenderer) to upload these bitsets as textures, allowing shaders to dynamically evaluate filter and selection states. Additionally, it introduces a GLSLFunctionTester utility to test shader functions via transform feedback. The review feedback suggests further performance optimizations by utilizing the direct logId property on Revision and Event to prevent unnecessary Log adapter instantiations in LogListComponent and StructYamlPrefetchService, and requests correcting relative imports to absolute paths in test and storybook files to align with the project's style guide.
Summary
Significantly accelerates timeline rendering and user interaction by replacing array-based log filtering with compact
IdBitsetrepresentations, offloading dynamic status updates to WebGL shaders, and optimizing timeline/log selection resolution.Key Changes
IdBitset.filteredLogswithallLogsandfilteredLogIds.glsl-function-tester.ts):GLSLFunctionTesterto unit test WebGL GLSL vertex shader functions directly in Karma/Jasmine tests.logIdToTimelineIds) inTimelineStoreforSelectionManagerto resolve selection states using bitset queries.LogListComponentand timeline selection consumers.Verification
npm test -- --watch=false --browsers=ChromeHeadless(1,049 tests passed)