Help with optimizing a block

i went into a lot of detail about optimization before here: Frame rate, rendering and performance - #18 by sarpnt

as for your block, i tested with "init tty" and "forever { write abc }" running at the same time:


20% of the time is spent setting block attributes (that doesn't include any inputs, just the set attribute itself), 29% is spent in the join block, 33% in the split block. manipulating rings and setting definitions is just too slow, and i'm not really sure why you did it that way? it seems like a very overcomplicated way to do it, it would be far better to just store the screen text in a variable.

i'm guessing you didn't store the screen text in a variable because that wouldn't keep it nicely within the library, but if you consider that necessary you could probably just use a block variable.

i'll make a first draft with a regular global variable.