Conversation
Two related changes that propagate the etape 4 parallelization beyond the tests and keep the perf measurements clean: - Tracker : the per-iteration loop now uses trackUserLocationAsync with CompletableFuture.allOf().join() instead of a sequential forEach over trackUserLocation. The Tracker, which actualises the location of all registered users every five minutes, now benefits directly from the TourGuideService thread pool. This makes the parallelization useful in real-world production scenarios (Tracker running with many users), not only in the performance tests. - TestPerformance : each high-volume test now calls tourGuideService.tracker.stopTracking() immediately after creating the TourGuideService, before starting the measurement. This isolates the performance measurement from the background Tracker, which would otherwise contend for the same TourGuideService pool concurrently (causing measured times to roughly double without changing the underlying performance of the tested operation). After isolation, measured times return to the values reported in the documentation (highVolumeTrackLocation around 3m19, highVolumeGetRewards around 1m43 on the reference machine). Refs: OpenClassrooms Projet 8 - etape 4 extension (amelioration des performances reelles du Tracker).
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.
Cette PR complète l'étape 4 en propageant la parallélisation introduite pour les tests
à la boucle interne du Tracker, le composant qui actualise périodiquement la position de tous les utilisateurs enregistrés en arrière-plan.
Deux modifications :
pipeline stream + CompletableFuture.allOf.join sur trackUserLocationAsync. Le Tracker bénéficie maintenant directement du pool TourGuideService et peut absorber des volumes d'utilisateurs croissants en production sans dégradation, conformément à la conception pensée pour les tests de performance.
TourGuideService, pour isoler la mesure de performance de la contention que produirait un Tracker actif en parallèle sur le même pool. Sans cette isolation, le temps mesuré serait approximativement doublé pour highVolumeTrackLocation, sans changement réel de la performance de l'opération testée.
Après ces changements, la suite de tests complète passe en environ 5 minutes 23 secondes en local, et les seuils fixés restent largement respectés (highVolumeTrackLocation en 3 min 19, highVolumeGetRewards en 1 min 43).