Skip to content

Add and modernize Go hot-path benchmarks#100

Open
Uzer007-admin wants to merge 1 commit into
Restream:masterfrom
Uzer007-admin:go-hot-path-benchmarks-pr
Open

Add and modernize Go hot-path benchmarks#100
Uzer007-admin wants to merge 1 commit into
Restream:masterfrom
Uzer007-admin:go-hot-path-benchmarks-pr

Conversation

@Uzer007-admin

Copy link
Copy Markdown
Contributor

Summary

This PR expands and modernizes the Go benchmark coverage for Reindexer hot paths.

All changes are limited to benchmark files and do not modify the production API or runtime behavior.

Changes

  • Migrate existing benchmarks from manual b.N loops to b.Loop().
  • Add CJSON base64 benchmarks covering:
    • encoding and decoding payloads from 0 to 4096 bytes;
    • encoding and decoding a small real-world-shaped payload set;
    • payload size distribution, base64 padding classes, and size buckets.
  • Add Serializer.PutValue microbenchmarks for:
    • integers;
    • strings;
    • slices.
  • Add WhereExpressions query builder benchmarks for:
    • Field/Values;
    • FlatArrayLen/Now;
    • comparison with the legacy slice-based function serialization path.
  • Modernize RPC encoder/decoder, network buffer, and serializer benchmarks.
  • Modernize end-to-end Reindexer benchmarks for inserts, updates, deletes, CJSON, JSON, and Gob.
  • Remove redundant ResetTimer calls where timing is already managed by b.Loop.
  • Bound buffer growth in the writeIntBits benchmark to avoid allocations proportional to b.N.
  • Make the delete/update ID range independent of the framework-selected b.N.
  • Preserve commit-phase measurement in transaction benchmarks.

Scope

All changes are contained in _test.go benchmark files. There are no production code, public API, or runtime behavior changes.

}
}

func legacyWhereExpressionsFunctions(q *Query, left legacyFlatArrayLen, condition int, right legacyNow) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do not think, that all those 'legacy' things should be in our benchmarks set. This measurements may be relevant for the specific PR, but not as a part of regular codebase

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.

2 participants