diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 19:07:33 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 19:07:33 +0200 |
| commit | 4a61f3eb3103aa512bef1b0d82295403bc4bc977 (patch) | |
| tree | 73eb78c50518f129d5e6aaa86153a1b4c4637bf5 /cli/cli.go | |
| parent | d7b93325d4f70eeab369fa8a3c4cce9f0c4e0081 (diff) | |
Swap ride read path from GPX to FIT for performance
Always use FIT for detail, official climb creation and backtest;
keep GPX fallback for legacy rides pending backfill. FIT is 10-20x
smaller and parses without XML.
Diffstat (limited to 'cli/cli.go')
| -rw-r--r-- | cli/cli.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -145,12 +145,12 @@ func runBacktest(db *sql.DB) error { if !isBacktestEligible(item) { continue } - parsed, err := ride.ParseFile(ride.GPXRideParser{}, item.GPXPath) + parsed, err := ride.ParseFile(ride.FITRideParser{}, item.FitPath) if err != nil { if errors.Is(err, ride.ErrNoTrackPoints) { continue } - slog.Warn("Failed to parse ride GPX", "ride", item.ExternalID, "file", item.GPXPath, "error", err) + slog.Warn("Failed to parse ride FIT", "ride", item.ExternalID, "file", item.FitPath, "error", err) continue } reference := time.Duration(item.ExternalMovingTimeS) * time.Second @@ -164,7 +164,7 @@ func runBacktest(db *sql.DB) error { }) } if len(samples) == 0 { - slog.Info("No rides with GPX to backtest", "rides", len(items)) + slog.Info("No rides with FIT to backtest", "rides", len(items)) return nil } sort.Slice(samples, func(i, j int) bool { @@ -195,7 +195,7 @@ func runBacktest(db *sql.DB) error { } func isBacktestEligible(item ride.StoredRide) bool { - if item.GPXPath == "" || item.ExternalMovingTimeS <= 0 || item.ElapsedTimeS <= 0 { + if item.FitPath == "" || item.ExternalMovingTimeS <= 0 || item.ElapsedTimeS <= 0 { return false } if !item.IsCategorised() { |
