Skip to content

perf/feat: eliminate double-parse and make optimal-P estimation default (no flag required) #146

@nerdCopter

Description

@nerdCopter

Context

Two coupled improvements deferred from #145:

1. Double-parse (performance)

When --estimate-optimal-p is used, each log file is currently parsed twice:

  1. Phase 1 (profile_aircraft_group()): parses all logs in the aircraft group to extract throttle-punch ratios for the torque-inertia profile.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions