Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performances of batch pathfinding and simulation 🚀 #7995

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

flomonster
Copy link
Contributor

@flomonster flomonster commented Jul 9, 2024

What is done

  • Massive reduction of Redis call
  • Stop handling the expiration time of Redis entries

close #7913

Benchmark

We are testing two endpoints using batch simulation and pathfinding:

  • Simulation summary
  • Project path

Tests are performed with everything cached locally. I'm guessing that the gain will be much greater in prod with network overhead.

Before

  • Simulation summary: 1120ms
  • Project path: 1400ms

image

After

  • Simulation summary: 800ms
  • Project path: 950ms

image

@flomonster flomonster requested a review from a team as a code owner July 9, 2024 17:02
@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 1.02041% with 291 lines in your changes missing coverage. Please review.

Project coverage is 28.07%. Comparing base (9dcf2fc) to head (eb59e07).
Report is 1 commits behind head on dev.

Files Patch % Lines
editoast/src/views/v2/path/pathfinding.rs 0.00% 127 Missing ⚠️
editoast/src/views/v2/train_schedule.rs 0.00% 117 Missing ⚠️
editoast/src/views/v2/timetable/stdcm.rs 0.00% 22 Missing ⚠️
editoast/src/views/v2/timetable.rs 0.00% 10 Missing ⚠️
editoast/src/core/v2/simulation.rs 25.00% 9 Missing ⚠️
editoast/src/redis_utils.rs 0.00% 2 Missing ⚠️
editoast/src/views/v2/path/properties.rs 0.00% 2 Missing ⚠️
editoast/src/views/v2/train_schedule/projection.rs 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #7995      +/-   ##
============================================
- Coverage     28.07%   28.07%   -0.01%     
  Complexity     2075     2075              
============================================
  Files          1289     1288       -1     
  Lines        157734   157708      -26     
  Branches       3121     3121              
============================================
- Hits          44285    44273      -12     
+ Misses       111572   111558      -14     
  Partials       1877     1877              
Flag Coverage Δ
core 75.03% <ø> (ø)
editoast 70.87% <1.02%> (+0.02%) ⬆️
front 9.94% <ø> (ø)
gateway 2.34% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 72.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flomonster flomonster force-pushed the fam/improve-perf-timetable branch 2 times, most recently from f4aee29 to 2023c50 Compare July 11, 2024 11:11
Copy link
Contributor

@woshilapin woshilapin left a comment

Choose a reason for hiding this comment

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

Nice improvement

editoast/src/redis_utils.rs Show resolved Hide resolved
editoast/src/views/v2/path/pathfinding.rs Outdated Show resolved Hide resolved
flomonster and others added 2 commits July 11, 2024 13:22
- Massive reduction of Redis call
- Stop handling expiration time of redis entries
@flomonster flomonster merged commit 5a3df3c into dev Jul 11, 2024
17 checks passed
@flomonster flomonster deleted the fam/improve-perf-timetable branch July 11, 2024 11:36
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.

gateway: timeout on a timetable with 1410 trains
5 participants