Skip to content

Commit ba1d4ed

Browse files
committed
Turn the part on memory use into a dedicated subsection
1 parent a4b291e commit ba1d4ed

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

doc/final-report/final-report.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,42 +1250,6 @@ can be interleaved with the database operations then using more cores can
12501250
improve performance even more. With the real UTxO workload, we are in this
12511251
situation, of course, because there is transaction validation work to do.
12521252

1253-
### The memory targets
1254-
1255-
Performance requirement 7 states:
1256-
1257-
> A benchmark should demonstrate that the memory use of a table with 10 M
1258-
> entries is within 100 Mb, and a 100 M entry table is within 1 Gb. This should
1259-
> be for key value sizes as in the primary benchmark (34 + 60 bytes).
1260-
1261-
The table in the [Primary Benchmark Results] section reports the results for a
1262-
table with 100 M entries. The last column is the maximum memory used during the
1263-
run. As noted in the table description, the memory measurement is the peak RSS,
1264-
as reported by the OS.
1265-
1266-
We can see from the reported memory use that all the benchmark runs work in
1267-
less than 1 GiB (1024 MiB).
1268-
1269-
For the target of the 10 M entry table operating within 100 Mb, we have to use
1270-
a slightly different benchmark configuration.
1271-
1272-
* Obviously we must use a smaller table, with an initial size of 10 M entries.
1273-
* We also scale down the size of the write buffer correspondingly, from 20k
1274-
entries to 2k entries.
1275-
* We tell the GHC RTS to limit its heap size to 100 Mb, using: `+RTS -M100m`.
1276-
1277-
One minor "gotcha" to avoid, when reproducing this result, is that one has to
1278-
run the benchmark executable directly, not via `cabal run`. This is because
1279-
`/usr/bin/time` reports the largest RSS of any sub-process which may turn out
1280-
to be from `cabal` itself, and not the benchmark process.
1281-
1282-
With this, the RSS is reported as 85,220 Kb, 83.2 Mb, which is less than the
1283-
target of 100 Mb.
1284-
1285-
We also get excellent performance results for smaller tables like this, since
1286-
there is less merging work to do. In this case we get around 150k ops/sec,
1287-
compared to around 86k ops/sec for the 100 M entry table.
1288-
12891253
### Reproducing the results
12901254

12911255
The primary benchmark’s code is in the repository in
@@ -1388,6 +1352,42 @@ The result are as follows
13881352
upsert is "substantially better" than the combination of a lookup followed
13891353
by an insert.
13901354
1355+
## The memory targets
1356+
1357+
Performance requirement 7 states:
1358+
1359+
> A benchmark should demonstrate that the memory use of a table with 10 M
1360+
> entries is within 100 Mb, and a 100 M entry table is within 1 Gb. This should
1361+
> be for key value sizes as in the primary benchmark (34 + 60 bytes).
1362+
1363+
The table in the [Primary Benchmark Results] section reports the results for a
1364+
table with 100 M entries. The last column is the maximum memory used during the
1365+
run. As noted in the table description, the memory measurement is the peak RSS,
1366+
as reported by the OS.
1367+
1368+
We can see from the reported memory use that all the benchmark runs work in
1369+
less than 1 GiB (1024 MiB).
1370+
1371+
For the target of the 10 M entry table operating within 100 Mb, we have to use
1372+
a slightly different benchmark configuration.
1373+
1374+
* Obviously we must use a smaller table, with an initial size of 10 M entries.
1375+
* We also scale down the size of the write buffer correspondingly, from 20k
1376+
entries to 2k entries.
1377+
* We tell the GHC RTS to limit its heap size to 100 Mb, using: `+RTS -M100m`.
1378+
1379+
One minor "gotcha" to avoid, when reproducing this result, is that one has to
1380+
run the benchmark executable directly, not via `cabal run`. This is because
1381+
`/usr/bin/time` reports the largest RSS of any sub-process which may turn out
1382+
to be from `cabal` itself, and not the benchmark process.
1383+
1384+
With this, the RSS is reported as 85,220 Kb, 83.2 Mb, which is less than the
1385+
target of 100 Mb.
1386+
1387+
We also get excellent performance results for smaller tables like this, since
1388+
there is less merging work to do. In this case we get around 150k ops/sec,
1389+
compared to around 86k ops/sec for the 100 M entry table.
1390+
13911391
# References {-}
13921392
13931393
::: {#refs}

0 commit comments

Comments
 (0)