mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 10:21:31 +03:00
hark-graph-hook: remove unnecessary scries where possible for perf
This commit is contained in:
parent
d0be435624
commit
027011deb3
@ -124,15 +124,15 @@
|
|||||||
::
|
::
|
||||||
++ poke-noun
|
++ poke-noun
|
||||||
|= non=*
|
|= non=*
|
||||||
?> ?=(%rewatch-dms non)
|
[~ state]
|
||||||
=/ graphs=(list resource)
|
:: ?> ?=(%rewatch-dms non)
|
||||||
~(tap in get-keys:gra)
|
:: =/ graphs=(list resource)
|
||||||
:- ~
|
:: ~(tap in get-keys:gra)
|
||||||
%_ state
|
:: %_ state
|
||||||
watching
|
:: watching
|
||||||
%- ~(gas in watching)
|
:: %- ~(gas in watching)
|
||||||
(murn graphs |=(rid=resource ?:((should-watch:ha rid) `[rid ~] ~)))
|
:: (murn graphs |=(rid=resource ?:((should-watch:ha rid) `[rid ~] ~)))
|
||||||
==
|
:: ==
|
||||||
::
|
::
|
||||||
++ hark-graph-hook-action
|
++ hark-graph-hook-action
|
||||||
|= =action:hook
|
|= =action:hook
|
||||||
@ -201,7 +201,9 @@
|
|||||||
::
|
::
|
||||||
%add-nodes
|
%add-nodes
|
||||||
=* rid resource.q.update
|
=* rid resource.q.update
|
||||||
(check-nodes ~(val by nodes.q.update) rid)
|
=/ assoc=(unit association:metadata)
|
||||||
|
(peek-association:met %graph rid)
|
||||||
|
(check-nodes ~(val by nodes.q.update) rid assoc)
|
||||||
==
|
==
|
||||||
:: this is awful, but notification kind should always switch
|
:: this is awful, but notification kind should always switch
|
||||||
:: on the index, so hopefully doesn't matter
|
:: on the index, so hopefully doesn't matter
|
||||||
@ -255,9 +257,11 @@
|
|||||||
(get-graph-mop:gra rid)
|
(get-graph-mop:gra rid)
|
||||||
=/ node=(unit node:graph-store)
|
=/ node=(unit node:graph-store)
|
||||||
(bind (peek:orm:graph-store graph) |=([@ =node:graph-store] node))
|
(bind (peek:orm:graph-store graph) |=([@ =node:graph-store] node))
|
||||||
|
=/ assoc=(unit association:metadata)
|
||||||
|
(peek-association:met %graph rid)
|
||||||
=^ cards state
|
=^ cards state
|
||||||
(check-nodes (drop node) rid)
|
(check-nodes (drop node) rid assoc)
|
||||||
?. (should-watch:ha rid)
|
?. (should-watch:ha rid assoc)
|
||||||
[cards state]
|
[cards state]
|
||||||
:_ state(watching (~(put in watching) [rid ~]))
|
:_ state(watching (~(put in watching) [rid ~]))
|
||||||
(weld cards (give:ha ~[/updates] %listen [rid ~]))
|
(weld cards (give:ha ~[/updates] %listen [rid ~]))
|
||||||
@ -265,20 +269,18 @@
|
|||||||
++ check-nodes
|
++ check-nodes
|
||||||
|= $: nodes=(list node:graph-store)
|
|= $: nodes=(list node:graph-store)
|
||||||
rid=resource
|
rid=resource
|
||||||
|
assoc=(unit association:metadata)
|
||||||
==
|
==
|
||||||
=/ group=(unit resource)
|
?~ assoc
|
||||||
(peek-group:met %graph rid)
|
~& no-assoc+rid
|
||||||
?~ group
|
|
||||||
~& no-group+rid
|
|
||||||
`state
|
`state
|
||||||
=/ metadatum=(unit metadatum:metadata)
|
=* group group.u.assoc
|
||||||
(peek-metadatum:met %graph rid)
|
=* metadatum metadatum.u.assoc
|
||||||
?~ metadatum `state
|
|
||||||
=/ module=term
|
=/ module=term
|
||||||
?: ?=(%empty -.config.u.metadatum) %$
|
?: ?=(%empty -.config.metadatum) %$
|
||||||
?: ?=(%group -.config.u.metadatum) %$
|
?: ?=(%group -.config.metadatum) %$
|
||||||
module.config.u.metadatum
|
module.config.metadatum
|
||||||
abet:check:(abed:handle-update:ha rid nodes u.group module)
|
abet:check:(abed:handle-update:ha rid nodes group module)
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ on-peek on-peek:def
|
++ on-peek on-peek:def
|
||||||
@ -340,12 +342,11 @@
|
|||||||
$(contents t.contents)
|
$(contents t.contents)
|
||||||
::
|
::
|
||||||
++ should-watch
|
++ should-watch
|
||||||
|= rid=resource
|
|= [rid=resource assoc=(unit association:metadata)]
|
||||||
^- ?
|
^- ?
|
||||||
=/ group-rid=(unit resource)
|
?~ assoc
|
||||||
(peek-group:met %graph rid)
|
%.n
|
||||||
?~ group-rid %.n
|
?| !(is-managed:grp group.u.assoc)
|
||||||
?| !(is-managed:grp u.group-rid)
|
|
||||||
&(watch-on-self =(our.bowl entity.rid))
|
&(watch-on-self =(our.bowl entity.rid))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -364,7 +365,9 @@
|
|||||||
update-core(rid r, updates upds, group grp, module mod)
|
update-core(rid r, updates upds, group grp, module mod)
|
||||||
::
|
::
|
||||||
++ get-conversion
|
++ get-conversion
|
||||||
(^get-conversion rid)
|
:: LA: this tube should be cached in %hark-graph-hook state
|
||||||
|
:: instead of just trying to keep it warm, as the scry overhead is large
|
||||||
|
~+ (^get-conversion rid)
|
||||||
::
|
::
|
||||||
++ abet
|
++ abet
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
|
Loading…
Reference in New Issue
Block a user