diff options
| author | eunhhu <[email protected]> | 2026-10-04 10:31:09 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-04 10:31:09 +0100 |
| commit | 93261d1c157e50f1ed2bbc14cf68f2822553b69c (patch) | |
| tree | a7f520cce249cb22425460371a8e73b461aebbd5 /research/experiments/030-app-lifecycle/items.aup | |
| parent | 71e319b63edfbe7e0c54f75e4cafa849d9ced28d (diff) | |
| download | pure-93261d1c157e50f1ed2bbc14cf68f2822553b69c.tar.gz pure-93261d1c157e50f1ed2bbc14cf68f2822553b69c.zip | |
Measure how long an app changing module cannot answer, against a host restart (030)
An app of a million items (a list grown by doubling) or of a thousand, in
a host of apps, its store in RAM: the longest gap between two answered
writes while it changes module on SIGHUP (stopped and started again from
its store, 71e319b), and while the host is restarted. A thousand items:
1.59 ms against 3.05 (median of 20 and 10). A million: 150.64 ms against
149.73 (10 and 5): both are the store read again (pure_app_start, 142
ms), so changing does not answer sooner than restarting.
Diffstat (limited to 'research/experiments/030-app-lifecycle/items.aup')
| -rw-r--r-- | research/experiments/030-app-lifecycle/items.aup | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/research/experiments/030-app-lifecycle/items.aup b/research/experiments/030-app-lifecycle/items.aup new file mode 100644 index 0000000..b6d928b --- /dev/null +++ b/research/experiments/030-app-lifecycle/items.aup @@ -0,0 +1,28 @@ +record Item { + n = 0 +} +state items: list of Item +state more: list of Item +state hits = 0 +input seed = message { n: number } +input grow = message { step: number } +input add = message { step: number } +on seed { + items.append(Item { n: seed.n }) +} +on grow { + for i in items { + more.append(Item { n: i.n + grow.step }) + } + for m in more { + items.append(Item { n: m.n }) + } + for m in more { + more.remove(m) + } +} +on add { + hits = hits + add.step +} +view count = count(i in items where i.n > 0) +view total = hits |
