> For the complete documentation index, see [llms.txt](https://docs.zama.org/tfhe-rs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/tfhe-rs/get-started/benchmarks/cpu/cpu-kvstore.md).

# KVStore

The Key-Value Store (KVStore) is a specialized encrypted HashMap where:

* Keys are clear numbers
* Values are `FheInt` (signed integers) or `FheUint` (unsigned integers)

This document details the CPU performance benchmarks of homomorphic operations on KVStore with encrypted keys using **TFHE-rs**.

{% hint style="info" %}
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with two 96-core `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
{% endhint %}

The following tables benchmark the execution time of operations using `FheUint`.

## Get latency

The next table shows the operation timings on CPU to get the value corresponding to an encrypted key.

![](/files/F9sjI6PpzwPvYqwzp3Sx)

## Update latency

The next table shows the operation timings on CPU to replace the value corresponding to an encrypted key.

![](/files/V7l9i7wuU78cxMCK4o24)

## Map latency

The next table shows the operation timings on CPU to replace the value corresponding to an encrypted key, with the result of applying the identity function to the current value.

![](/files/mmD7LSSocTihIHOhI4d7)

## Reproducing TFHE-rs benchmarks

**TFHE-rs** benchmarks can be easily reproduced from the [source](https://github.com/zama-ai/tfhe-rs).

{% hint style="info" %}
AVX512 is now enabled by default for benchmarks when available
{% endhint %}

The following example shows how to reproduce **TFHE-rs** benchmarks:

```shell
#Key-value Store benchmarks:
make bench_hlapi_kvstore
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zama.org/tfhe-rs/get-started/benchmarks/cpu/cpu-kvstore.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
