> Complete content index: https://narsil.sondelali.com/llms.txt

# Narsil vs Orama

> The benchmark harness measured Narsil and Orama in Node.js for speed, ranking quality, and memory. Every result is here, including Orama's wins.

URL: https://narsil.sondelali.com/compare/orama

## Headline result

When Narsil is embedded in a Node.js process, a keyword search over 50,000 documents takes a median of 0.129 ms.

Ratio: 124× (shorter median than Orama).

- Narsil: 0.129 ms
- Orama: 15.969 ms

A lower time means a faster search. On SciFact, Narsil ranks results at nDCG@10 0.684 and Orama at 0.435.

The harness recorded these figures in run `20261119T135657Z` on 19 November 2026, with Narsil built from commit `3ad47df2c9c1`.

The harness measured Narsil `0.4.5` against Orama `3.1.18`.

The harness tested each engine in a separate Node.js v24.22.3 process on GCP c3-standard-8, us-central1-a, on the processor that the machine reports as Intel(R) Xeon(R) Platinum 8481C CPU @ 2.70GHz. Narsil searched vectors through WebAssembly, the way it does in a browser.

## What each engine is for

**Orama.** Orama is a search engine written in TypeScript that offers full-text, vector, and hybrid search. It works in browsers, on servers, and at the edge, and a plugin system extends it.

**Narsil.** Narsil also embeds in a JavaScript process, and it offers full-text, vector, hybrid, and geo search on one typed index. When an application outgrows one process, the same engine can serve the index over HTTP.

## Keyword search

Each engine indexes the same FiQA documents and answers the same queries at each corpus size.

| Measure | Corpus | Narsil | Orama |
| --- | --- | ---: | ---: |
| Documents inserted a second | 1,000 documents | 12,172 | 4,290 |
| Documents inserted a second | 10,000 documents | 13,584 | 4,001 |
| Documents inserted a second | 50,000 documents | 13,026 | 3,720 |
| Median search, ms | 1,000 documents | 0.049 | 0.066 |
| Median search, ms | 10,000 documents | 0.055 | 1.361 |
| Median search, ms | 50,000 documents | 0.129 | 15.969 |
| p95 search, ms | 1,000 documents | 0.112 | 0.580 |
| p95 search, ms | 10,000 documents | 0.128 | 10.160 |
| p95 search, ms | 50,000 documents | 0.468 | 384.472 |
| Heap and external memory, MB | 1,000 documents | 1.1 | 11.4 |
| Heap and external memory, MB | 10,000 documents | 6.6 | 87.3 |
| Heap and external memory, MB | 50,000 documents | 23.1 | 398.2 |

## Filtered search

Each query adds a category filter and a minimum score filter to the search words.

| Measure | Corpus | Narsil | Orama |
| --- | --- | ---: | ---: |
| Median filtered search, ms | 1,000 documents | 0.052 | 0.057 |
| Median filtered search, ms | 10,000 documents | 0.075 | 0.906 |
| Median filtered search, ms | 50,000 documents | 0.150 | 8.024 |

## Vector search

Each engine stores the same SciFact and NFCorpus embeddings and answers the same nearest-neighbour queries.

| Measure | Corpus | Narsil | Orama |
| --- | --- | ---: | ---: |
| Recall@10 against exact search | SciFact | 1.000 | 1.000 |
| Recall@10 against exact search | NFCorpus | 1.000 | 1.000 |
| Documents inserted a second | SciFact | 50,499 | 189,085 |
| Documents inserted a second | NFCorpus | 44,863 | 191,692 |
| Median search, ms | SciFact | 1.057 | 3.735 |
| Median search, ms | NFCorpus | 0.807 | 2.584 |
| Heap and external memory, MB | SciFact | 34.1 | 10.5 |
| Heap and external memory, MB | NFCorpus | 32.4 | 7.2 |

## Ranking quality

Human relevance judgements on SciFact score each engine's top ten results.

| Measure | Corpus | Narsil | Orama |
| --- | --- | ---: | ---: |
| nDCG@10 | SciFact | 0.684 | 0.435 |

