Skip to content

add new subtypes, detailed benchmarks#91

Closed
gokutheengineer wants to merge 4 commits intobsv-blockchain:masterfrom
gokutheengineer:gokhan/cockroachdb-swiss-map
Closed

add new subtypes, detailed benchmarks#91
gokutheengineer wants to merge 4 commits intobsv-blockchain:masterfrom
gokutheengineer:gokhan/cockroachdb-swiss-map

Conversation

@gokutheengineer
Copy link
Copy Markdown
Contributor

@gokutheengineer gokutheengineer commented Feb 23, 2026

This pull request introduces comprehensive benchmarking and memory profiling for various hash map implementations used in the project, comparing dolthub, cockroachdb, Go's native map, and tidwall. It also adds the necessary dependencies for benchmarking, and includes a minor thread-safety improvement. The results are summarized in a new markdown report and detailed output files, providing actionable recommendations for map selection based on performance and memory usage.

Benchmarking and Analysis

  • Added a detailed benchmark report (BENCHMARK_REPORT.md) comparing four hash map implementations across Put, Get, Exists, Delete operations, and memory footprint. The report includes recommendations and key takeaways for map selection.
  • Added benchmark result files for Put, Get, Exists, Delete operations, and memory footprint for all map types and implementations (res_put_ops.txt, res_get_ops.txt, res_exists_ops.txt, res_del_ops.txt, res_memory_footprint.txt). [1] [2] [3] [4] [5]

Dependency Management

  • Updated go.mod to add indirect dependencies for benchmarking and alternative map implementations: cockroachdb/swiss, klauspost/cpuid/v2, tidwall/hashmap, and zeebo/xxh3.

Thread Safety Improvement

  • Changed SwissMapUint64.Exists method to use a read lock (RLock) instead of a write lock (Lock), improving concurrency for read operations.

Miscellaneous

  • Removed the package declaration from tx_map_examples_test.go, likely as a cleanup or to avoid conflicts in test files.

These changes provide valuable insights into the trade-offs between speed and memory usage for different map implementations, and improve the thread safety of the codebase.

@github-actions github-actions bot added fork-pr PR originated from a forked repository requires-manual-review PR or issue requires manual review by a maintainer or security team labels Feb 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks, @gokutheengineer!

This pull request comes from a fork. For security, our CI runs in a restricted mode.
A maintainer will triage this shortly and run any additional checks as needed.

  • 🏷️ Labeled: fork-pr, requires-manual-review
  • 👀 We'll review and follow up here if anything else is needed.

Thanks for contributing to bsv-blockchain/go-tx-map! 🚀

@mrz1836 mrz1836 requested a review from galt-tr February 23, 2026 19:50
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@mrz1836 mrz1836 requested a review from icellan February 24, 2026 17:58
@mrz1836 mrz1836 added the feature Any new significant addition label Feb 25, 2026
Copy link
Copy Markdown
Collaborator

@mrz1836 mrz1836 left a comment

Choose a reason for hiding this comment

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

Linter and pre-commit issues. Please review the CI errors. @gokutheengineer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Any new significant addition fork-pr PR originated from a forked repository requires-manual-review PR or issue requires manual review by a maintainer or security team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants