Add benchmark tests and optimize database performance
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled

- Introduced benchmark tests for various database operations, including event saving, querying, and fetching by serials, to assess performance.
- Implemented optimizations to reduce memory allocations and improve efficiency by pre-allocating slices and maps in critical functions.
- Enhanced the `FetchEventsBySerials`, `GetFullIdPubkeyBySerials`, and `QueryForIds` methods with pre-allocation strategies to minimize reallocations.
- Documented performance improvements in the new PERFORMANCE_REPORT.md file, highlighting significant reductions in execution time and memory usage.
- Bumped version to v0.23.1 to reflect these changes.
This commit is contained in:
2025-11-02 18:19:52 +00:00
parent d7ea462642
commit 8d131b6137
10 changed files with 513 additions and 25 deletions

View File

@@ -17,6 +17,8 @@ import (
func (d *D) GetFullIdPubkeyBySerials(sers []*types.Uint40) (
fidpks []*store.IdPkTs, err error,
) {
// Pre-allocate slice with exact capacity to reduce reallocations
fidpks = make([]*store.IdPkTs, 0, len(sers))
if len(sers) == 0 {
return
}