Skip to content

Commit de81f7b

Browse files
Copilot1a1a11ahaochengxia
authored
Add logo support to libCacheSim README (#282)
* Initial plan * Add logo support to libCacheSim with placeholder image Co-authored-by: 1a1a11a <8584783+1a1a11a@users.noreply.github.com> * Replace logo.svg with logo.jpg and update README.md; remove obsolete assets README * Update logo size in README.md for better visibility * Refactor README.md: Remove obsolete table of contents and adjust logo alignment * Cleanup README.md: Remove unused anchor tags for improved readability * Refactor README.md: Remove duplicate logo section and add details for code examples * Remove original title with logo plus text * add circular logo --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: 1a1a11a <8584783+1a1a11a@users.noreply.github.com> Co-authored-by: Juncheng Yang <1a1a11a@users.noreply.github.com> Co-authored-by: Percy <xhc_1007@163.com>
1 parent 71f6416 commit de81f7b

3 files changed

Lines changed: 36 additions & 77 deletions

File tree

README.md

Lines changed: 36 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,35 @@
1-
# libCacheSim - building and running cache simulations
1+
<p align="center">
2+
<picture>
3+
<img alt="libCacheSim" src="doc/assets/logo.jpg" width=55%>
4+
</picture>
5+
</p>
6+
7+
<h3 align="center">
8+
A high-performance library for building and running cache simulations
9+
</h3>
10+
11+
---
212

313
[![build](https://github.com/1a1a11a/libCacheSim/actions/workflows/build.yml/badge.svg)](https://github.com/1a1a11a/libCacheSim/actions/workflows/build.yml)
414
[![Python Release](https://github.com/1a1a11a/libCacheSim/actions/workflows/pypi-release.yml/badge.svg)](https://github.com/1a1a11a/libCacheSim/actions/workflows/pypi-release.yml)
515
[![NPM Release](https://github.com/1a1a11a/libCacheSim/actions/workflows/npm-release.yml/badge.svg)](https://github.com/1a1a11a/libCacheSim/actions/workflows/npm-release.yml)
616
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/1a1a11a/libCacheSim/badge)](https://scorecard.dev/viewer/?uri=github.com/1a1a11a/libCacheSim)
717

818

9-
<!-- TOC start (generated with https://github.com/derlin/bitdowntoc) -->
10-
- [libCacheSim - building and running cache simulations](#libcachesim---building-and-running-cache-simulations)
11-
- [News](#news)
12-
- [What is libCacheSim](#what-is-libcachesim)
13-
- [libCacheSim features](#libcachesim-features)
14-
- [Supported algorithms](#supported-algorithms)
15-
- [Eviction algorithms](#eviction-algorithms)
16-
- [Admission algorithms](#admission-algorithms)
17-
- [Prefetching algorithms](#prefetching-algorithms)
18-
- [Build and Install libCacheSim](#build-and-install-libcachesim)
19-
- [One-line install](#one-line-install)
20-
- [Install dependency](#install-dependency)
21-
- [Build libCacheSim](#build-libcachesim)
22-
- [Developer Setup](#developer-setup)
23-
- [Pre-commit Hooks](#pre-commit-hooks)
24-
- [Usage](#usage)
25-
- [cachesim (a high-performance cache simulator)](#cachesim-a-high-performance-cache-simulator)
26-
- [basic usage](#basic-usage)
27-
- [Run a single cache simulation](#run-a-single-cache-simulation)
28-
- [Run multiple cache simulations with different cache sizes](#run-multiple-cache-simulations-with-different-cache-sizes)
29-
- [Debug cachesim](#debug-cachesim)
30-
- [Plot miss ratio curve](#plot-miss-ratio-curve)
31-
- [Trace analysis](#trace-analysis)
32-
- [Miss ratio curves profiling](#miss-ratio-curves-profiling)
33-
- [Using libCacheSim as a library](#using-libcachesim-as-a-library)
34-
- [Extending libCacheSim (new algorithms and trace types)](#extending-libcachesim-new-algorithms-and-trace-types)
35-
- [Python package](#python-package)
36-
- [Simulation with python](#simulation-with-python)
37-
- [Extending new algorithm](#extending-new-algorithm)
38-
- [Open source cache traces](#open-source-cache-traces)
39-
- [Contributions](#contributions)
40-
- [Reference](#reference)
41-
- [License](#license)
42-
- [Related](#related)
43-
<!-- TOC end -->
44-
45-
46-
<!-- TOC --><a name="news"></a>
4719
## News
4820
* **2024 Oct**: **S3-FIFO** gets an upgrade! Please try out the new version (the old is now renamed to S3-FIFOv0).
4921
* **2023 June**: **QDLP** is available now, see [our paper](https://dl.acm.org/doi/10.1145/3593856.3595887) for details.
5022
* **2023 Oct**: **[S3-FIFO](https://dl.acm.org/doi/10.1145/3600006.3613147)** and **SIEVE(https://sievecache.com)** are available! These are very simple algorithms that are very effective in reducing cache misses. Try them out in libCacheSim and your production!
5123
* **2024 Jan**: We compiled a list of open-source cache datasets at the bottom of this page
5224
---
5325

54-
<!-- TOC --><a name="what-is-libcachesim"></a>
5526
## What is libCacheSim
5627
* a high-performance **cache simulator** for running cache simulations.
5728
* a high-performance and versatile trace analyzer for **analyzing different cache traces**.
5829
* a high-performance **library** for building cache simulators.
5930

6031
---
6132

62-
<!-- TOC --><a name="libcachesim-features"></a>
6333
## libCacheSim features
6434
* **High performance** - over 20M requests/sec for a realistic trace replay.
6535
* **High memory efficiency** - predictable and small memory footprint.
@@ -71,7 +41,6 @@
7141
* **Efficient Miss Ratio Curve profiler** - quickly build highly accurate miss ratio curves on large-scale workloads; see [here](/doc/quickstart_mrcProfiler.md).
7242
---
7343

74-
<!-- TOC --><a name="supported-algorithms"></a>
7544
## Supported algorithms
7645
cachesim supports the following algorithms:
7746
### Eviction algorithms
@@ -103,9 +72,7 @@ cachesim supports the following algorithms:
10372
---
10473

10574

106-
<!-- TOC --><a name="build-and-install-libcachesim"></a>
10775
## Build and Install libCacheSim
108-
<!-- TOC --><a name="one-line-install"></a>
10976
### One-line install
11077
We provide some scripts for quick installation of libCacheSim.
11178
```bash
@@ -115,13 +82,14 @@ If this does not work, please
11582
1. let us know what system you are using and what error you get
11683
2. read the following sections for self-installation.
11784

118-
<!-- TOC --><a name="install-dependency"></a>
85+
<details>
86+
<summary>Step-by-step installation guide </summary>
87+
11988
### Install dependency
12089
libCacheSim uses [cmake](https://cmake.org/) build system and has a few dependencies: [glib](https://developer.gnome.org/glib/), [tcmalloc](https://github.com/google/tcmalloc), [zstd](https://github.com/facebook/zstd).
12190
Please see [install.md](/doc/install.md) for instructions on how to install the dependencies.
12291

12392

124-
<!-- TOC --><a name="build-libcachesim"></a>
12593
### Build libCacheSim
12694
cmake recommends **out-of-source build**, so we do it in a new directory:
12795
```bash
@@ -137,10 +105,14 @@ cmake -G Ninja .. && ninja
137105
[sudo] ninja install
138106
popd
139107
```
108+
</details>
109+
110+
111+
<details>
112+
<summary> Developer setup </summary>
140113

141-
<!-- TOC --><a name="developer-setup"></a>
142114
### Developer Setup
143-
For developers, we provide tools to ensure code quality and consistent formatting:
115+
If you contribute to libCacheSim, we provide tools to ensure code quality and consistent formatting:
144116

145117
#### Pre-commit Hooks
146118
We provide a git pre-commit hook that runs linting checks before each commit, helping catch issues early:
@@ -157,22 +129,20 @@ The pre-commit hook:
157129
- Prevents committing code with formatting, static analysis, or compiler issues
158130
- Logs are preserved for debugging in `.lint-logs/` directory
159131

132+
</details>
133+
160134
---
161135

162-
<!-- TOC --><a name="usage"></a>
163136
## Usage
164-
<!-- TOC --><a name="cachesim-a-high-performance-cache-simulator"></a>
165137
### cachesim (a high-performance cache simulator)
166138
After building and installing libCacheSim, `cachesim` should be in the `_build/bin/` directory.
167-
<!-- TOC --><a name="basic-usage"></a>
168139
#### basic usage
169140
```
170141
./bin/cachesim trace_path trace_type eviction_algo cache_size [OPTION...]
171142
```
172143

173144
use `./bin/cachesim --help` to get more information.
174145

175-
<!-- TOC --><a name="run-a-single-cache-simulation"></a>
176146
#### Run a single cache simulation
177147
Run the example traces using the LRU eviction algorithm and a 1 GB cache size.
178148

@@ -181,7 +151,6 @@ Run the example traces using the LRU eviction algorithm and a 1 GB cache size.
181151
./bin/cachesim ../data/trace.vscsi vscsi lru 1gb
182152
```
183153

184-
<!-- TOC --><a name="run-multiple-cache-simulations-with-different-cache-sizes"></a>
185154
#### Run multiple cache simulations with different cache sizes
186155
```bash
187156
# Note that there is no space between the cache sizes
@@ -202,7 +171,6 @@ Run the example traces using the LRU eviction algorithm and a 1 GB cache size.
202171

203172
See [quick start cachesim](/doc/quickstart_cachesim.md) for more usages.
204173

205-
<!-- TOC --><a name="debug-cachesim"></a>
206174
#### Debug cachesim
207175
We provide a debug script to help you debug cachesim with GDB. For detailed usage instructions, see [debug guide](/doc/usage.md).
208176

@@ -214,7 +182,6 @@ We provide a debug script to help you debug cachesim with GDB. For detailed usag
214182
./scripts/debug.sh -- data/cloudPhysicsIO.vscsi vscsi lru,s3fifo 100mb,1gb
215183
```
216184

217-
<!-- TOC --><a name="plot-miss-ratio-curve"></a>
218185
#### Plot miss ratio curve
219186
You can plot miss ratios of different algorithms and sizes, and plot the miss ratios over time.
220187

@@ -235,7 +202,6 @@ python3 plot_appr_mrc.py MINI ../data/twitter_cluster52.vscsi vscsi s3fifo "0.00
235202

236203
---
237204

238-
<!-- TOC --><a name="trace-analysis"></a>
239205
### Trace analysis
240206
libCacheSim also has a trace analyzer that provides a lot of useful information about the trace.
241207
And it is very fast, designed to work with billions of requests.
@@ -244,7 +210,6 @@ See [trace analysis](/doc/quickstart_traceAnalyzer.md) for more details.
244210

245211
---
246212

247-
<!-- TOC --><a name="miss-ratio-curves-profiling"></a>
248213
### Miss ratio curves profiling
249214

250215
Constructing fine-grained miss ratio curves for large-scale workloads is very demanding on CPU and memory resources. libCacheSim provides advanced miss ratio curves profiling tools to help you quickly build miss ratio curves for large-scale workloads. See [mrcProfiler](/doc/quickstart_mrcProfiler.md) for more details.
@@ -253,11 +218,13 @@ Constructing fine-grained miss ratio curves for large-scale workloads is very de
253218

254219
---
255220

256-
<!-- TOC --><a name="using-libcachesim-as-a-library"></a>
257221
### Using libCacheSim as a library
258222
libCacheSim can be used as a library for building cache simulators.
259223
For example, you can build a cache cluster with consistent hashing or a multi-layer cache simulator.
260224

225+
<details>
226+
<summary> See a code example </summary>
227+
261228
Here is a simplified example showing the basic APIs.
262229
```c
263230
#include <libCacheSim.h>
@@ -299,13 +266,13 @@ To run the executable,
299266
```bash
300267
./test.out
301268
```
269+
</details>
302270

303271
See [here](/doc/advanced_lib.md) for more details, and see [example folder](/example) for examples on how to use libCacheSim, such as building a cache cluster with consistent hashing, multi-layer cache simulators.
304272

305273
---
306274

307275

308-
<!-- TOC --><a name="extending-libcachesim-new-algorithms-and-trace-types"></a>
309276
### Extending libCacheSim (new algorithms and trace types)
310277
libCacheSim supports *txt*, *csv*, and *binary* traces. We prefer binary traces because they allow libCacheSim to run faster, and the traces are more compact.
311278

@@ -316,7 +283,6 @@ If you need to add a new trace type or a new algorithm, please see [here](/doc/a
316283
We encourage the users to check [deepWiki](https://deepwiki.com/1a1a11a/libCacheSim) for a more detailed documentation.
317284

318285
---
319-
<!-- TOC --><a name="python-package"></a>
320286
## Python package
321287

322288
If you are not extremely sensitive to the performance, our python binding can offer you an easier way to access the core feature of libCacheSim.
@@ -340,6 +306,8 @@ print(f"Obj miss ratio: {obj_miss_ratio:.4f}, byte miss ratio: {byte_miss_ratio:
340306
### Extending new algorithm
341307

342308
With python package, you can extend new algorithm to test your own eviction design **without any C/C++ compilation**.
309+
<details>
310+
<summary> See an example below </summary>
343311

344312
```python
345313
import libcachesim as lcs
@@ -375,11 +343,11 @@ obj_miss_ratio, byte_miss_ratio = cache.process_trace(reader)
375343
print(f"Obj miss ratio: {obj_miss_ratio:.4f}, byte miss ratio: {byte_miss_ratio:.4f}")
376344
```
377345

346+
</details>
378347

379348
See more information in [README.md](./libCacheSim-python/README.md) of the Python binding.
380349

381350
---
382-
<!-- TOC --><a name="open-source-cache-traces"></a>
383351
## Open source cache traces
384352
In the [repo](/data/), there are sample traces in different formats (`csv`, `txt`, `vscsi`, and `oracleGeneral`). Note that the sampled traces are **very small** and __should not be used for evaluating different algorithms' miss ratios__. The full traces can be found either with the original release or the processed `oracleGeneral` format.
385353

@@ -395,31 +363,22 @@ struct {
395363
```
396364
The compressed traces can be used with libCacheSim without decompression. And libCacheSim provides a `tracePrint` tool to print the trace in a human-readable format.
397365

366+
We provide a more comprehensive cache datasets at [https://github.com/cacheMon/cache_dataset](https://github.com/cacheMon/cache_dataset).
398367

399-
| Dataset | Year | Type | Original release | OracleGeneral format |
400-
|---------------|------|:---------:|:-----------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------:|
401-
| Tencent Photo | 2018 | object | [link](http://iotta.snia.org/traces/parallel?only=27476) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/tencentPhoto/) |
402-
| WikiCDN | 2019 | object | [link](https://wikitech.wikimedia.org/wiki/Analytics/Data_Lake/Traffic/Caching) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/wiki/) |
403-
| Tencent CBS | 2020 | block | [link](http://iotta.snia.org/traces/parallel?only=27917) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/tencentBlock/) |
404-
| Alibaba Block | 2020 | block | [link](https://github.com/alibaba/block-traces) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/alibabaBlock/) |
405-
| Twitter | 2020 | key-value | [link](https://github.com/twitter/cache-trace) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/twitter/) |
406-
| MetaKV | 2022 | key-value | [link](https://cachelib.org/docs/Cache_Library_User_Guides/Cachebench_FB_HW_eval/#list-of-traces) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/metaKV/) |
407-
| MetaCDN | 2023 | object | [link](https://cachelib.org/docs/Cache_Library_User_Guides/Cachebench_FB_HW_eval/#list-of-traces) | [link](https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/metaCDN/) |
408-
409-
Among the large number of traces, I recommend using the newer ones from Twitter (cluster52), Wiki, and Meta.
410368

411369

412370
---
413-
<!-- TOC --><a name="contributions"></a>
414371
## Contributions
415372
We gladly welcome pull requests.
416373
Before making any large changes, we recommend opening an issue and discussing your proposed changes.
417374
If the changes are minor, then feel free to make them without discussion.
418375
This project adheres to Google's coding style. By participating, you are expected to uphold this code.
419376

420377
---
421-
<!-- TOC --><a name="reference"></a>
422378
## Reference
379+
<details>
380+
<summary> Please cite the following papers if you use libCacheSim. </summary>
381+
423382
```
424383
@inproceedings{yang2020-workload,
425384
author = {Juncheng Yang and Yao Yue and K. V. Rashmi},
@@ -455,16 +414,16 @@ This project adheres to Google's coding style. By participating, you are expecte
455414
numpages = {10},
456415
}
457416
```
458-
If you used libCacheSim in your research, please cite the above papers. And we welcome you to send us a link to your paper and add a reference to [references.md](references.md).
417+
If you used libCacheSim in your research, please cite the above papers.
418+
419+
</details>
459420

460421
---
461422

462423

463-
<!-- TOC --><a name="license"></a>
464424
## License
465425
See [LICENSE](LICENSE) for details.
466426

467-
<!-- TOC --><a name="related"></a>
468427
## Related
469428
* [PyMimircache](https://github.com/1a1a11a/PyMimircache): a python based cache trace analysis platform, now deprecated
470429
---

doc/assets/logo.jpg

135 KB
Loading

doc/assets/logo_circle.png

1.17 MB
Loading

0 commit comments

Comments
 (0)