Skip to content

Commit 74ba6c7

Browse files
committed
Reduce indirections in IndexCompact by using UNPACK
Strict fields are not auomatically unpacked when they're bigger than a word. So things like Vector etc are not unpacked automagically.
1 parent 66dcf1f commit 74ba6c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Database/LSMTree/Internal/IndexCompact.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,19 +360,19 @@ import Database.LSMTree.Internal.Vector
360360
data IndexCompact = IndexCompact {
361361
-- | \(P\): Maps a page @i@ to the 64-bit slice of primary bits of its
362362
-- minimum key.
363-
icPrimary :: !(VU.Vector Word64)
363+
icPrimary :: {-# UNPACK #-} !(VU.Vector Word64)
364364
-- | \(C\): A clash on page @i@ means that the primary bits of the minimum
365365
-- key on that page aren't sufficient to decide whether a search for a key
366366
-- should continue left or right of the page.
367-
, icClashes :: !(VU.Vector Bit)
367+
, icClashes :: {-# UNPACK #-} !(VU.Vector Bit)
368368
-- | \(TB\): Maps a full minimum key to the page @i@ that contains it, but
369369
-- only if there is a clash on page @i@.
370370
, icTieBreaker :: !(Map (Unsliced SerialisedKey) PageNo)
371371
-- | \(LTP\): Record of larger-than-page values. Given a span of pages for
372372
-- the larger-than-page value, the first page will map to 'False', and the
373373
-- remainder of the pages will be set to 'True'. Regular pages default to
374374
-- 'False'.
375-
, icLargerThanPage :: !(VU.Vector Bit)
375+
, icLargerThanPage :: {-# UNPACK #-} !(VU.Vector Bit)
376376
}
377377
deriving stock (Show, Eq)
378378

0 commit comments

Comments
 (0)