## Saving and loading

Each engine saves its largest index in its standard save format, then loads the saved copy and answers a search.

| Measure | Corpus | Narsil | Orama |
| --- | --- | ---: | ---: |
| Saved size, MB | 50,000 documents | 70.1 | 193.8 |
| Save, ms | 50,000 documents | 1,335 | 2,081 |
| Load and first search, ms | 50,000 documents | 532 | 3,389 |

## Changing documents

Each engine removes a slice of its largest index, answers a search, and inserts the same number of documents again.

| Measure | Corpus | Narsil | Orama |
| --- | --- | ---: | ---: |
| Documents removed a second | 50,000 documents | 7,929 | 4,759 |
| Search after removal, ms | 50,000 documents | 0.191 | 17.237 |
| Documents inserted again a second | 50,000 documents | 9,723 | 3,643 |

## Where Narsil is better

- Narsil keeps each index durable with a write-ahead log and checkpoints.
- Narsil packages for Python, Go, and Rust read the same index format, so services outside JavaScript can search the same index.
- Narsil shards a large index across partitions and worker threads, then merges the results from every shard into one ranked list.

Of the 30 measurements that the harness recorded for both engines, Narsil came out ahead in 24 and Orama in 4, while 2 came out level.

A measure is level when the tables above show the same figure for both engines.

### Documents inserted a second

Narsil better in 3 of 5.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Keyword search, 1,000 documents | 12,172 | 4,290 |
| Keyword search, 10,000 documents | 13,584 | 4,001 |
| Keyword search, 50,000 documents | 13,026 | 3,720 |

### Median search, ms

Narsil better in 5 of 5.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Keyword search, 1,000 documents | 0.049 | 0.066 |
| Keyword search, 10,000 documents | 0.055 | 1.361 |
| Keyword search, 50,000 documents | 0.129 | 15.969 |
| Vector search, SciFact | 1.057 | 3.735 |
| Vector search, NFCorpus | 0.807 | 2.584 |

### p95 search, ms

Narsil better in 3 of 3.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Keyword search, 1,000 documents | 0.112 | 0.580 |
| Keyword search, 10,000 documents | 0.128 | 10.160 |
| Keyword search, 50,000 documents | 0.468 | 384.472 |

### Heap and external memory, MB

Narsil better in 3 of 5.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Keyword search, 1,000 documents | 1.1 | 11.4 |
| Keyword search, 10,000 documents | 6.6 | 87.3 |
| Keyword search, 50,000 documents | 23.1 | 398.2 |

### Median filtered search, ms

Narsil better in 3 of 3.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Filtered search, 1,000 documents | 0.052 | 0.057 |
| Filtered search, 10,000 documents | 0.075 | 0.906 |
| Filtered search, 50,000 documents | 0.150 | 8.024 |

### nDCG@10

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Ranking quality, SciFact | 0.684 | 0.435 |

### Saved size, MB

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Saving and loading, 50,000 documents | 70.1 | 193.8 |

### Save, ms

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Saving and loading, 50,000 documents | 1,335 | 2,081 |

### Load and first search, ms

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Saving and loading, 50,000 documents | 532 | 3,389 |

### Documents removed a second

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Changing documents, 50,000 documents | 7,929 | 4,759 |

### Search after removal, ms

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Changing documents, 50,000 documents | 0.191 | 17.237 |

### Documents inserted again a second

Narsil better in 1 of 1.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Changing documents, 50,000 documents | 9,723 | 3,643 |

## Where Orama is better

- Orama is written entirely in TypeScript with no native code, so one build works in every JavaScript runtime, while Narsil loads a native core outside the browser.
- Orama's plugin system adds features such as analytics and embeddings without changes to the core engine.

Measurements that Orama won:

### Documents inserted a second

Orama better in 2 of 5.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Vector search, SciFact | 50,499 | 189,085 |
| Vector search, NFCorpus | 44,863 | 191,692 |

### Heap and external memory, MB

