Benchmarking Performance

1. Setting Up Benchmark Environment

SettingDetail
Same region as clientEliminate network latency variance
Warm indexRun 100 warmup queries
Production-like dataRealistic dim + filter cardinality

2. Measuring Query Latency

Example: Latency Bench

import time, statistics

times = []
for qv in queries:
    t = time.perf_counter()
    index.query(vector=qv, top_k=10)
    times.append((time.perf_counter() - t) * 1000)

print("p50", statistics.median(times))
print("p95", statistics.quantiles(times, n=20)[18])
print("p99", statistics.quantiles(times, n=100)[98])

3. Measuring Upsert Throughput

Example: Throughput

t = time.perf_counter()
total = 0
for b in batches:
    index.upsert(vectors=b)
    total += len(b)
elapsed = time.perf_counter() - t
print(f"{total/elapsed:.0f} vectors/sec")

4. Benchmarking Different Pod Types

PodTypical QPSTypical p95
s1.x1~5050-80ms
p1.x1~10020-40ms
p2.x1~20010-20ms
Note: Numbers are illustrative; benchmark with your own data.

5. Comparing Serverless vs Pod-Based

Serverless

  • Variable latency; cold-start spikes
  • Cost ∝ usage
  • Best for variable load

Pod

  • Stable, low p99
  • Fixed cost
  • Best for steady load

6. Testing Concurrent Queries

Example: Concurrency

from concurrent.futures import ThreadPoolExecutor

def run(qv):
    t = time.perf_counter()
    index.query(vector=qv, top_k=10)
    return (time.perf_counter() - t) * 1000

with ThreadPoolExecutor(max_workers=50) as ex:
    times = list(ex.map(run, queries))

7. Measuring Connection Overhead

OpTypical Cost
SDK init~50-200ms (cache & reuse)
Index handle1 round-trip
Per-queryRTT + server time

8. Profiling Memory Usage

Example: Memory Profiler

from memory_profiler import profile

@profile
def upsert_all():
    for b in batches: index.upsert(vectors=b)

9. Benchmarking Different Metrics

MetricRelative Speed
dotproductFastest (no normalization)
cosineFast (normalized)
euclideanComparable

10. Documenting Benchmark Results

FieldDetail
Index spectype, pods, replicas, dim, metric
Datasetvector count, namespace count, metadata size
ClientSDK version, region, concurrency
Resultsp50/p95/p99, QPS, error rate

11. Comparing with Other Vector DBs

Note: Use a published benchmark (e.g. ann-benchmarks) for apples-to-apples. Pinecone is managed, so factor ops cost too.
DBStrength
PineconeManaged, scaling, ecosystem
WeaviateHybrid, modules
QdrantSelf-host, payload filters
pgvectorSQL-native, small scale

12. Optimizing Based on Benchmarks

FindingAction
High p99, low avgAdd replicas; tune client pool
Low QPS ceilingUpgrade pod / add replicas
Slow filtersReduce cardinality; selective indexing
Cold-start spikesKeep-warm pings or move to pod