mirror of
https://github.com/urbit/shrub.git
synced 2024-12-04 14:58:10 +03:00
Add simple profiling state.
This commit is contained in:
parent
55e40f40e8
commit
cffc2a545c
@ -9542,6 +9542,86 @@
|
||||
|= txt=@ta
|
||||
^- twig
|
||||
(rash txt wide:vast)
|
||||
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:::::: :::::: profiling support; move me ::::::
|
||||
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ doss
|
||||
$: sap=@ud :: sample count
|
||||
hit=(map term ,@ud) :: hit points
|
||||
cut=(map span hump) :: cut points
|
||||
==
|
||||
::
|
||||
++ hump
|
||||
$: sap=@ud :: sample count
|
||||
inn=(map span ,@ud) :: calls into
|
||||
out=(map span ,@ud) :: calls out of
|
||||
==
|
||||
::
|
||||
++ pi-heck
|
||||
|= [nam=@tas day=doss]
|
||||
^- doss
|
||||
=+ lam=(~(get by hit.day) nam)
|
||||
day(hit (~(put by hit.day) nam ?~(lam 1 +(u.lam))))
|
||||
::
|
||||
++ pi-noon :: sample trace
|
||||
|= [pax=path day=doss]
|
||||
=| lax=(unit span)
|
||||
|- ^- doss
|
||||
?~ pax day(sap +(sap.day))
|
||||
%= $
|
||||
pax t.pax
|
||||
lax `i.pax
|
||||
cut.day
|
||||
%+ ~(put by cut.day) i.pax
|
||||
^- hump
|
||||
=+ nax=`(unit span)`?~(t.pax ~ `i.t.pax)
|
||||
=+ hup=`hump`=+(hup=(~(get by cut.day) i.pax) ?^(hup u.hup [0 ~ ~]))
|
||||
:+ +(sap.hup)
|
||||
?~ lax inn.hup
|
||||
=+ hag=(~(get by inn.hup) u.lax)
|
||||
(~(put by inn.hup) u.lax ?~(hag 1 +(u.hag)))
|
||||
?~ nax out.hup
|
||||
=+ hag=(~(get by out.hup) u.nax)
|
||||
(~(put by out.hup) u.nax ?~(hag 1 +(u.hag)))
|
||||
==
|
||||
::
|
||||
++ pi-tell :: produce dump
|
||||
|= day=doss
|
||||
^- (list tape)
|
||||
;: welp
|
||||
[(welp "events: " (scow %ud sap.day)) ~]
|
||||
::
|
||||
%+ turn
|
||||
(~(tap by hit.day) ~)
|
||||
|= [nam=term num=@ud]
|
||||
:(welp (trip nam) ": " (scow %ud num))
|
||||
["" ~]
|
||||
::
|
||||
%- zing
|
||||
^- (list (list tape))
|
||||
%+ turn
|
||||
(~(tap by cut.day) ~)
|
||||
|= [nam=term hup=hump]
|
||||
;: welp
|
||||
[(welp "sector: " (trip nam)) ~]
|
||||
[(welp "weight: " (scow %ud (div (mul 1.000 sap.hup) sap.day))) ~]
|
||||
["inn:" ~]
|
||||
::
|
||||
%+ turn
|
||||
(~(tap by inn.hup) ~)
|
||||
|= [nam=term num=@ud]
|
||||
^- tape
|
||||
:(welp " " (trip nam) ": " (scow %ud num))
|
||||
::
|
||||
["out:" ~]
|
||||
::
|
||||
%+ turn
|
||||
(~(tap by out.hup) ~)
|
||||
|= [nam=term num=@ud]
|
||||
^- tape
|
||||
:(welp " " (trip nam) ": " (scow %ud num))
|
||||
==
|
||||
==
|
||||
--
|
||||
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:::::: :::::: volume 3, Arvo models and skeleton ::::::
|
||||
|
Loading…
Reference in New Issue
Block a user