Skip to content

Conversation

@mrz1836
Copy link
Collaborator

@mrz1836 mrz1836 commented Jul 2, 2025

What Changed

  • add benchmarks for constructors and utility
  • update benchmark table in README with results

Why It Was Necessary

  • measure performance of map constructors and Bytes2Uint16Buckets

Testing Performed

  • go fmt ./...
  • goimports -w .
  • golangci-lint run
  • go vet ./...
  • go test ./...
  • make run-fuzz-tests
  • make govulncheck (fails: detected standard library vulnerability)
  • go test -bench=. -benchmem

Impact / Risk

  • no breaking changes
  • adds benchmark functions only

https://chatgpt.com/codex/tasks/task_e_68649904ab008321b9e9baf2e5b14f54

@mrz1836 mrz1836 requested a review from icellan as a code owner July 2, 2025 02:39
@github-actions github-actions bot added the feature Any new significant addition label Jul 2, 2025
@mrz1836 mrz1836 assigned mrz1836 and unassigned icellan Jul 2, 2025
@mrz1836 mrz1836 added the test Unit tests, mocking, integration testing label Jul 2, 2025
@mrz1836 mrz1836 requested a review from Copilot July 2, 2025 02:40
@codecov
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

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

Introduces benchmarks for a byte‐to‐bucket utility and various map constructors, and updates the README’s benchmark table with the new results.

  • Adds BenchmarkBytes2Uint16Buckets for the bucket conversion utility.
  • Adds constructor benchmarks for SplitSwiss* and Swiss* map types.
  • Updates the README table to include the new benchmark results.

Reviewed Changes

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

File Description
tx_map_benchmarks_test.go Added benchmarks for Bytes2Uint16Buckets and multiple map constructors
README.md Updated the benchmark table with new entries and results
Comments suppressed due to low confidence (2)

tx_map_benchmarks_test.go:10

  • While you’ve added a benchmark for Bytes2Uint16Buckets, consider adding a unit test to verify its functional correctness and guard against future regressions.
// BenchmarkBytes2Uint16Buckets measures the performance of Bytes2Uint16Buckets.

tx_map_benchmarks_test.go:18

  • The call to Bytes2Uint16Buckets passes a chainhash.Hash array instead of a byte slice; use hash[:] to convert the array to a slice (e.g., Bytes2Uint16Buckets(hash[:], 1024)).
		_ = Bytes2Uint16Buckets(hash, 1024)

@mrz1836 mrz1836 merged commit df26b24 into master Jul 2, 2025
11 of 13 checks passed
@github-actions github-actions bot deleted the feat/add-benchmark-functions-for-new-map-types branch July 2, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Any new significant addition test Unit tests, mocking, integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants