From 4a61f3eb3103aa512bef1b0d82295403bc4bc977 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 27 Aug 2026 19:07:33 +0200 Subject: 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. --- cli/cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/cli.go') diff --git a/cli/cli.go b/cli/cli.go index c71fd9e..672cc34 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -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() { -- cgit v1.3