Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Terminal WebGL Renderer #85971

Closed
3 tasks done
Tyriar opened this issue Dec 2, 2019 · 5 comments
Closed
3 tasks done

Test: Terminal WebGL Renderer #85971

Tyriar opened this issue Dec 2, 2019 · 5 comments

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 2, 2019

Refs: #84949

Complexity: 5


A new WebGL renderer is available for the terminal which is significantly faster than both the canvas and dom renderers. To enable it:

"terminal.integrated.rendererType": "experimentalWebgl"

This is a rewrite of all the rendering code which includes basically everything inside the terminal panel. You can read about some of the improvements made in the PR, but basically:

  • Selection color can now be opaque as it is drawn under the foreground
  • Characters are no longer clipped on the sides/top/bottom
  • Rendering of all characters is much faster

Do some exploratory testing of the terminal, here are some ideas of where to start:

Here's a list of known issues (there aren't many):

@joaomoreno
Copy link
Member

This is so good, I'm switching to this for self hosting.

@joaomoreno
Copy link
Member

@Tyriar Fantastic work here, really works great! 👏

Some perf numbers, running tree -a in vscode with canvas:

tree -a  0.56s user 0.63s system 57% cpu 2.062 total

When running with webgl:

tree -a  0.54s user 0.51s system 71% cpu 1.455 total

2s down to 1.5s, that's very impressive.

@joaomoreno joaomoreno removed their assignment Dec 3, 2019
@Tyriar
Copy link
Member Author

Tyriar commented Dec 3, 2019

@joaomoreno good to hear! For these types of commands the webgl renderer ends up rendering more frames with less CPU time too 🙂, less rendering time = more parsing time.

@connor4312
Copy link
Member

connor4312 commented Dec 3, 2019

Color test script if others find it useful:

const chalk = require('chalk');

const modifiers = ["reset", "bold", "dim", "italic", "underline", "inverse", "hidden", "strikethrough", "visible"];
const colors = ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "blackBright", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright", "cyanBright", "whiteBright"];

const colWidth = 20;

for (const modifier of modifiers) {
    process.stdout.write(chalk[modifier](modifier.padEnd(colWidth)));
}

process.stdout.write('\r\n');
for (const color of colors) {
    for (const modifier of modifiers) {
        process.stdout.write(chalk[modifier][color](color.padEnd(colWidth)));
    }
    process.stdout.write('\r\n');
}

And naughty strings: https://github.com/minimaxir/big-list-of-naughty-strings/blob/master/blns.txt

@rebornix
Copy link
Member

rebornix commented Dec 3, 2019

Incredible performance ⚡️ I tried to cat a relative large log file (300MB, 2M lines)

WebGL

cat basedata.txt  0.01s user 2.51s system 5% cpu 47.281 total

Canvas

cat basedata.txt  0.01s user 3.01s system 2% cpu 2:24.70 total

DOM

after waiting for 10 minutes, it didn't finish but stopped printing ...

@rebornix rebornix removed their assignment Dec 4, 2019
@rebornix rebornix closed this as completed Dec 4, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants