Skip to content

Comments

test: add benchmarks#26

Merged
antongolub merged 1 commit intomainfrom
bench
Sep 28, 2025
Merged

test: add benchmarks#26
antongolub merged 1 commit intomainfrom
bench

Conversation

@antongolub
Copy link
Member

@antongolub antongolub commented Sep 28, 2025

closes #16

@antongolub antongolub added infra CICD test QA & tests improvements labels Sep 28, 2025
@antongolub antongolub requested a review from Copilot September 28, 2025 11:44
Copy link

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

This pull request adds benchmarking capabilities to compare the performance of the IP address library against other popular alternatives in the ecosystem. The changes include performance optimizations to the IPv4 validation logic and the addition of comprehensive benchmarking infrastructure.

  • Optimizes IPv4 format validation using regex for better performance
  • Adds benchmarking infrastructure to compare against other IP libraries
  • Includes comprehensive performance test scripts and documentation

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/ts/core.ts Optimizes IPv4 validation with regex pattern matching
target/esm/core.mjs Compiled output with IPv4 validation optimization
target/cjs/core.cjs Compiled output with IPv4 validation optimization
src/test/bench/stand/index.ts Adds benchmarking test suite comparing multiple IP libraries
src/scripts/build-bench-md.ts New script to generate performance comparison documentation
src/scripts/build-coherence-md.ts Updates coherence testing to export suites for benchmarking
src/test/js/export.test.js Adds test for normalizeToLong function export
package.json Adds browser export field and benchmark build scripts
README.md Updates documentation to reference benchmark results
COHERENCE.md Updated coherence comparison with new library entry
BENCHMARK.md New performance comparison documentation
.size-limit.json Updates size limits to accommodate new code
.github/workflows/ci.yaml Re-enables release workflow

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


export const isV4Format: Checker = (addr: string): boolean=> {
return isIPv4Candidate(addr) && Address.normalizeToLong(addr, true) !== -1
return addr.length <= IPV4_LEN_LIM && IPV4_RE.test(addr)
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

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

The variable IPV4_LEN_LIM is referenced but not defined in the visible context. This will cause a runtime error if the constant is not properly defined elsewhere in the file.

Copilot uses AI. Check for mistakes.
@antongolub antongolub merged commit 77c369c into main Sep 28, 2025
21 checks passed
@antongolub antongolub deleted the bench branch September 28, 2025 11:47
@antongolub antongolub mentioned this pull request Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra CICD test QA & tests improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add benchmarks

1 participant