Merge pull request #6532 from urbit/jb/vats-perf

vats: force multiline rendering, improve performance
This commit is contained in:
Ted Blackman 2023-05-01 11:38:30 -04:00 committed by GitHub
commit b632316fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 16 deletions

View File

@ -12,12 +12,17 @@
::
/- *hood
:- %say
|= [[now=@da * bec=beak] deks=$@(~ (list desk)) filt=@tas verb=_|]
?: &(=(~ deks) =(%$ filt))
:- %tang
%+ turn
|= $: [now=@da * bec=beak]
deks=(list desk)
[filt=@tas verb=_|]
==
:- %tang ^- tang
?. &(=(~ deks) =(%$ filt))
(report-vats p.bec now deks filt verb)
%- zing
%+ turn
%+ sort
~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now)))
=/ sed .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))
(sort ~(tap in sed) |=([a=@ b=@] !(aor a b)))
|=([a=desk b=desk] ?|(=(a %kids) =(b %base)))
|=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb))
[%tang (report-vats p.bec now deks filt verb)]
|=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb))

View File

@ -1,3 +1,4 @@
/% kelvin %kelvin
=, clay
=* dude dude:gall
|%
@ -39,16 +40,19 @@
::
++ report-vats
|= [our=@p now=@da desks=(list desk) filt=@tas verb=?]
^- tang
=/ ego (scot %p our)
=/ wen (scot %da now)
=/ prep (report-prep our now)
?~ filt
%- zing
%+ turn (flop desks)
|=(syd=@tas (report-vat prep our now syd verb))
=/ deks
?~ desks
%+ sort ~(tap in -.prep)
|=([[a=desk *] [b=desk *]] ?|(=(a %kids) =(b %base)))
%+ sort
(sort ~(tap in -.prep) |=([[a=@ *] b=@ *] !(aor a b)))
|=([[a=@ *] [b=@ *]] ?|(=(a %kids) =(b %base)))
%+ skip ~(tap in -.prep)
|=([syd=@tas *] =(~ (find ~[syd] desks)))
?: =(filt %blocking)
@ -65,8 +69,11 @@
|=([syd=desk *] syd)
?~ blockers ~[leaf+"No desks blocking upgrade, run |bump to apply"]
:- [%rose [" %" "To unblock upgrade run |suspend %" ""] blockers]
%- zing
%+ turn (flop blockers)
|=(syd=desk (report-vat prep our now syd verb))
::
%- zing
%+ turn
?+ filt !!
::
@ -99,6 +106,15 @@
==
our=ship now=@da syd=desk verb=?
==
^- tang
=- :: hack to force wrapped rendering
::
:: edg=6 empirically prevents dedent
::
%+ roll
(~(win re -) [0 6])
|=([a=tape b=(list @t)] [(crip a) b])
::
^- tank
=/ ego (scot %p our)
=/ wen (scot %da now)
@ -126,9 +142,6 @@
?~ sink [hash]~
(mergebase-hashes our syd now her.u.sink sud.u.sink)
=/ dek (~(got by tyr) syd)
=/ =dome (~(got by cone) our syd)
=/ [on=(list [@tas ?]) of=(list [@tas ?])]
(skid ~(tap by ren.dome) |=([* ?] +<+))
=/ sat
?- zest.dek
%live "running"
@ -158,13 +171,17 @@
leaf/"app status: {sat}"
leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}"
==
::
=/ [on=(list [@tas ?]) of=(list [@tas ?])]
=/ =dome (~(got by cone) our syd)
(skid ~(tap by ren.dome) |=([* ?] +<+))
:~ leaf/"/sys/kelvin: {kul}"
leaf/"base hash: {?.(=(1 (lent meb)) <meb> <(head meb)>)}"
leaf/"%cz hash: {<hash>}"
::
leaf/"app status: {sat}"
leaf/"force on: {?:(=(~ on) "~" <on>)}"
leaf/"force off: {?:(=(~ of) "~" <of>)}"
leaf/"force on: {<(sort (turn on head) aor)>}"
leaf/"force off: {<(sort (turn of head) aor)>}"
::
leaf/"publishing ship: {?~(sink <~> <(get-publisher our syd now)>)}"
leaf/"updates: {?~(sink "local" "remote")}"