bench: add benchmarks to @stdlib/object/any-own-by#12227
Draft
Planeshifter wants to merge 1 commit into
Draft
Conversation
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.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds a missing benchmark suite to
@stdlib/object/any-own-by, the sole member of the@stdlib/objectnamespace that shipped no benchmarks. The package was surfaced by a cross-package drift sweep over all 26 namespace members.Namespace summary
@stdlib/object— 26 members, none autogenerated.package.jsonshape,README.mdsection list and ordering,manifest.jsonshape, and test/benchmark/example file naming (structural); public signature, return kind, validation prologue, error-construction style, JSDoc shape, and dependency set (semantic).benchmark/benchmark.js(25/26) andlib/main.js(25/26); the seven universal filesREADME.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-keypackage.jsontop-level set (26/26);README.mdsectionsUsage/Examples(26/26),Notes(21/26),See Also(20/26);returnKind=value(24/26);errorConstruction=format(23/26);@examplepresent (26/26).isObject(8) / inlinetypeof(7) /isObjectLike(6), with no value reaching 75%.README.mdsection order showed no divergence.@stdlib/object/any-own-byThe package was the sole outlier in the
@stdlib/objectnamespace lacking abenchmark/directory, which is present in 96% of non-tooling stdlib packages shipping alib/main.jsimplementation. Addedbenchmark/benchmark.jsmodeled on the@stdlib/object/any-in-bysibling, timing the predicate path against anObject.keys+Array#somebaseline and a manual-loop baseline over own enumerable properties. Added the corresponding"benchmark": "./benchmark"entry to thedirectoriesfield inpackage.json, aligning with all 25 namespace siblings that ship benchmarks.Related Issues
No.
Questions
No.
Other
Validation
package.json/README.mdstrings for all 26 members.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.benchmark/benchmark.jsis structurally identical to the validated sibling@stdlib/object/any-in-bybenchmark; 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.@stdlib/objectreturned no hits.Deliberately excluded:
errorConstructionoutlierscommon-keys/common-keys-in(plain-stringvs the namespace'sformatmajority): intentional. Their only thrown error is a placeholder-free static "insufficient arguments" arity message; stdlib-wide, such static messages are thrown as a plainnew Error(23 occurrences) far more often than wrapped informat()(2, both interpolating%u). Normalizing would add a needless dependency without changing behavior.ctor(plain-string, no@stdlib/string/formatdependency): a thin wrapper around the globalObjectconstructor 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 anassignoperation, not drift.assignalso legitimately lackslib/main.jsowing to its builtin/polyfill architecture.README.md## See Alsosections: generator-owned, out of scope.README.md## Notessections (5 packages): a majority exists (21/26), but the fix requires authored, package-specific prose rather than a mechanical change.__stdlib__key unique toctor'spackage.json: removal is not a supported additive correction and the key may be intentional metadata.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
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 addedbenchmark/benchmark.jsis 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