about summary refs log tree commit diff stats
path: root/sieve.tlv
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-16 21:35:55 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-03-16 21:38:34 -0700
commitfffcc8b9abf43a69d71c37c92fc149f661dd6da1 (patch)
treec5a796db79955008c46a61bda54da7e41a47ffb7 /sieve.tlv
parentd6554919b1e2e5f598e7997297a358905ee54913 (diff)
downloadteliva-fffcc8b9abf43a69d71c37c92fc149f661dd6da1.tar.gz
stop running task.scheduler by default
sieve.tlv is 50% slower (18s vs 12s) with the new function call
instrumentation.
Diffstat (limited to 'sieve.tlv')
-rw-r--r--sieve.tlv28
1 files changed, 15 insertions, 13 deletions
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