Skip to content

refactor: optimize critical import path - #849

Merged
leodemoura merged 2 commits into
leanprover:masterfrom
Kha:imports
Dec 6, 2021
Merged

leodemoura merged 2 commits into
leanprover:masterfrom
Kha:imports

Conversation

@Kha

@Kha Kha commented Dec 6, 2021

Copy link
Copy Markdown
Member

critical path -1.5%
average build -3.7%
actual full ccached rebuild w/ 16 threads on my machine -1.4%

... would be nice to have the speedcenter figure those metrics out

The new critical path is completely different again, no more server or pretty printer:

Critical path
  time [s]          [cum]          drv
----------  ----  -------  ------  ---------------------------------------
       1.6  1.2%      1.6    1.2%  Init.Prelude
       3.7  2.9%      5.3    4.1%  Init.Notation
       0.1  0.1%      5.4    4.2%  Init.SizeOf
       1.1  0.9%      6.5    5.1%  Init.Core
       0.3  0.2%      6.8    5.3%  Init.SimpLemmas
       0.7  0.6%      7.5    5.9%  Init.Data.Nat.Basic
       0.4  0.3%      7.9    6.2%  Init.WF
       0.2  0.2%      8.2    6.4%  Init.Data.Nat.Div
       0.1  0.1%      8.3    6.5%  Init.Data.Nat.Bitwise
       0.2  0.2%      8.5    6.7%  Init.Data.Fin.Basic
       0.4  0.3%      8.9    7.0%  Init.Data.UInt
       0.2  0.1%      9.1    7.1%  Init.Data.Char.Basic
       0.7  0.5%      9.8    7.7%  Init.Data.String.Basic
       0.5  0.4%     10.3    8.0%  Init.Data.Format.Basic
       0.4  0.3%     10.6    8.3%  Init.Data.Repr
       0.2  0.2%     10.9    8.5%  Init.Data.ToString.Basic
       0.2  0.2%     11.1    8.7%  Init.Util
       1.4  1.1%     12.5    9.8%  Init.Data.Array.Basic
       2.2  1.7%     14.7   11.5%  Init.Meta
       0.1  0.1%     14.8   11.6%  Init.Data.ToString.Macro
       0.1  0.1%     14.9   11.7%  Init.Data.ToString
       1.5  1.2%     16.4   12.9%  Init.NotationExtra
       0.3  0.3%     16.8   13.2%  Init.Classical
       0.3  0.2%     17.0   13.4%  Init.System.ST
       1.0  0.7%     18.0   14.1%  Init.System.IO
       0.2  0.2%     18.2   14.3%  Init.Control.StateRef
       1.6  1.2%     19.8   15.5%  Init.Control.Lawful
       0.2  0.2%     20.0   15.7%  Init.Control.StateCps
       0.1  0.1%     20.1   15.8%  Init.Control
       0.1  0.1%     20.3   15.9%  Init
       1.1  0.9%     21.4   16.7%  Std.Data.AssocList
       0.9  0.7%     22.3   17.5%  Std.Data.HashMap
       0.7  0.6%     23.0   18.0%  Lean.Data.SMap
       0.4  0.3%     23.4   18.3%  Lean.Data.SSet
       0.5  0.4%     23.9   18.7%  Lean.Data.Name
       0.5  0.4%     24.4   19.1%  Lean.Data.KVMap
       0.4  0.4%     24.9   19.5%  Lean.Data.Options
       0.3  0.3%     25.2   19.7%  Lean.Data.Format
       0.5  0.4%     25.6   20.1%  Lean.Hygiene
       1.2  0.9%     26.8   21.0%  Lean.Level
       2.2  1.7%     29.0   22.7%  Lean.Expr
       1.8  1.4%     30.9   24.2%  Lean.LocalContext
       4.4  3.4%     35.2   27.6%  Lean.MetavarContext
       0.3  0.2%     35.5   27.8%  Lean.Util.PPExt
       0.8  0.6%     36.3   28.5%  Lean.Message
       0.3  0.3%     36.6   28.7%  Lean.Exception
       0.8  0.7%     37.5   29.4%  Lean.MonadEnv
       0.8  0.6%     38.3   30.0%  Lean.Util.Trace
       0.6  0.5%     38.9   30.5%  Lean.CoreM
       1.1  0.9%     40.0   31.3%  Lean.Attributes
       0.9  0.7%     40.9   32.1%  Lean.Class
       3.8  3.0%     44.7   35.0%  Lean.Meta.Basic
       1.7  1.3%     46.4   36.4%  Lean.Compiler.ExternAttr
       2.0  1.5%     48.4   37.9%  Lean.Compiler.IR.Basic
       1.6  1.2%     49.9   39.1%  Lean.Compiler.IR.Format
       0.9  0.7%     50.8   39.8%  Lean.Compiler.IR.CompilerM
       1.7  1.3%     52.5   41.1%  Lean.KeyedDeclsAttribute
       2.0  1.6%     54.5   42.7%  Lean.Parser.Extension
       2.3  1.8%     56.8   44.5%  Lean.PrettyPrinter.Formatter
       0.6  0.4%     57.4   45.0%  Lean.Parser.Extra
       0.6  0.5%     57.9   45.4%  Lean.Parser.Attr
       5.6  4.4%     63.6   49.8%  Lean.Parser.Term
       3.1  2.4%     66.7   52.3%  Lean.Parser.Do
       4.8  3.7%     71.4   56.0%  Lean.Parser.Command
       2.7  2.1%     74.1   58.1%  Lean.Parser.Syntax
       1.0  0.8%     75.1   58.8%  Lean.Elab.Util
       0.5  0.4%     75.6   59.2%  Lean.Elab.Log
       1.1  0.8%     76.6   60.1%  Lean.Elab.Open
       6.9  5.4%     83.6   65.5%  Lean.Elab.Term
       0.8  0.6%     84.4   66.1%  Lean.Elab.Quotation.Util
       1.2  1.0%     85.6   67.1%  Lean.Elab.Quotation.Precheck
       4.7  3.7%     90.3   70.7%  Lean.Elab.Binders
       2.8  2.2%     93.1   72.9%  Lean.Elab.Tactic.Basic
       2.3  1.8%     95.3   74.7%  Lean.Elab.SyntheticMVars
       3.4  2.7%     98.7   77.4%  Lean.Elab.Command
       1.9  1.5%    100.6   78.9%  Lean.Elab.DefView
       1.8  1.4%    102.5   80.3%  Lean.Elab.PreDefinition.Basic
       3.9  3.1%    106.4   83.4%  Lean.Elab.PreDefinition.Structural.Eqns
       1.3  1.0%    107.7   84.4%  Lean.Elab.PreDefinition.Structural.Main
       0.5  0.4%    108.2   84.8%  Lean.Elab.PreDefinition.Structural
       1.6  1.3%    109.8   86.1%  Lean.Elab.PreDefinition.Main
       0.4  0.3%    110.3   86.4%  Lean.Elab.PreDefinition
       3.1  2.5%    113.4   88.9%  Lean.Elab.MutualDef
       0.6  0.5%    114.0   89.4%  Lean.Elab.Deriving.Basic
       4.3  3.4%    118.4   92.8%  Lean.Elab.Inductive
       4.3  3.4%    122.7   96.2%  Lean.Elab.Structure
       1.4  1.1%    124.1   97.3%  Lean.Elab.Declaration
       0.4  0.3%    124.6   97.6%  Lean.Elab
       0.5  0.4%    125.0   98.0%  Lean
       0.0  0.0%    125.1   98.0%  Lean-cc
       0.1  0.1%    125.2   98.1%  Lean-lib
       1.0  0.8%    126.1   98.9%  leanshared
       0.2  0.2%    126.4   99.0%  leanc
       0.1  0.0%    126.4   99.1%  leanc
       0.3  0.2%    126.7   99.3%  lean
       0.8  0.6%    127.5  100.0%  lean-stage1
       0.1  0.0%    127.6  100.0%  lean

Comment thread src/Lean/Meta/Basic.lean
| _ => return false
| _ => return false

/-

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels weird to have this function here. I will try to find a better place for it that avoids the unnecessary Elab/Term.lean dependency.
I will merge the PR as-is, and move the function to a different place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants