From 20ea6e622c0a8df4cd6c4fc364aa10bbf2a0222e Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Tue, 11 Dec 2018 15:52:35 -0800 Subject: [PATCH] Speed up +put:by-schematic This speeds up the +gather step in Ford. By not doing a full sort every time we add a build, we remove ~30ms of latency from each chat message sent my landscape. --- sys/vane/ford.hoon | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/vane/ford.hoon b/sys/vane/ford.hoon index 787f48de4..8ed9c1742 100644 --- a/sys/vane/ford.hoon +++ b/sys/vane/ford.hoon @@ -788,9 +788,15 @@ %+ ~(put by builds) schematic.build :: =/ dates (fall (~(get by builds) schematic.build) ~) - ?^ (find [date.build]~ dates) + |- + ^+ dates + ?~ dates + [date.build ~] + ?: =(i.dates date.build) dates - (sort [date.build dates] gte) + ?: (gth date.build i.dates) + [date.build dates] + [i.dates $(dates t.dates)] :: +del: remove a +build from :builds :: :: Removes :build from :builds by replacing the value at