feat: benchmarking harness with shared fixtures for tests and benchmarks#31
Draft
Copilot wants to merge 4 commits into
Draft
feat: benchmarking harness with shared fixtures for tests and benchmarks#31Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Compatibility | 9 medium |
| UnusedCode | 2 medium |
🟢 Metrics 4 complexity · -10 duplication
Metric Results Complexity 4 Duplication -10
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
For each function in the array module:
- Create {function-name}.fixture.ts with representative test data
- Update {function-name}.test.ts to import data from fixture file
- Create {function-name}.bench.ts with Deno.bench benchmarks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: edouardmisset <63284636+edouardmisset@users.noreply.github.com>
…date modules
For each function across 5 modules, create:
- {function-name}.fixture.ts: representative test data exports
- {function-name}.bench.ts: Deno.bench benchmarks using fixture data
Updated test files:
- math/clamp.test.ts: moved top-level variables to clamp.fixture.ts
- math/range.test.ts: moved top-level variables to range.fixture.ts
Modules covered:
- math (16 functions): average-time, average, clamp, divmod, is-valid-number,
normalize, percent, product, random (2 benches), range (4 benches),
round-to-precision, scale, standard-deviation, sum, to-fixed-without-zero,
valid-number-with-fallback
- function (11 functions): debounce, equals, is-empty, is-function, is-valid-json,
memoization, pipe, sleep, throttle, time-it, try-catch
- object (12 functions): invert, is-key, is-not-nested-object, is-object,
is-plain-object, map-object, object-keys, omit, pick, remove-nullish-values,
shallow-equal, size
- text (8 functions): capitalize, levenshtein-distance, remove-accents, slugify,
string-equals (2 benches), string-includes, string-to-boolean, wrap-in-parentheses
- date (13 functions): convert-string-date, datification, first-date-of-month,
is-date-compatible, is-date-in-duration, is-date-in-last-12-months, is-date-in-range,
is-date-in-year, is-valid-date, last-date-of-month, parse-date, sort-by-date,
stringify-date
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: edouardmisset <63284636+edouardmisset@users.noreply.github.com>
…fixture/bench files Agent-Logs-Url: https://github.com/edouardmisset/utils/sessions/502f5806-f89f-4232-8282-fdb3147c8f6b Co-authored-by: edouardmisset <63284636+edouardmisset@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement new design for benchmarking harness in Deno
feat: benchmarking harness with shared fixtures for tests and benchmarks
May 4, 2026
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.
Establishes a shared fixture design so test data is defined once and reused by both unit tests and benchmarks. Each function now has three coordinated files: a fixture, a test (updated to import from it), and a bench.
Structure per function
sort-by.fixture.tssort-by.bench.tsScope
array,date,function,math,object,textdeno.json: addedbenchtask (deno bench [!_]*/**/*.bench.ts)Tooling fixes
docs:linttask updated to exclude*.fixture.tsand*.bench.tsfrom JSDoc lint (fixture exports are data, not public API)_internal-tools/check-exports.tsupdated to skip fixture/bench files when updating barrelmod.tsanddeno.jsonexportsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.deno.land/usr/bin/curl curl -s REDACTED(dns block)/usr/bin/curl curl -s REDACTED bash k/ut�� in-by.fixture.ts(dns block)/usr/bin/curl curl -s REDACTED bash --no�� ange.fixture.ts(dns block)jsr.io/tmp/deno-bin/deno /tmp/deno-bin/deno test --doc --reporter=dot --coverage --parallel _internal-tools/check-exports.ts _internal-tools/check-imports.ts _internal-tools/check-links.ts _internal-tools/check-versions.ts _internal-tools/count-functions.ts _internal-tools/deno-config.ts array/collection-key-by.test.ts array/collection-key-by.ts array/common-elements.test.ts array/common-elements.ts array/count-by.test.ts array/count-by.ts array/filter-by-date.test.ts array/filter-by-date.ts(dns block)./deno ./deno test math/ --reporter=dot /hom�� elect-by.test.ts(dns block)./deno ./deno test math/ --reporter=dot --no-check et-difference.bench.ts(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Please plan and implement this new design
[Chronological Review: The conversation began with the user expressing the need to set up a benchmarking harness for a library using Deno, seeking to utilize Deno's built-in features like Deno.bench and other utilities from the Deno ecosystem. The user then shifted focus to persisting and displaying benchmarking information, indicating a preference for leveraging existing packages rather than building from scratch. The user proposed having representative data fixtures for tests and benchmarks, suggesting a design where each function would have a specific fixture file. The user requested to implement this new design, leading to the current state of the conversation.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: The conversation has established a clear direction for implementing a benchmarking harness using Deno, with a focus on leveraging existing tools and creating a structured approach to data handling.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: - "I wanted to set up a benchmarking harness." - "What about persisting this information (and versioning it)?" - "It would be nice to have the same fixture... for the tests and the benchmarks." - "do it" - "Please plan and implement this new design." - Session Context: The user is developing a benchmarking harness for a library in Deno, focusing on utilizing built-in features and existing packages for persistence and display. - User Intent Evolution: The user transitioned from seeking benchmarking solutions to proposing a structured design for tests and benchmarks, culminating in a request for implementation.- Technical Foundation:
- Deno: The user is using Deno for their library, emphasizing its ecosystem for benchmarking.
- Deno.bench: Identified as the primary tool for benchmarking tasks.
- Fixtures: The user proposed using representative data fixtures for both tests and benchmarks.
- Codebase Status:
- File Name: utils.ts
- Purpose: Central to the user's benchmarking efforts.
- Current State: Awaiting implementation of the new design involving fixtures.
- Key Code Segments: Not specified yet, as the implementation is pending.
- Dependencies: Relates to the overall benchmarking and testing framework being developed.
- Problem Resolution:
- Issues Encountered: None explicitly mentioned; focus has been on design and planning.
- Solutions Implemented: No solutions have been implemented yet; the conversation is in the planning phase.
- Debugging Context: No ongoing troubleshooting efforts mentioned.
- Lessons Learned: The importance of structured data handling for benchmarking and testing.
- Progress Tracking:
- Completed Tasks: Initial discussions on benchmarking and persistence.
- Partially Complete Work: Implementation of the new design for fixtures is pending.
- Validated Outcomes: None yet, as implementation has not begun.
- Active Work State:
- Current Focus: Planning and implementing a new design for benchmarking and testing fixtures.
- Recent Context: The user requested to implement the proposed design for fixtures.
- Working Code: No specific code snippets discussed recently; focus is on design.
- Immediate Context: The user ...
Created from VS Code.