Orama better in 2 of 5.

| Comparison | Narsil | Orama |
| --- | ---: | ---: |
| Vector search, SciFact | 34.1 | 10.5 |
| Vector search, NFCorpus | 32.4 | 7.2 |

## Try Narsil

When you paste this prompt into your coding agent, the agent will install the Narsil skill and the package, then build and test the search that your project needs.

```text
Read https://narsil.sondelali.com/agents.md and follow it to add Narsil search to this project.
```

If you prefer to write the code yourself, you can use the Narsil package for TypeScript, Python, Go, or Rust, since every package searches with the same engine. Each program indexes three films and finds the films from 1990 onwards whose title matches ronin, before it finds the two films whose embeddings are closest to a query vector.

```bash title="pnpm" tab="TypeScript"
pnpm add @delali/narsil
```

```bash title="pip" tab="Python"
pip install delali-narsil
```

```bash title="go get" tab="Go"
go get github.com/assetcorp/narsil/packages/go/engine@v0.2.1
```

```bash title="cargo" tab="Rust"
cargo add delali-narsil
```

```ts title="films.ts" tab="TypeScript"
import { createNarsil } from '@delali/narsil'

const narsil = await createNarsil()

await narsil.createIndex('films', {
  schema: { title: 'string', year: 'number', embedding: 'vector[3]' },
})

await narsil.insertBatch('films', [
  { id: 'heat', title: 'Heat', year: 1995, embedding: [0.9, 0.1, 0.2] },
  { id: 'ronin', title: 'Ronin', year: 1998, embedding: [0.8, 0.3, 0.1] },
  { id: 'solaris', title: 'Solaris', year: 1972, embedding: [0.1, 0.9, 0.7] },
])

const keyword = await narsil.query('films', { term: 'ronin', filters: { fields: { year: { gte: 1990 } } } })
console.log(keyword.count, keyword.hits[0].id)

const nearest = await narsil.query('films', {
  vector: { field: 'embedding', value: [0.85, 0.2, 0.15] },
  limit: 2,
})
for (const hit of nearest.hits) {
  console.log(hit.id, hit.score)
}

await narsil.shutdown()
```

```python title="films.py" tab="Python"
from narsil import Narsil

with Narsil() as engine:
    engine.create_index("films", {"schema": {"title": "string", "year": "number", "embedding": "vector[3]"}})
    engine.insert_batch(
        "films",
        [
            {"id": "heat", "title": "Heat", "year": 1995, "embedding": [0.9, 0.1, 0.2]},
            {"id": "ronin", "title": "Ronin", "year": 1998, "embedding": [0.8, 0.3, 0.1]},
            {"id": "solaris", "title": "Solaris", "year": 1972, "embedding": [0.1, 0.9, 0.7]},
        ],
    )

    keyword = engine.query("films", {"term": "ronin", "filters": {"fields": {"year": {"gte": 1990}}}})
    print(keyword["count"], keyword["hits"][0]["id"])

    nearest = engine.query("films", {"vector": {"field": "embedding", "value": [0.85, 0.2, 0.15]}, "limit": 2})
    for hit in nearest["hits"]:
        print(hit["id"], hit["score"])
```

