-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/leanprover/lean4 into inc…
…r-tactic
- Loading branch information
Showing
506 changed files
with
129,507 additions
and
80,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Lean.Util.Profiler | ||
|
||
/-! | ||
Usage: | ||
```sh | ||
lean --run ./script/collideProfiles.lean **/*.lean.json ... > merged.json | ||
``` | ||
Merges multiple `trace.profiler.output` profiles into a single one while deduplicating samples with | ||
the same stack. This is useful for building cumulative profiles of medium-to-large projects because | ||
Firefox Profiler cannot handle hundreds of tracks and the deduplication will also ensure that the | ||
profile is small enough for uploading. | ||
As ordering of samples is not meaningful after this transformation, only "Call Tree" and "Flame | ||
Graph" are useful for such profiles. | ||
-/ | ||
|
||
open Lean | ||
|
||
def main (args : List String) : IO Unit := do | ||
let profiles ← args.toArray.mapM fun path => do | ||
let json ← IO.FS.readFile ⟨path⟩ | ||
let profile ← IO.ofExcept $ Json.parse json | ||
IO.ofExcept <| fromJson? profile | ||
-- NOTE: `collide` should not be interpreted | ||
let profile := Firefox.Profile.collide profiles | ||
IO.println <| Json.compress <| toJson profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.