Context
Two coupled improvements deferred from #145:
1. Double-parse (performance)
When --estimate-optimal-p is used, each log file is currently parsed twice:
- Phase 1 (
profile_aircraft_group()): parses all logs in the aircraft group to extract throttle-punch ratios for the torque-inertia profile.
- Phase 2 (
process_file()): parses the same file again for step-response analysis and optimal-P estimation.
This is a performance issue, not a correctness bug.
2. Remove --estimate-optimal-p flag (UX)
The flag was added conservatively while the feature was experimental. The analysis requires only setpoint[3] (throttle channel), which is present in nearly all Betaflight/EmuFlight logs. Gating on setpoint[3] availability rather than an explicit flag would make the feature automatic when data is present.
The feature label Optimal P (Experimental, log-derived) already signals experimental status to users.
Why these are coupled
Removing the flag means the profiler always runs when step-response output is requested. This makes the double-parse fix essential — without it, every log would be parsed twice unconditionally, which is unacceptable as a default behaviour.
The natural resolution is: unify the two parsing passes so each log is read once, then remove the flag and gate on setpoint[3] availability.
References
Context
Two coupled improvements deferred from #145:
1. Double-parse (performance)
When
--estimate-optimal-pis used, each log file is currently parsed twice:profile_aircraft_group()): parses all logs in the aircraft group to extract throttle-punch ratios for the torque-inertia profile.process_file()): parses the same file again for step-response analysis and optimal-P estimation.This is a performance issue, not a correctness bug.
2. Remove
--estimate-optimal-pflag (UX)The flag was added conservatively while the feature was experimental. The analysis requires only
setpoint[3](throttle channel), which is present in nearly all Betaflight/EmuFlight logs. Gating onsetpoint[3]availability rather than an explicit flag would make the feature automatic when data is present.The feature label
Optimal P (Experimental, log-derived)already signals experimental status to users.Why these are coupled
Removing the flag means the profiler always runs when step-response output is requested. This makes the double-parse fix essential — without it, every log would be parsed twice unconditionally, which is unacceptable as a default behaviour.
The natural resolution is: unify the two parsing passes so each log is read once, then remove the flag and gate on
setpoint[3]availability.References