Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR optimizes LCM module load time by implementing lazy imports and refactoring module dependencies. Key Changes1. Lazy Import Optimization
2. Module Refactoring
3. Dead Code Removal
Impact Assessment✅ No breaking changes: The moved class was not in the Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant App as Application Code
participant LCM as lcmpubsub.py
participant JPEG as jpeg_shm.py
participant Camera as CameraInfo.py
participant PC2 as PointCloud2.py
Note over LCM,JPEG: Before: lcmpubsub imports turbojpeg at module load
Note over LCM,JPEG: After: jpeg_shm owns turbojpeg, isolated from lcmpubsub
App->>LCM: import LCM
activate LCM
Note over LCM: ✅ No longer loads turbojpeg<br/>✅ Faster module load
LCM-->>App: Ready (fast)
deactivate LCM
App->>JPEG: import JpegSharedMemory
activate JPEG
Note over JPEG: Loads turbojpeg, Image<br/>Only when needed
JPEG-->>App: Ready
deactivate JPEG
App->>Camera: import CameraInfo
activate Camera
Note over Camera: ✅ Rerun NOT loaded yet
Camera-->>App: Ready (fast)
deactivate Camera
App->>Camera: camera.to_rerun()
activate Camera
Note over Camera: Lazy load rerun here
Camera-->>App: Rerun archetype
deactivate Camera
App->>PC2: import PointCloud2
activate PC2
Note over PC2: ✅ Matplotlib & Rerun NOT loaded
PC2-->>App: Ready (fast)
deactivate PC2
|
paul-nechifor
approved these changes
Jan 10, 2026
Contributor
|
Curious how much this speeds up loading |
spomichter
approved these changes
Jan 12, 2026
Contributor
Author
from 6 seconds to 0.1ms :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
just made some loading lazy, needs repo wide consideration tho