Skip to content

bench: add benchmarks to @stdlib/object/any-own-by#12227

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/drift-object-2026-05-21
Draft

bench: add benchmarks to @stdlib/object/any-own-by#12227
Planeshifter wants to merge 1 commit into
developfrom
philipp/drift-object-2026-05-21

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request adds a missing benchmark suite to @stdlib/object/any-own-by, the sole member of the @stdlib/object namespace that shipped no benchmarks. The package was surfaced by a cross-package drift sweep over all 26 namespace members.

Namespace summary

  • Namespace: @stdlib/object — 26 members, none autogenerated.
  • Features analyzed: file tree, package.json shape, README.md section list and ordering, manifest.json shape, and test/benchmark/example file naming (structural); public signature, return kind, validation prologue, error-construction style, JSDoc shape, and dependency set (semantic).
  • Features with a clear majority (≥75%): presence of benchmark/benchmark.js (25/26) and lib/main.js (25/26); the seven universal files README.md, docs/repl.txt, docs/types/index.d.ts, docs/types/test.ts, examples/index.js, lib/index.js, test/test.js (26/26); the 18-key package.json top-level set (26/26); README.md sections Usage/Examples (26/26), Notes (21/26), See Also (20/26); returnKind = value (24/26); errorConstruction = format (23/26); @example present (26/26).
  • Features without a clear majority (excluded): public signature and validation prologue — genuinely heterogeneous across packages; the first-argument check alone splits isObject (8) / inline typeof (7) / isObjectLike (6), with no value reaching 75%. README.md section order showed no divergence.

@stdlib/object/any-own-by

The package was the sole outlier in the @stdlib/object namespace lacking a benchmark/ directory, which is present in 96% of non-tooling stdlib packages shipping a lib/main.js implementation. Added benchmark/benchmark.js modeled on the @stdlib/object/any-in-by sibling, timing the predicate path against an Object.keys + Array#some baseline and a manual-loop baseline over own enumerable properties. Added the corresponding "benchmark": "./benchmark" entry to the directories field in package.json, aligning with all 25 namespace siblings that ship benchmarks.

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.

Validation

  • Structural features were extracted from the filesystem and from package.json/README.md strings for all 26 members.
  • Semantic features (signature, return kind, validation prologue, error construction, JSDoc shape, dependencies) were extracted by one agent per package.
  • The single surviving outlier was put through three-agent drift validation (opus semantic-review, opus cross-reference, sonnet structural-review); all returned confirmed-drift. Cross-reference confirmed that no test or example references a benchmark, so adding the file changes nothing in the test/example/API surface.
  • The new benchmark/benchmark.js is structurally identical to the validated sibling @stdlib/object/any-in-by benchmark; the predicate logic was exercised directly. The full benchmark harness could not be run in the build environment because an external dependency (debug) is not installed — this affects every benchmark in the repository equally, including the existing sibling benchmarks.
  • Open-PR collision and 14-day cross-run dedup checks against @stdlib/object returned no hits.

Deliberately excluded:

  • errorConstruction outliers common-keys / common-keys-in (plain-string vs the namespace's format majority): intentional. Their only thrown error is a placeholder-free static "insufficient arguments" arity message; stdlib-wide, such static messages are thrown as a plain new Error (23 occurrences) far more often than wrapped in format() (2, both interpolating %u). Normalizing would add a needless dependency without changing behavior.
  • ctor (plain-string, no @stdlib/string/format dependency): a thin wrapper around the global Object constructor that throws nothing — there is no error path to normalize.
  • assign / assign-in (returnKind = mutates-arg): mutate-and-return-the-target is the defining, documented contract of an assign operation, not drift. assign also legitimately lacks lib/main.js owing to its builtin/polyfill architecture.
  • README.md ## See Also sections: generator-owned, out of scope.
  • Missing README.md ## Notes sections (5 packages): a majority exists (21/26), but the fix requires authored, package-specific prose rather than a mechanical change.
  • The __stdlib__ key unique to ctor's package.json: removal is not a supported additive correction and the key may be intentional metadata.

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

This PR was produced by an automated cross-package API drift sweep run by Claude Code. Structural and semantic features were extracted from all 26 members of @stdlib/object, the per-feature majority pattern was computed at a 75% threshold, and the single surviving outlier was validated by three independent review agents before any file was created. The added benchmark/benchmark.js is modeled on the validated sibling @stdlib/object/any-in-by; no behavior, signatures, or test expectations changed. A maintainer should audit the change before promoting this PR from draft.


@stdlib-js/reviewers


Generated by Claude Code

Added missing benchmark/benchmark.js (a benchmark suite is present in
25/26 = 96% of @stdlib/object siblings, and some benchmark directory is
present in 96.5% of non-tooling stdlib packages that ship a lib/main.js
implementation; any-own-by was the sole namespace member with no
benchmark directory). Registered the directory in package.json
`directories` ("benchmark": "./benchmark"; present in 25/25 of the
siblings that ship benchmarks).

The benchmark mirrors the sibling `@stdlib/object/any-in-by`,
exercising the predicate path against built-in and manual-loop
baselines over own enumerable properties. No public behavior,
signatures, or test expectations change.
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
object/any-own-by $\color{green}123/123$
$\color{green}+100.00%$
$\color{green}10/10$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}123/123$
$\color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

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