package coq-lsp
Language Server Protocol native server for Coq
Install
Dune Dependency
Authors
Maintainers
Sources
coq-lsp-0.1.8.8.16.tbz
sha256=40e33157d83bf2c79791b50e31644c070803f9cba1c559ddc00d01a2d01d0f42
sha512=85bf5986091325df085e6b83056b05d37e82e2eb0f2db47bf46b0380ce23129f5d2139bf25ae75a52bff5c42868a2212bbaf6c888ce91dac55e814f146e2c89a
doc/src/coq-lsp.fleche/perf_analysis.ml.html
Source file perf_analysis.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
open Perf let rec list_take n = function | [] -> [] | x :: xs -> if n = 0 then [] else x :: list_take (n - 1) xs let mk_loc_time (n : Doc.Node.t) = let time = Option.default 0.0 n.info.time in let mem = n.info.mw_after -. n.info.mw_prev in let loc = n.Doc.Node.range in Sentence.{ loc; time; mem } let get_stats ~(doc : Doc.t) = match List.rev doc.nodes with | [] -> "no stats" | n :: _ -> Stats.to_string n.info.stats (** Turn into a config option at some point? This is very expensive *) let display_cache_size = false let make (doc : Doc.t) = let n_stm = List.length doc.nodes in let stats = get_stats ~doc in let cache_size = if display_cache_size then Memo.Interp.size () |> float_of_int else 0.0 in let summary = Format.asprintf "{ num sentences: %d@\n; stats: %s; cache: %a@\n}" n_stm stats Stats.pp_words cache_size in let top = List.stable_sort (fun (n1 : Doc.Node.t) n2 -> compare n2.info.time n1.info.time) doc.nodes in let top = list_take 10 top in let timings = List.map mk_loc_time top in { summary; timings }
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>