```go title="main.go" tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/assetcorp/narsil/packages/go/engine"
)

func main() {
	if err := run(context.Background(), "./narsil-data"); err != nil {
		log.Fatal(err)
	}
}

func run(ctx context.Context, directory string) error {
	narsil, err := engine.New(ctx, engine.Config{
		Durability: &engine.DurabilityConfig{Directory: directory},
	})
	if err != nil {
		return err
	}
	defer narsil.Shutdown(ctx)

	err = narsil.CreateIndex(ctx, "films", engine.IndexConfig{
		Schema: engine.Schema{
			"title":     engine.FieldString,
			"year":      engine.FieldNumber,
			"embedding": engine.VectorFieldType(3),
		},
	})
	if err != nil {
		return err
	}

	_, err = narsil.InsertBatch(ctx, "films", []*engine.Document{
		engine.DocumentFromMap(map[string]any{"id": "heat", "title": "Heat", "year": 1995, "embedding": []float32{0.9, 0.1, 0.2}}),
		engine.DocumentFromMap(map[string]any{"id": "ronin", "title": "Ronin", "year": 1998, "embedding": []float32{0.8, 0.3, 0.1}}),
		engine.DocumentFromMap(map[string]any{"id": "solaris", "title": "Solaris", "year": 1972, "embedding": []float32{0.1, 0.9, 0.7}}),
	}, engine.InsertOptions{})
	if err != nil {
		return err
	}

	keyword, err := narsil.Query(ctx, "films", engine.QueryParams{
		Term: "ronin",
		Filters: &engine.FilterExpression{Fields: map[string]engine.FieldFilter{
			"year": {Gte: engine.NumberBound(1990)},
		}},
	})
	if err != nil {
		return err
	}
	fmt.Println(keyword.Count, keyword.Hits[0].ID)

	nearest, err := narsil.Query(ctx, "films", engine.QueryParams{
		Mode:   engine.SearchVector,
		Vector: &engine.VectorQueryConfig{Field: "embedding", Value: []float32{0.85, 0.2, 0.15}},
		Limit:  engine.Some(2),
	})
	if err != nil {
		return err
	}
	for _, hit := range nearest.Hits {
		fmt.Println(hit.ID, hit.Score.Or(0))
	}
	return nil
}
```

```rust title="main.rs" tab="Rust"
use narsil::{IndexConfig, Narsil, NarsilConfig, QueryParams, Value, VectorQuery, parse_json};

fn main() -> narsil::Result<()> {
    let engine = Narsil::open(NarsilConfig::default())?;
    engine.create_index(
        "films",
        IndexConfig {
            schema: parse_json(r#"{ "title": "string", "year": "number", "embedding": "vector[3]" }"#)?,
            ..IndexConfig::default()
        },
    )?;

    let films = [
        r#"{ "id": "heat", "title": "Heat", "year": 1995, "embedding": [0.9, 0.1, 0.2] }"#,
        r#"{ "id": "ronin", "title": "Ronin", "year": 1998, "embedding": [0.8, 0.3, 0.1] }"#,
        r#"{ "id": "solaris", "title": "Solaris", "year": 1972, "embedding": [0.1, 0.9, 0.7] }"#,
    ];
    let mut documents = Vec::new();
    for film in films {
        if let Value::Object(document) = parse_json(film)? {
            documents.push(document);
        }
    }
    engine.insert_batch("films", documents)?;

    let keyword = engine.query(
        "films",
        &QueryParams {
            term: Some("ronin".into()),
            filters: Some(parse_json(r#"{ "fields": { "year": { "gte": 1990 } } }"#)?),
            ..QueryParams::default()
        },
    )?;
    println!("{} {}", keyword.count, keyword.hits[0].id);

    let nearest = engine.query(
        "films",
        &QueryParams {
            vector: Some(VectorQuery {
                field: "embedding".into(),
                value: Some(vec![0.85, 0.2, 0.15]),
                ..VectorQuery::default()
            }),
            limit: Some(2),
            ..QueryParams::default()
        },
    )?;
    for hit in &nearest.hits {
        println!("{} {}", hit.id, hit.score.unwrap_or(0.0));
    }
    Ok(())
}
```

- [Serve Narsil over HTTP](https://narsil.sondelali.com/docs/http-server)

## Reproduce these numbers

The benchmark harness is in the Narsil repository, where it writes every figure that it measures into a new run directory.

```bash
git clone https://github.com/assetcorp/narsil.git
cd narsil
pnpm install
pnpm run build
pnpm --filter benchmarks bench
```

- [Open the run on GitHub](https://github.com/assetcorp/narsil/tree/main/benchmarks/in-process/results/runs/20261119T135657Z)
- [Compare every engine in BENCHMARKS.md](https://github.com/assetcorp/narsil/blob/main/BENCHMARKS.md)
