<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti" -->

---
title: Benchmarking nearest neighbor libraries in Python
description: A brief commentary on a benchmark comparison of approximate nearest neighbor libraries in Python, focusing on the annoy library (built by the author) versus...
canonical: https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Benchmarking nearest neighbor libraries in Python | daily.dev
og:description: A brief commentary on a benchmark comparison of approximate nearest neighbor libraries in Python, focusing on the annoy library (built by the author) versus...
og:url: https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti
og:image: https://api.daily.dev/og/posts/iBNuDSYti.png
og:image:alt: Benchmarking nearest neighbor libraries in Python
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Benchmarking nearest neighbor libraries in Python

**[Erik Bernhardsson](https://daily.dev/sources/erikbernhardsson)** · 2 min read · 0 upvotes · 0 comments

## Summary

A brief commentary on a benchmark comparison of approximate nearest neighbor libraries in Python, focusing on the annoy library (built by the author) versus FLANN. Despite FLANN showing roughly 4x better raw performance, annoy was declared the winner by the benchmark author. The post explains annoy's design goals around memory-mapped file-based storage and notes its limitations with high-dimensional data, while acknowledging installation pain points and architecture-specific bugs across these libraries.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://erikbern.com/2014/01/12/benchmarking-nearest-neighbor-libraries-in-python.html>

## Similar posts on daily.dev

- [Vector Search with FAISS: Approximate Nearest Neighbor \(ANN\) Explained](https://daily.dev/posts/vector-search-with-faiss-approximate-nearest-neighbor-ann-explained-b8dbwdlnb) · PyImageSearch · 0 upvotes · 0 comments
- [How to Optimize Vector Search When RAM Gets Too Expensive: On-Disk vs. In-Memory ANN Indexes](https://daily.dev/posts/how-to-optimize-vector-search-when-ram-gets-too-expensive-on-disk-vs-in-memory-ann-indexes-ezniusn01) · Towards Data Science · 0 upvotes · 0 comments
- [The Optimization Ladder](https://daily.dev/posts/the-optimization-ladder-jor2sohos) · Hacker News · 0 upvotes · 0 comments
- [Python Numbers Every Programmer Should Know](https://daily.dev/posts/python-numbers-every-programmer-should-know-dbwyosyik) · Planet Python · 4 upvotes · 0 comments
- [The 25 Python Libraries Quietly Running the AI Industry \(And Why Most Engineers Only Know Five of Them\)](https://daily.dev/posts/the-25-python-libraries-quietly-running-the-ai-industry-and-why-most-engineers-only-know-five-of-th-g65fejoxx) · Medium · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python)

[View this post on daily.dev](https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Benchmarking nearest neighbor libraries in Python","url":"https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti"},"datePublished":"2026-03-26T08:35:33.507Z","dateModified":"2026-03-26T08:41:02.599Z","description":"A brief commentary on a benchmark comparison of approximate nearest neighbor libraries in Python, focusing on the annoy library (built by the author) versus...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/01b493d91c3cb0ab2a70fba2f6cecc0c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/01b493d91c3cb0ab2a70fba2f6cecc0c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Erik Bernhardsson","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Erik Bernhardsson","logo":"https://media.daily.dev/image/upload/s--SlM88DTW--/f_auto,q_auto/v1774514112/logos/erikbernhardsson?_a=BAMAMiWQ0","url":"https://daily.dev/sources/erikbernhardsson"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/benchmarking-nearest-neighbor-libraries-in-python-ibnudsyti","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Erik Bernhardsson","item":"https://daily.dev/sources/erikbernhardsson"},{"@type":"ListItem","position":3,"name":"Benchmarking nearest neighbor libraries in Python"}]}
```

