Skip to content

Performance improvements - #160

Open
cosminpolifronie wants to merge 20 commits into
simrail:mainfrom
cosminpolifronie:performance-improvements
Open

cosminpolifronie wants to merge 20 commits into
simrail:mainfrom
cosminpolifronie:performance-improvements

Conversation

@cosminpolifronie

Copy link
Copy Markdown
Contributor

After merging #158 and #159, you can also take a look at the performance improvements made here.
They do make a big difference on less powerful mobile devices.

cosminpolifronie and others added 20 commits September 30, 2026 21:53
…l Wiki information + additional routing bugfixes
…ittle to no heuristics are needed - generated routes are now also much more stable
…sn't fit the screen - now the popup will draw somewhere where it has space without moving the map
Not every station in the layer is a dispatch station.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ations""

The non-dispatch stations in that layer get their own "Passenger stations"
layer instead.

This reverts commit 136693d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CS icon with something more in the already existing style
Joins were stored as geometry only, and the client drew each one in the
colour of the leg before it, so a join crossing track that isn't in the
game was drawn green. Joins now carry their colour runs (same format as
segmentColors), which the client applies, reversed for joins drawn
backwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bearing was part of the marker's divIcon, so every position update of
a moving train created a new icon and Leaflet rebuilt the marker's DOM,
avatar image included. The icon now only changes with the avatar,
selection or border state, and the arrow is rotated on the existing
element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every train marker was moved, drift-animated and given a permanent
number tooltip on each 2-second update, including the ones far
off-screen. Trains outside the view plus half a screen of margin on
each side are now skipped; the selected train is always rendered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These were bundled with the map although the signal and sneakpeek
layers are off by default and the route data is only used once a route
is shown. They're now dynamic imports: the layers load theirs the first
time they're added to the map (LazyLayer; react-leaflet mounts overlay
children even while unchecked, so mounting isn't the trigger), and the
route data loads with the first route. check-routes.mjs now replaces the
dynamic route data import when it runs the route code in Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unplayable, passenger and remote station markers built their L.icon
inside the component, one per marker (~180 in total). The icon doesn't
depend on the station, so each kind now shares one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: da498b78-b67e-4130-9a52-b42cec9b4bfc

📥 Commits

Reviewing files that changed from the base of the PR and between 3123309 and 1ef1032.

⛔ Files ignored due to path filters (2)
  • packages/map/public/markers/icon-station-passenger.png is excluded by !**/*.png
  • packages/map/public/markers/icon-station-remote.png is excluded by !**/*.png
📒 Files selected for processing (27)
  • packages/map/components/LazyLayer.tsx
  • packages/map/components/Map.tsx
  • packages/map/components/Markers/HoverPopup.tsx
  • packages/map/components/Markers/NonPlayableStationMarker.tsx
  • packages/map/components/Markers/PassengerStationMarker.tsx
  • packages/map/components/Markers/SignalMarker.tsx
  • packages/map/components/Markers/StationMarker.tsx
  • packages/map/components/Markers/StationRemoteMarker.tsx
  • packages/map/components/Markers/TrainMarker.tsx
  • packages/map/components/PassengerStations.tsx
  • packages/map/components/PlayableArea.tsx
  • packages/map/components/Signals.tsx
  • packages/map/components/Sneakpeeks.tsx
  • packages/map/components/TrainRoute.tsx
  • packages/map/components/TrainsList.tsx
  • packages/map/components/playableArea.json
  • packages/map/components/railData.json
  • packages/map/components/stations.json
  • packages/map/components/stationsPassenger.json
  • packages/map/components/stationsRemote.json
  • packages/map/lib/trainRoute.ts
  • packages/map/package.json
  • packages/map/scripts/check-routes.mjs
  • packages/map/scripts/generate-rail-data.mjs
  • packages/map/scripts/generate-stations.mjs
  • packages/map/scripts/rail-helpers.mjs
  • packages/map/styles/globals.css
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant