From e51b72d57c5c9bbe42129311cfb9588c3c35ca1b Mon Sep 17 00:00:00 2001 From: voidlizard Date: Tue, 22 Jul 2025 08:28:14 +0300 Subject: [PATCH] wip, fixed test a little bit --- hbs2-tests/test/TestNCQ.hs | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hbs2-tests/test/TestNCQ.hs b/hbs2-tests/test/TestNCQ.hs index ceed19b3..db9eb367 100644 --- a/hbs2-tests/test/TestNCQ.hs +++ b/hbs2-tests/test/TestNCQ.hs @@ -792,17 +792,17 @@ testNCQ2Simple1 syn TestEnv{..} = do notice $ "merge data" - ncqWithStorage ncqDir $ \sto -> liftIO do - notice "perform merge" - ncqMergeFull sto - ncqSweepStates sto - ncqSweepFossils sto + -- ncqWithStorage ncqDir $ \sto -> liftIO do + -- notice "perform merge" + -- ncqMergeFull sto + -- ncqSweepStates sto + -- ncqSweepFossils sto - notice $ "full sweep unused states" + -- notice $ "full sweep unused states" - ncqWithStorage ncqDir $ \sto -> liftIO do - ncqSweepStates sto - ncqSweepFossils sto + -- ncqWithStorage ncqDir $ \sto -> liftIO do + -- ncqSweepStates sto + -- ncqSweepFossils sto notice $ "lookup" <+> pretty n <+> "blocks" @@ -810,18 +810,17 @@ testNCQ2Simple1 syn TestEnv{..} = do replicateM_ l do - -- performMajorGC + t0 <- getTimeCoarse - (t1,_) <- timeItT do - - for_ hashes $ \ha -> do - found <- ncqLocate2 sto ha <&> maybe (-1) ncqEntrySize - assertBool (show $ "found" <+> pretty ha) (found > 0) - -- debug $ fill 44 (pretty ha) <+> fill 8 (pretty found) - - notice $ pretty (sec6 t1) <+> "lookup" <+> pretty n <+> "blocks" + pooledForConcurrentlyN_ 8 hashes $ \ha -> do + found <- ncqLocate2 sto ha <&> maybe (-1) ncqEntrySize + assertBool (show $ "found" <+> pretty ha) (found > 0) + -- debug $ fill 44 (pretty ha) <+> fill 8 (pretty found) + t1 <- getTimeCoarse + let dt = realToFrac (toNanoSecs (t1 - t0)) / 1e9 :: Fixed E3 + notice $ pretty (sec6 dt) <+> "lookup" <+> pretty n <+> "blocks" testNCQ2Lookup2:: forall c m . (MonadUnliftIO m, IsContext c) => [Syntax c] @@ -841,7 +840,7 @@ testNCQ2Lookup2 syn TestEnv{..} = do let n = headDef 100000 [ fromIntegral x | LitIntVal x <- argz ] let nt = max 2 . headDef 1 $ [ fromIntegral x | LitIntVal x <- drop 1 argz ] let nl = headDef 3 $ [ fromIntegral x | LitIntVal x <- drop 2 argz ] - let r = (4*1024, 64*1024) + let r = (64*1024, 256*1024) let merge = headDef False [ True | ListVal [StringLike "-m"] <- opts ]