about summary refs log tree commit diff stats
path: root/055stream.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-02-29 22:18:26 -0800
committerKartik Agaram <vc@akkartik.com>2020-02-29 22:36:03 -0800
commit3ac95f6a40d3bda989727ad7137d07e65ef4ac1d (patch)
tree9cfb6ae13fa4340bacbd0a0ec982559f473298bb /055stream.subx
parent7ae5b7136800ffb4f3d49777029a7cc9653ec029 (diff)
downloadmu-3ac95f6a40d3bda989727ad7137d07e65ef4ac1d.tar.gz
6072
I just did an experiment, and test_apps is spending over half its time
(95 seconds that could be 40) redundantly clearing every stream before
every test. And some of those streams are _large_; the translators for
SubX and Mu use streams sizes pessimistically for the largest possible
program they can handle (1MB per segment).

A single test (the one in assort.subx) spends 24 seconds initializing 2
1MB-segments before processing a dozen lines of text in the blink of an
eye.

I'm not going to speed this up. But good to know.
Diffstat (limited to '055stream.subx')
-rw-r--r--055stream.subx2
1 files changed, 2 insertions, 0 deletions
diff --git a/055stream.subx b/055stream.subx
index 1250ffdc..15d82ce6 100644
--- a/055stream.subx
+++ b/055stream.subx
@@ -31,6 +31,8 @@ clear-stream:  # f: (addr stream byte)
     c7          0/subop/copy        0/mod/direct    0/rm32/eax    .           .             .           .           .               0/imm32           # copy to *eax
     # f->read = 0
     c7          0/subop/copy        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         0/imm32           # copy to *(eax+4)
+    # - clear all stream data
+    # - this isn't strictly necessary, and it can slow things down *a lot*, but better safe than sorry.
     # var curr/eax: (addr byte) = f->data
     81          0/subop/add         3/mod/direct    0/rm32/eax    .           .             .           .           .               0xc/imm32         # add to eax
 $clear-stream:loop: