Skip to content

Conversation

@cjakeman
Copy link
Contributor

@cjakeman cjakeman commented Aug 18, 2024

SD files are short and simple, but the overhead of testing for them and reading them more than once is excessive. More than half of the file accesses at start are due to SD files for:

  • 2176/4178 Demo Model 1 - Queens Street
  • 1481/1844 BNSF Scenic Sub - Eastbound
  • 2345/2873 Portugal 79 - Linha do Algarve

This PR adds a simple cache.

See https://trello.com/c/8hcG5645/595-cache-sd-files-for-faster-loading

twpol pushed a commit that referenced this pull request Aug 18, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #954 at 3efaf6d: Multiple Track Profiles & Superelevation Improvements
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #976 at 877cc94:  Increased center of gravity range
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at 6c1eb75: adds cache for SD files
- Pull request #900 at c27f32d: DMI updates
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 19, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #954 at 3efaf6d: Multiple Track Profiles & Superelevation Improvements
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #976 at 877cc94:  Increased center of gravity range
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at 6c1eb75: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
Copy link
Contributor

@SteelFill SteelFill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is causing unhandled crashes every time an SD file is missing, which was previously not a problem.

@cjakeman cjakeman added the not-for-unstable Special label to exclude a pull request from the Unstable Version label Aug 19, 2024
@cjakeman
Copy link
Contributor Author

Thanks, Phillip,

The change is causing unhandled crashes every time an SD file is missing, which was previously not a problem.

I've marked it as not-for-unstable until I've fixed it.

@cjakeman cjakeman removed the not-for-unstable Special label to exclude a pull request from the Unstable Version label Aug 20, 2024
twpol pushed a commit that referenced this pull request Aug 20, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #954 at 3efaf6d: Multiple Track Profiles & Superelevation Improvements
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #976 at 877cc94:  Increased center of gravity range
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 22, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #954 at 588a3c2: Multiple Track Profiles & Superelevation Improvements
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #976 at 877cc94:  Increased center of gravity range
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 22, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #976 at 877cc94:  Increased center of gravity range
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 588a3c2: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 23, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #976 at 877cc94:  Increased center of gravity range
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 8b2d4ca: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
@cjakeman cjakeman requested a review from SteelFill August 23, 2024 08:20
twpol pushed a commit that referenced this pull request Aug 26, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #903 at 4a4b032: Downloading route content (Github, zip)
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 3caecc7: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 26, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #903 at 408cb1d: Downloading route content (Github, zip)
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 3caecc7: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 27, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #903 at 408cb1d: Downloading route content (Github, zip)
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 53e9cc6: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 27, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #903 at 25cc886: Downloading route content (Github, zip)
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #922 at a3bc9e7: Autopilot for timetable mode
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 53e9cc6: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 27, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #903 at 25cc886: Downloading route content (Github, zip)
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 53e9cc6: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
twpol pushed a commit that referenced this pull request Aug 27, 2024
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value
- Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #882 at 8f695a4: Blueprint/train car operations UI window
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #954 at 53e9cc6: Multiple Track Profiles & Superelevation Improvements
- Pull request #962 at 46d0472: Fix pantographs on unpowered cars
- Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage
- Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects
- Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains
- Pull request #977 at a30c659: adds cache for SD files
- Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual
- Pull request #900 at c27f32d: DMI updates
- Pull request #799 at dfc715e: Consolidated wind simulation
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #952 at 8347095: Investigation - Pulsing graphics
Copy link
Contributor

@SteelFill SteelFill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not causing trouble anymore, no adverse effects on the random routes I tried. Haven't benchmarked anything so I don't know how significant any performance changes are (big routes still take long to load, short routes don't) but it does appear to be a bit quicker loading now. Nevertheless, the process makes sense and caching the SD files is a good idea.

@cjakeman cjakeman merged commit 2250203 into openrails:master Aug 28, 2024
@twpol twpol added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

3 participants