Skip to content

Commit

Permalink
docs: show off performance
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Aug 19, 2023
1 parent 82e2e1e commit b106e7a
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,53 @@
## Purpose

Ledger is a command line application for plain text accounting. Providing
commands to view balances, register of transactions, importing of CSV files, exporting of CSV files,
and a web interface to view reports, and track investments.
commands to view balances, register of transactions, importing of CSV files,
exporting of CSV files, and a web interface to view reports, and track
investments. The transaction file format is heavily inspired by
[ledger-cli](https://ledger-cli.org), with a focus on simplicity and
performance.

## Documentation

Head over to https://howeyc.github.io/ledger/

## Performance

Comparison between various ledger-like applications:

- ledger-go
- [ledger-cli](https://ledger-cli.org)
- [hledger](https://hledger.org)

### Stats

| Command | Mean | Min | Max | Relative |
|:---|---:|---:|---:|---:|
| `ledger-go stats` | 14.2ms ± 500µs | 13.1ms | 17.2ms | 1.00 |
| `ledger-cli stats` | 165.5ms ± 1.3ms | 163.3ms | 169.6ms | 11.58 ± 0.49 |
| `hledger-cli stats` | 1.3275s ± 10.9ms | 1.3051s | 1.3458s | 92.90 ± 3.92 |

### Balance

| Command | Mean | Min | Max | Relative |
|:---|---:|---:|---:|---:|
| `ledger-go bal` | 23.9ms ± 700µs | 22.9ms | 28.1ms | 1.00 |
| `ledger-cli bal` | 139.5ms ± 1.3ms | 137.5ms | 144.3ms | 5.83 ± 0.18 |
| `hledger-cli bal` | 1.333s ± 8.8ms | 1.3252s | 1.3559s | 55.66 ± 1.71 |

### Register

| Command | Mean | Min | Max | Relative |
|:---|---:|---:|---:|---:|
| `ledger-go reg` | 52ms ± 1.1ms | 50.5ms | 57.7ms | 1.00 |
| `ledger-cli reg` | 1.7474s ± 20.8ms | 1.7138s | 1.7829s | 33.60 ± 0.84 |
| `hledger-cli reg` | 1.9381s ± 8.8ms | 1.926s | 1.9564s | 37.26 ± 0.84 |

### Print

| Command | Mean | Min | Max | Relative |
|:---|---:|---:|---:|---:|
| `ledger-go print` | 40.9ms ± 800µs | 39.2ms | 44.2ms | 1.00 |
| `ledger-cli print` | 239.1ms ± 2.8ms | 235.2ms | 246.5ms | 5.83 ± 0.14 |
| `hledger-cli print` | 1.5487s ± 10ms | 1.5254s | 1.556s | 37.78 ± 0.83 |

30 changes: 30 additions & 0 deletions ledger/genperf.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,33 @@ cbench --export-markdown perf-bal.md "ledger bal" "./ledger bal" "hledger bal"
cbench --export-markdown perf-reg.md "ledger reg" "./ledger reg" "hledger reg"
cbench --export-markdown perf-print.md "ledger print" "./ledger print" "hledger print"

echo "## Performance" > perf.md
echo "" >> perf.md
echo "Comparison between various ledger-like applications:" >> perf.md
echo "" >> perf.md
echo "- ledger-go" >> perf.md
echo "- [ledger-cli](https://ledger-cli.org)" >> perf.md
echo "- [hledger](https://hledger.org)" >> perf.md
echo "" >> perf.md

echo "### Stats" >> perf.md
echo "" >> perf.md
cat perf-stats.md | sed -e 's/\.\/ledger/ledger-go/g' | sed -e 's/ledger /ledger-cli /g' >> perf.md
echo "" >> perf.md

echo "### Balance" >> perf.md
echo "" >> perf.md
cat perf-bal.md | sed -e 's/\.\/ledger/ledger-go/g' | sed -e 's/ledger /ledger-cli /g' >> perf.md
echo "" >> perf.md

echo "### Register" >> perf.md
echo "" >> perf.md
cat perf-reg.md | sed -e 's/\.\/ledger/ledger-go/g' | sed -e 's/ledger /ledger-cli /g' >> perf.md
echo "" >> perf.md

echo "### Print" >> perf.md
echo "" >> perf.md
cat perf-print.md | sed -e 's/\.\/ledger/ledger-go/g' | sed -e 's/ledger /ledger-cli /g' >> perf.md
echo "" >> perf.md

rm perf-stats.md perf-bal.md perf-reg.md perf-print.md

0 comments on commit b106e7a

Please sign in to comment.