diff --git a/profile-admin.txt b/profile-admin.txt index 814732e30f..5728a95827 100644 --- a/profile-admin.txt +++ b/profile-admin.txt @@ -1,27 +1,27 @@ 'purs' 'compile' '--source-globs-file' '.spago/sources.txt' +RTS '-N' '-A256m' '-n16m' '-sprofile.txt' - 615,026,369,264 bytes allocated in the heap - 62,526,339,128 bytes copied during GC - 4,808,133,160 bytes maximum residency (7 sample(s)) - 30,469,184 bytes maximum slop - 16158 MiB total memory in use (0 MiB lost due to fragmentation) + 599,749,969,784 bytes allocated in the heap + 62,069,592,800 bytes copied during GC + 4,801,445,848 bytes maximum residency (7 sample(s)) + 31,633,448 bytes maximum slop + 16226 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause - Gen 0 239 colls, 239 par 59.390s 7.687s 0.0322s 0.1657s - Gen 1 7 colls, 6 par 17.637s 4.178s 0.5969s 1.2704s + Gen 0 232 colls, 232 par 58.775s 8.031s 0.0346s 0.1425s + Gen 1 7 colls, 6 par 17.978s 4.666s 0.6666s 1.5471s - Parallel GC work balance: 91.91% (serial 0%, perfect 100%) + Parallel GC work balance: 92.23% (serial 0%, perfect 100%) - TASKS: 67 (1 bound, 65 peak workers (66 total), using -N10) + TASKS: 65 (1 bound, 64 peak workers (64 total), using -N10) SPARKS: 7516 (7516 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled) - INIT time 0.151s ( 0.151s elapsed) - MUT time 304.986s ( 90.340s elapsed) - GC time 77.027s ( 11.865s elapsed) - EXIT time 0.249s ( 0.009s elapsed) - Total time 382.413s (102.365s elapsed) + INIT time 0.149s ( 0.149s elapsed) + MUT time 298.230s ( 81.714s elapsed) + GC time 76.753s ( 12.697s elapsed) + EXIT time 0.261s ( 0.003s elapsed) + Total time 375.393s ( 94.563s elapsed) - Alloc rate 2,016,569,461 bytes per MUT second + Alloc rate 2,011,031,039 bytes per MUT second - Productivity 79.8% of total user, 88.3% of total elapsed + Productivity 79.4% of total user, 86.4% of total elapsed diff --git a/profile.txt b/profile.txt index d46e022a49..120cc9bbbe 100644 --- a/profile.txt +++ b/profile.txt @@ -1,27 +1,27 @@ 'purs' 'compile' '--source-globs-file' '.spago/sources.txt' +RTS '-N' '-A256m' '-n16m' '-sprofile.txt' -1,239,641,572,944 bytes allocated in the heap - 92,117,540,648 bytes copied during GC - 2,525,848,440 bytes maximum residency (16 sample(s)) - 41,515,920 bytes maximum slop - 9680 MiB total memory in use (0 MiB lost due to fragmentation) +1,173,434,083,800 bytes allocated in the heap + 90,812,899,016 bytes copied during GC + 2,324,365,280 bytes maximum residency (16 sample(s)) + 41,667,856 bytes maximum slop + 9037 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause - Gen 0 462 colls, 462 par 98.367s 12.592s 0.0273s 0.1880s - Gen 1 16 colls, 15 par 26.135s 3.701s 0.2313s 0.3772s + Gen 0 438 colls, 438 par 98.124s 12.261s 0.0280s 0.1369s + Gen 1 16 colls, 15 par 26.352s 3.585s 0.2240s 0.3630s - Parallel GC work balance: 90.30% (serial 0%, perfect 100%) + Parallel GC work balance: 90.36% (serial 0%, perfect 100%) - TASKS: 70 (1 bound, 69 peak workers (69 total), using -N10) + TASKS: 71 (1 bound, 69 peak workers (70 total), using -N10) SPARKS: 7516 (7516 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled) - INIT time 0.174s ( 0.173s elapsed) - MUT time 612.239s (126.344s elapsed) - GC time 124.502s ( 16.293s elapsed) - EXIT time 0.107s ( 0.009s elapsed) - Total time 737.021s (142.819s elapsed) + INIT time 0.176s ( 0.175s elapsed) + MUT time 596.810s (105.074s elapsed) + GC time 124.476s ( 15.845s elapsed) + EXIT time 0.096s ( 0.008s elapsed) + Total time 721.557s (121.102s elapsed) - Alloc rate 2,024,767,533 bytes per MUT second + Alloc rate 1,966,178,107 bytes per MUT second - Productivity 83.1% of total user, 88.5% of total elapsed + Productivity 82.7% of total user, 86.8% of total elapsed diff --git a/src/Language/PureScript/Make/Actions.hs b/src/Language/PureScript/Make/Actions.hs index 8cb8a747e0..075a239957 100644 --- a/src/Language/PureScript/Make/Actions.hs +++ b/src/Language/PureScript/Make/Actions.hs @@ -290,7 +290,7 @@ buildMakeActions outputDir filePathMap foreigns usePrefix = codegen ast m docs exts = do let mn = CF.moduleName m lift $ writeCborFile (outputFilename mn externsFileName) exts - lift $ sqliteExtern outputDir ast docs exts + lift $ sqliteExtern outputDir ast exts codegenTargets <- lift $ asks optionsCodegenTargets when (S.member CoreFn codegenTargets) $ do let coreFnFile = targetFilename mn CoreFn diff --git a/src/Language/PureScript/Make/IdeCache.hs b/src/Language/PureScript/Make/IdeCache.hs index ac9c4a8072..6d3afe2ae2 100644 --- a/src/Language/PureScript/Make/IdeCache.hs +++ b/src/Language/PureScript/Make/IdeCache.hs @@ -28,13 +28,11 @@ import Language.PureScript.AST.Traversals (everywhereOnValuesM) import Protolude (identity) import Language.PureScript.Names qualified as T -sqliteExtern :: (MonadIO m) => FilePath -> Module -> Docs.Module -> ExternsFile -> m () -sqliteExtern outputDir m docs extern = liftIO $ do +sqliteExtern :: (MonadIO m) => FilePath -> Module -> ExternsFile -> m () +sqliteExtern outputDir m extern = liftIO $ do conn <- SQLite.open db SQLite.execute_ conn "pragma busy_timeout = 300000;" - -- Debug.traceM $ show extern - let (doDecl, _, _) = everywhereOnValuesM (pure . identity) (\expr -> case expr of Var ss i -> do let iv = disqualify i @@ -62,7 +60,7 @@ sqliteExtern outputDir m docs extern = liftIO $ do SQLite.executeNamed conn "insert into modules (module_name, comment, extern, dec) values (:module_name, :docs, :extern, :dec)" [ ":module_name" := runModuleName ( efModuleName extern ) - , ":docs" := Docs.modComments docs + , ":docs" := Just ("" :: Text) , ":extern" := Serialise.serialise extern , ":dec" := show ( efExports extern ) ] @@ -110,52 +108,6 @@ sqliteExtern outputDir m docs extern = liftIO $ do , ":declaration" := serialise ideDeclaration ]) - for_ (Docs.modDeclarations docs) (\d -> do - SQLite.executeNamed conn - ("insert into declarations (module_name, name, namespace, declaration_type, span, type, docs, declaration) " <> - "values (:module_name, :name, :namespace, :declaration_type, :span, :type, :docs, :declaration)" - ) - [ ":module_name" := runModuleName (efModuleName extern) - , ":name" := Docs.declTitle d - , ":namespace" := toIdeNamespace d - , ":declaration_type" := toDeclarationType d - , ":span" := Aeson.encode (Docs.declSourceSpan d) - , ":docs" := Docs.declComments d - , ":type" := runDocs (declAsMarkdown d) - , ":declaration" := show d - ] - - - for_ (declChildren d) $ \ch -> do - SQLite.executeNamed conn - ("insert into declarations (module_name, name, namespace, span, docs, declaration) " <> - "values (:module_name, :name, :namespace, :span, :docs, :declaration)") - [ ":module_name" := runModuleName (efModuleName extern) - , ":name" := Docs.cdeclTitle ch - , ":namespace" := childDeclInfoNamespaceIde (Docs.cdeclInfo ch) - , ":span" := Aeson.encode (Docs.declSourceSpan d) - , ":docs" := Docs.cdeclComments ch - , ":declaration" := show d - ] - ) - - - for_ (Docs.modReExports docs) $ \rexport -> do - for_ (snd rexport) $ \d -> do - SQLite.executeNamed conn - ("insert into declarations (module_name, name, rexported_from, declaration_type, span, type, docs, declaration)" <> - "values (:module_name, :name, :rexported_from, :declaration_type, :span, :type, :docs, :declaration)" - ) - [ ":module_name" := runModuleName (efModuleName extern) - , ":name" := Docs.declTitle d - , ":rexported_from" := ("HOLAS" :: Text) --runModuleName (Docs.ignorePackage (fst rexport)) - , ":declaration_type" := toDeclarationType d - , ":span" := Aeson.encode (Docs.declSourceSpan d) - , ":docs" := Docs.declComments d - , ":type" := runDocs (declAsMarkdown d) - , ":declaration" := show d - ] - SQLite.close conn return () where @@ -201,20 +153,6 @@ sqliteInit outputDir = liftIO $ do , ")" ] - SQLite.execute_ conn $ SQLite.Query $ Text.pack $ unlines - [ "create table if not exists declarations (" - , " module_name text references modules(module_name) on delete cascade," - , " name text not null," - , " namespace text," - , " declaration_type text," - , " rexported_from text," - , " type text," - , " docs text," - , " span text," - , " declaration text not null" - , ")" - ] - SQLite.execute_ conn $ SQLite.Query $ Text.pack $ unlines [ "create table if not exists asts (" , " module_name text references modules(module_name) on delete cascade," @@ -232,13 +170,9 @@ sqliteInit outputDir = liftIO $ do , ")" ] - SQLite.execute_ conn "create index if not exists dm on declarations(module_name)" - SQLite.execute_ conn "create index if not exists dn on declarations(name);" - SQLite.execute_ conn "create index if not exists asts_module_name_idx on asts(module_name);" SQLite.execute_ conn "create index if not exists asts_name_idx on asts(name);" - SQLite.execute_ conn "create index if not exists exports_name_idx on exports(name);" SQLite.execute_ conn "create index if not exists exports_module_name_idx on exports(module_name);"