From f719a722121057299e55b7e4da0eb12d0dc7cf07 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 14 Jun 2024 08:52:30 +0100 Subject: [PATCH] Add benchmark for deserialising TarIndex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This improves from: deserialise index: OK 10.0 ms ± 246 μs to: deserialise index: OK 527 μs ± 43 μs Due to the previous commit --- bench/Main.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bench/Main.hs b/bench/Main.hs index fc7ea4d..d132975 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -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