Skip to content

perf(hooks): session-start-context forks twice to parse one JSON payload #347

Description

@dean0x

Finding

src/assets/scripts/hooks/session-start-context extracts cwd at line 44 and source at line 255 through two separate printf | json_field pipelines, both parsing the same $INPUT payload.

Why deferred

A single two-field extraction would cost nothing extra on the GitHub path and save ~2 forks per session on the jira/linear path, but the fix requires widening json_field's single-field contract — shared plumbing used by every hook — to save two forks on a self-extinguishing non-default path that forks zero times under the default (github) provider. Reviewer's own recommendation: "not recommended given the plumbing cost." Recorded so it is not rediscovered.

Suggested fix

Not recommended as currently scoped. If json_field is ever widened to extract multiple fields in one pass for other reasons, fold this in then.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt items to address

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions