Skip to content

Conversation

@Uzlopak
Copy link
Collaborator

@Uzlopak Uzlopak commented Nov 8, 2025

fixes #176

It is actually quite annoying to implement this without trying to start implementing stuff like useragent parsing. So the focus is nodejs.
I am not happy with some of the names.
Still need some input on how to show this information.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 8, 2025

Open in StackBlitz

npm i https://pkg.pr.new/tinylibs/tinybench@412

commit: d8ba4c3

@github-actions
Copy link

github-actions bot commented Nov 8, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/index.js 9.71 KB (0%) 195 ms (0%) 20 ms (+193.73% 🔺) 214 ms

@Uzlopak Uzlopak marked this pull request as draft November 8, 2025 02:57
@Uzlopak Uzlopak requested a review from Copilot November 8, 2025 02:57

This comment was marked as duplicate.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

: () => 'unknown',
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-deprecated
platform: typeof g.navigator?.platform === 'string'
? () => normalizeMachine(g.navigator.platform.split(' ')[0]) // eslint-disable-line @typescript-eslint/no-deprecated
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform function should call normalizeOSType() instead of normalizeMachine() since it's meant to return the OS type, not the machine architecture.

Copilot uses AI. Check for mistakes.
| 'arm64'
| 'arm'
| 'i686'
| 'ia32'
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The Machine type includes 'ia32' but the normalization logic maps 'ia32' to 'x32'. Consider whether 'ia32' should be in the union type if it's always normalized to 'x32'.

Suggested change
| 'ia32'

Copilot uses AI. Check for mistakes.
Comment on lines +233 to +235
| 's390x'
| 'x86_64')

Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The Machine type includes 'x86_64' but the normalization logic maps it to 'x64'. Consider whether 'x86_64' should be in the union type if it's always normalized to 'x64'.

Suggested change
| 's390x'
| 'x86_64')
| 's390x')

Copilot uses AI. Check for mistakes.
memoryFree: number;
memoryTotal: number;
osType: OS;
runtime: Omit<JSRuntime, 'browser' | 'bun' | 'deno' | 'node'>;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Omit excludes all known runtime values ('browser', 'bun', 'deno', 'node'), which would result in never. This makes PlatformMetricsBase unusable since the runtime field would have no valid values.

Suggested change
runtime: Omit<JSRuntime, 'browser' | 'bun' | 'deno' | 'node'>;
runtime: JSRuntime;

Copilot uses AI. Check for mistakes.
| 'i686'
| 'ia32'
| 'loong64'
| 'mips64'
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The Machine type includes 'mips64' but there's no corresponding entry in the test file test/platform-normalize-arch.test.ts (which tests 'mips' and 'mipsel'). Consider adding test coverage for 'mips64' if it's a supported architecture.

Copilot uses AI. Check for mistakes.
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.

Feature: add OS and hardware information to benchmark result when possible

2 participants