numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
18 stars 6 forks source link

Long string outputs in the terminal #15

Closed numeredev closed 1 year ago

numeredev commented 1 year ago

DESCRIPTION

Is your change request related to a problem? Please describe. Printing long strings to the terminal may take ages. Should be made faster.

Describe the solution you'd like If very long strings are printed to the terminal, the printing process takes very long and might even appear like an application hang. This problem should be addressed and mitigated.

Describe possible alternatives you've considered Do not print long strings at all, but that might not be a valid alternative.

Additional context Migrated from here: https://sourceforge.net/p/numere/tickets/774/

(Do not write below this line)


DEVS' SECTION

ANALYSIS

To replicate the problem one can use e.g. the command sequence url "https://www.numere.org/home", which will download the HTML representation of the page and print that to the terminal (takes about 2secs to render after download). Central function for printing is void GenericTerminal::ProcessOutput(int len, const std::string& sData) within gterm.cpp. You might want to measure the individual times needed within those functions by introducing g_logger.info("SOME MESSAGE") after including #include "../../kernel/core/io/logger.hpp" (don't keep it there. It's only for measurement purposes). This will print the messages with milli-second precision to <>/numere.log.

Candidates for the long rendering times might be unecessary renders (renders, moves a page down, renders again, and so on) or slow styling. Once you've some measurements, it's time for discussion.

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST