isPiMessageEntry allocates two array literals per call; recovery parses each timestamp three to four times

Open
#2,016 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
performance

Research direction

Read packages/pi-extension/index.js at lines 213–218, then backfill.js at line 129 and projector.js at lines 14 and 112. The issue says this cleanup is deferred until those files are edited for a substantive reason, so do not start it as standalone work without explicit delegation. If delegated, done means hoisting the two array literals and parsing each timestamp once.

Written by the indexing model from the issue text.

Description

Source: #1874 at 5ab56bcaa3e41a8fcb6a095eb83e9b6d76c3f38e
Location: packages/pi-extension/index.js:213-218
Severity: minor

Evidence

The classifier allocates two array literals per call (index.js:215 and :218), and recovery parses each entry timestamp repeatedly (backfill.js:129 Date.parse, projector.js iso() at :14 and :112). Measured in round 2: 148 ns/call as shipped, 126 ns with hoisted literals, about 15 ms once per 100,000-entry resume, and about 100 ms of redundancy per full 256 MiB sweep against the JSON.parse that dominates it.

Why deferral is safe

Measured immaterial at every bound the code enforces, and AGENTS.md directs not to land adjacent cleanups; per project guidance a measured-immaterial CPU nit is a preference, not a defect. Confirmed unchanged at head 5ab56bca.

Acceptance condition

Hoist the two literals to module constants and parse each timestamp once next time these files are edited for a substantive reason.

Review preference; backlog only. A human may explicitly delegate it with neutral:fix.

Dominant language
JavaScript
Stars
11
Forks
0
Avg merge
2h 49m
Merged PRs (30d)
297

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyparam/hypaware

All issues in hyparam/hypaware

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.