From fffcc8b9abf43a69d71c37c92fc149f661dd6da1 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 16 Mar 2022 21:35:55 -0700 Subject: stop running task.scheduler by default sieve.tlv is 50% slower (18s vs 12s) with the new function call instrumentation. --- sieve.tlv | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'sieve.tlv') diff --git a/sieve.tlv b/sieve.tlv index 9677af4..e5852e5 100644 --- a/sieve.tlv +++ b/sieve.tlv @@ -25,14 +25,17 @@ Window: >Window = curses.stdscr() - __teliva_timestamp: original - doc:blurb: - >To show a brief description of the app on the 'big picture' screen, put the text in a special buffer called 'doc:blurb'. - > - >You can also override the default big picture screen entirely by creating a buffer called 'doc:main'. -- __teliva_timestamp: - >Sat Feb 26 21:50:11 2022 main: >function main() + > task.spawn(main_task) + > task.scheduler() + > Window:refresh() + > Window:getch() + >end +- __teliva_timestamp: original + main_task: + >function main_task() + > Window:clear() > local c = task.Channel:new() > task.spawn(counter, c) > for i=1,10 do @@ -64,8 +67,8 @@ >end - __teliva_timestamp: >Sat Feb 26 21:55:46 2022 - main: - >function main() + main_task: + >function main_task() > local primes = task.Channel:new() > task.spawn(sieve, primes) > for i=1,10 do @@ -104,8 +107,8 @@ >Sat Feb 26 22:09:47 2022 __teliva_note: >infinite primes - main: - >function main() + main_task: + >function main_task() > local primes = task.Channel:new() > task.spawn(sieve, primes) > while true do @@ -120,8 +123,8 @@ >clear screen when it fills up; pause on keypress > >In Teliva getch() implicitly refreshes the screen. - main: - >function main() + main_task: + >function main_task() > Window:nodelay(true) > Window:clear() > local primes = task.Channel:new() @@ -139,7 +142,6 @@ > end > print('key pressed; done') > Window:nodelay(false) - > Window:getch() >end - __teliva_timestamp: >Sat Feb 26 22:27:25 2022 -- cgit 1.4.1-2-gfad0