Files
Baradb/baradadb.nimble
T
dimgigov 965ed2f675
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
perf: optimize FTS and HNSW engines + real PostgreSQL benchmarks
FTS Engine (src/barabadb/fts/engine.nim):
- Fix bm25Score doing O(n) linear scan per document
- Cache IDF per token instead of recomputing for each doc
- Use entry.termFreq directly instead of searching postings again
- Result: FTS search +438% (249 -> 1360 queries/s)

HNSW Vector Engine (src/barabadb/vector/engine.nim):
- Optimize distance functions with float32 + 4x loop unrolling
- Rewrite searchLayer: swap+pop instead of O(n) del, track worst-nearest
  instead of sorting nearest on every iteration
- Result: HNSW insert +117% (245 -> 543 ops/s), search 2.2x faster

Benchmarks:
- Add real PostgreSQL comparison script (benchmarks/pg_bench.py)
- Add report generator (benchmarks/generate_report.py)
- Fix compare.nim cpuTime() bug (was dividing by 1M incorrectly)
- Add nimble tasks: bench_pg, bench_report

Docs:
- Update README.md and docs/en/performance.md with real measured numbers
- Add benchmarks/REAL_COMPARISON.md

Version bump: 1.1.7 -> 1.1.8
2026-05-29 17:11:22 +03:00

36 lines
1.2 KiB
Nim

# Package
version = "1.1.8"
author = "BaraDB Team"
description = "BaraDB — Multimodal database written in Nim"
license = "Apache-2.0"
srcDir = "src"
bin = @["baradadb", "baramcp"]
binDir = "build"
# Dependencies
requires "nim >= 2.2.0"
requires "https://github.com/katehonz/hunos >= 1.3.0"
requires "https://github.com/katehonz/jwt-nim-baraba#fbe084b" # v2.1.2 - security fixes & Nim 2.2 compat
requires "checksums >= 0.2.0"
# Tasks
task build_debug, "Build debug version":
exec "nim c --debugger:native --linedir:on -o:build/baradadb src/baradadb.nim"
exec "nim c --debugger:native --linedir:on -o:build/baramcp src/baramcp.nim"
task build_release, "Build release version":
exec "nim c -d:release --opt:speed -o:build/baradadb src/baradadb.nim"
exec "nim c -d:release --opt:speed -o:build/baramcp src/baramcp.nim"
task test, "Run all tests":
exec "nim c -r tests/test_all.nim"
task bench, "Run benchmarks":
exec "nim c -d:release -r benchmarks/bench_all.nim"
task bench_pg, "Run PostgreSQL comparison benchmarks":
exec "python3 benchmarks/pg_bench.py"
task bench_report, "Generate benchmark comparison report":
exec "python3 benchmarks/generate_report.py"