Menu

1 / 5

Python vs Go vs Rust for a Vector Search API: the Language Explained 5% of the Throughput Variance

DEV Community: rust·Firat Celik·14 days ago
#tYm88wdB
#devtorust#devto#dev#store#pgvector
Reading 0:00
15s threshold

Most "Python vs Go vs Rust" API benchmarks I have seen measure the HTTP layer with a trivial handler. A semantic-search API spends much of its time somewhere else: inside the vector store. So I built the same /search endpoint nine times, three languages times three stores, and ran all of it on tight hardware: one 8 GiB Mac mini, closer to an edge box or a small VM than to a database server. The question was not only which stack is fastest, but which one degrades first when memory and threads run short, and why.

Thesis: for a semantic-search API, the store you pick decides most of your throughput. The language decides much less.

Antithesis I expected to find: Python's JSON parsing on the same cores as the search should drag FastAPI down at high load, so the language should matter most exactly where it hurts.

What the data says, for this design on this machine: the store explains about two thirds of the variance in throughput, the language about 5% (method in Result 1).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.