https://gitlab.synchro.net/main/sbbs/-/commit/c5d806d626b4aaa5afee53b1
Modified Files:
src/sbbs3/ansi_terminal.cpp js_console.cpp terminal.h
Log Message:
Add a cursor position optimizer to the ANSI_Terminal class
(disabled by default, Deuce is pretty sure it'll break somethings)
The performance of some scripts (e.g. utopia.js) benefit from the filtering of redundant cursor position changes and though we can (with v3.21) check the console current_row/column properties in the script to avoid sending redundant changes to cursor position, that is not backwards compatible with Synchronet v3.20 since its console.gotoxy() method did *not* update the internal concept of where the cursor position is currently. So any optimization in the script itself would have to either:
a) be Synchronet-version specific or risk incorrectly filtering out cursor position changes that were not actually redundant, or
b) track the cursor position itself after every call to console.putmsg, write, print, etc.
I figured this simple optimization could be available to any script, if it wanted it, but the script should be sure to set the setting back (e.g. by using js.on_exit) to the value it had when the script was started.
The new JS 'console' property (and Terminal class member) is: optimize_gotoxy (defaults to false/off).
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net