Skip to content

bench: add benchmark to utils/async/series-waterfall#13046

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/drift-utils-async-2026-06-22
Draft

bench: add benchmark to utils/async/series-waterfall#13046
Planeshifter wants to merge 1 commit into
developfrom
philipp/drift-utils-async-2026-06-22

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

Adds the missing benchmark/benchmark.js and matching directories.benchmark package.json entry to @stdlib/utils/async/series-waterfall, bringing it in line with the structural convention of its sibling packages.

Namespace summary

  • Namespace: @stdlib/utils/async
  • Members analyzed: 33 non-generated packages
  • Features with a clear majority (>=75% conformance): README.md presence, package.json presence + top-level key set, lib/index.js + lib/main.js presence, test/test.js presence, docs/repl.txt + docs/types/{index.d.ts,test.ts} presence, examples/index.js presence, benchmark/benchmark.js presence (32/33 — 97%), directories.benchmark key in package.json (32/33 — 97%), @example JSDoc tag in lib/main.js (33/33 — 100%).
  • Features without a clear majority (excluded): lib/factory.js / lib/limit.js / lib/validate.js / test/test.factory.js / test/test.validate.js / benchmark/benchmark.factory.js presence — these split along an "iterator-with-options" (~22) vs "control-flow primitive" (~10) archetype boundary, with neither side reaching 75%. Per-package publicSignature and validationPrologue were excluded for the same reason.

Per outlier package

@stdlib/utils/async/series-waterfall

@stdlib/utils/async/series-waterfall was the only package in the 33-member @stdlib/utils/async namespace missing benchmark/benchmark.js and the corresponding directories.benchmark entry in package.json. The added benchmark drives the waterfall through a three-function async sequence (foo -> bar -> fun), matching the convention established by function-sequence/benchmark/benchmark.js and parallel/benchmark/benchmark.js. Purely additive fixture and metadata; no lib, public API, or test changes.

Validation

Checked:

  • Structural extraction over all 33 namespace members (file-tree presence, package.json shape, README section headings).
  • Bulk semantic extraction over lib/main.js, lib/validate.js, and lib/index.js (validation-prologue predicates, format()-vs-plain Error construction, @example tag counts, top-level export shape).
  • Three-agent review of the outlier and the proposed fix (cross-reference, structural-review, semantic-review).

Deliberately excluded:

  • The ## See Also README section is missing from parallel and series-waterfall; dropped because it is generator-populated and not safe to edit manually.
  • The compose and function-sequence throw new Error('insufficient arguments...') calls — intentional, since format() adds nothing without a placeholder.
  • The parallel/lib/validate.js lack of a series option — semantically required (parallel cannot be serial), not drift.
  • A cosmetic preallocated-array vs push() split inside the next() callbacks of several control-flow primitives — no 75% majority either way.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

The added benchmark was syntax-checked with node --check; an end-to-end node benchmark/benchmark.js run was not possible in the development environment because the local node_modules/ (debug, transitively required by @stdlib/bench) is not installed, but the file is a near-mechanical adaptation of the established sibling pattern.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance.

This PR was authored by Claude Code as part of a cross-package drift-detection routine: the @stdlib/utils/async namespace was scanned for structural and semantic features, the majority pattern (>=75% conformance) was computed per feature, outliers were flagged, and the surviving correction was applied to bring series-waterfall into line with its 32 siblings. The proposed fix was validated by three independent agents (one cross-reference, one structural-review, one semantic-review) before being committed.


Generated by Claude Code

Adds a missing `benchmark/benchmark.js` (present in 32/33 sibling
packages — 97% conformance) and the corresponding
`directories.benchmark` entry in `package.json` (also 32/33). Modeled
after the sibling pattern used in `function-sequence` and `parallel`,
exercising the waterfall through a fixed-length sequence of async
callbacks.
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

No coverage information available.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants