Update some profiling stuff.

This commit is contained in:
C. Guy Yarvin 2014-12-02 13:53:35 -08:00
parent d70830355a
commit 5fb9cd9ae9

View File

@ -9469,13 +9469,20 @@
:::::: :::::: profiling support; move me :::::: :::::: :::::: profiling support; move me ::::::
:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
++ doss ++ doss
$: sap=@ud :: sample count $: mon=moan :: sample count
hit=(map term ,@ud) :: hit points hit=(map term ,@ud) :: hit points
cut=(map path hump) :: cut points cut=(map path hump) :: cut points
== ==
++ moan :: sample metric
$: fun=@ud :: samples in C
noc=@ud :: samples in nock
glu=@ud :: samples in glue
mal=@ud :: samples in alloc
far=@ud :: samples in frag
== ::
:: ::
++ hump ++ hump
$: sap=@ud :: sample count $: mon=moan :: sample count
inn=(map path ,@ud) :: calls into inn=(map path ,@ud) :: calls into
out=(map path ,@ud) :: calls out of out=(map path ,@ud) :: calls out of
== ==
@ -9487,10 +9494,10 @@
day(hit (~(put by hit.day) nam ?~(lam 1 +(u.lam)))) day(hit (~(put by hit.day) nam ?~(lam 1 +(u.lam))))
:: ::
++ pi-noon :: sample trace ++ pi-noon :: sample trace
|= [paz=(list path) day=doss] |= [mot=term paz=(list path) day=doss]
=| lax=(unit path) =| lax=(unit path)
|- ^- doss |- ^- doss
?~ paz day(sap +(sap.day)) ?~ paz day(mon (pi-mope mot mon.day))
%= $ %= $
paz t.paz paz t.paz
lax `i.paz lax `i.paz
@ -9498,8 +9505,8 @@
%+ ~(put by cut.day) i.paz %+ ~(put by cut.day) i.paz
^- hump ^- hump
=+ nax=`(unit path)`?~(t.paz ~ `i.t.paz) =+ nax=`(unit path)`?~(t.paz ~ `i.t.paz)
=+ hup=`hump`=+(hup=(~(get by cut.day) i.paz) ?^(hup u.hup [0 ~ ~])) =+ hup=`hump`=+(hup=(~(get by cut.day) i.paz) ?^(hup u.hup [*moan ~ ~]))
:+ +(sap.hup) :+ (pi-mope mot mon.hup)
?~ lax inn.hup ?~ lax inn.hup
=+ hag=(~(get by inn.hup) u.lax) =+ hag=(~(get by inn.hup) u.lax)
(~(put by inn.hup) u.lax ?~(hag 1 +(u.hag))) (~(put by inn.hup) u.lax ?~(hag 1 +(u.hag)))
@ -9507,12 +9514,50 @@
=+ hag=(~(get by out.hup) u.nax) =+ hag=(~(get by out.hup) u.nax)
(~(put by out.hup) u.nax ?~(hag 1 +(u.hag))) (~(put by out.hup) u.nax ?~(hag 1 +(u.hag)))
== ==
++ pi-mope :: add sample
|= [mot=term mon=moan]
?+ mot mon
%fun mon(fun +(fun.mon))
%noc mon(noc +(noc.mon))
%glu mon(glu +(glu.mon))
%mal mon(mal +(mal.mon))
%far mon(far +(far.mon))
==
++ pi-moth :: count sample
|= mon=moan ^- @ud
:(add fun.mon noc.mon glu.mon mal.mon far.mon)
::
++ pi-mumm :: print sample
|= mon=moan ^- tape
=+ tot=(pi-moth mon)
;: welp
^- tape
?: =(0 noc.mon) ~
(welp (scow %ud (div (mul 100 noc.mon) tot)) "n")
::
^- tape
?: =(0 fun.mon) ~
(welp (scow %ud (div (mul 100 fun.mon) tot)) "c")
::
^- tape
?: =(0 glu.mon) ~
(welp (scow %ud (div (mul 100 glu.mon) tot)) "g")
::
^- tape
?: =(0 mal.mon) ~
(welp (scow %ud (div (mul 100 mal.mon) tot)) "m")
::
^- tape
?: =(0 far.mon) ~
(welp (scow %ud (div (mul 100 far.mon) tot)) "f")
==
:: ::
++ pi-tell :: produce dump ++ pi-tell :: produce dump
|= day=doss |= day=doss
^- (list tape) ^- (list tape)
=+ tot=(pi-moth mon.day)
;: welp ;: welp
[(welp "events: " (scow %ud sap.day)) ~] [(welp "events: " (pi-mumm mon.day)) ~]
:: ::
%+ turn %+ turn
(~(tap by hit.day) ~) (~(tap by hit.day) ~)
@ -9525,21 +9570,24 @@
%+ turn %+ turn
%+ sort (~(tap by cut.day)) %+ sort (~(tap by cut.day))
|= [one=(pair path hump) two=(pair path hump)] |= [one=(pair path hump) two=(pair path hump)]
(gth sap.q.one sap.q.two) (gth (pi-moth mon.q.one) (pi-moth mon.q.two))
|= [pax=path hup=hump] |= [pax=path hup=hump]
=+ ott=(pi-moth mon.day)
;: welp ;: welp
[(welp "label: " (spud pax)) ~] [(welp "label: " (spud pax)) ~]
[(welp "weight: " (scow %ud (div (mul 1.000 sap.hup) sap.day))) ~] [(welp "price: " (scow %ud (div (mul 100 ott) tot))) ~]
["from:" ~] [(welp "shape: " (pi-mumm mon.day)) ~]
:: ::
?: =(~ inn.hup) ~
:- "from:"
%+ turn %+ turn
(~(tap by inn.hup) ~) (~(tap by inn.hup) ~)
|= [pax=path num=@ud] |= [pax=path num=@ud]
^- tape ^- tape
:(welp " " (spud pax) ": " (scow %ud num)) :(welp " " (spud pax) ": " (scow %ud num))
:: ::
["into:" ~] ?: =(~ out.hup) ~
:: :- "into:"
%+ turn %+ turn
(~(tap by out.hup) ~) (~(tap by out.hup) ~)
|= [pax=path num=@ud] |= [pax=path num=@ud]