Skip to content

Commit

Permalink
Add benchmark for deserialising TarIndex
Browse files Browse the repository at this point in the history
This improves from:
  deserialise index: OK
    10.0 ms ± 246 μs

to:
  deserialise index: OK
    527  μs ±  43 μs

Due to the previous commit
  • Loading branch information
mpickering committed Jun 14, 2024
1 parent ef864c4 commit f719a72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ benchmarks =

, env loadTarEntries $ \entries ->
bench "unpack" (nfIO $ withSystemTempDirectory "tar-bench" $ \baseDir -> Tar.unpack baseDir entries)

, env (fmap TarIndex.serialise loadTarIndex) $ \tarfile ->
bench "deserialise index" (nf TarIndex.deserialise tarfile)
]

loadTarFile :: IO BS.ByteString
Expand Down

0 comments on commit f719a72

Please sign in to comment.