馃殌 Performance tuning & bugfix #1111

Merged
merged 3 commits into from Dec 14, 2016

Projects

None yet

6 participants

@dotcypress
Contributor
dotcypress commented Dec 11, 2016 edited

Fix unicode performance (cause separated html element per character is too slow)

馃檶 Make Hyper fast again!

UPD: 馃毃 this PR also will fix > 5 opened issues

@matheuss @CodeTheory @ppot @rauchg

@dotcypress dotcypress Perfomance tuning
41ded83
@matheuss
Collaborator

@dotcypress just tested here and the performance looks like the same as before 馃槹 Each braille char is still alone inside its own span 馃
Also, if I change the font size via Cmd + + and/or Cmd + i I get some weird behavior 馃槱

screen shot 2016-12-11 at 8 14 19 am

@dotcypress
Contributor

@matheuss yes, we still need to wrap each non latin symbols to span.

But now, huge amount of spans created if string contains at least 1 non latin character, see screenshots below, all spans are red 馃槀

Before:
screen shot 2016-12-11 at 9 51 19 am

After:
screen shot 2016-12-11 at 9 53 43 am

Currently i'm trying to fix issue with increasing/decreasing font size, stay tuned 馃槑

@dotcypress dotcypress cleanup matchesContainer method
8939040
@dotcypress
Contributor
dotcypress commented Dec 12, 2016 edited

Update:

I can reproduce bug with vtop and changing font size even on master branch.
screen shot 2016-12-11 at 4 13 57 pm

After font change, some characters are gone, for example:
" CPU USAGE " -> "CPU USAGE"
screen shot 2016-12-11 at 11 33 39 am

But if you try this: curl https://gist.githubusercontent.com/dotcypress/29ed6c767e824b6241b7465f9d036567/raw/c4578a1e43de8cb4f2fb29991b10baffeb195a79/vtop-snapshot.txt | cat you can change font size without that weird behavior. 馃

@matheuss

@dotcypress dotcypress changed the title from 馃殌 Performance tuning to 馃殌 Performance tuning & bugfix Dec 13, 2016
@dotcypress dotcypress fixes #1131
d03668a
@dimitrieh

will this fix slow scrolling in for example micro-editor.github.io and slow performance with cat long files?

@dotcypress
Contributor

@dimitrieh not fully fixed but speed of scrolling is better than in 1.0.0

@rauchg rauchg merged commit d6316dd into zeit:master Dec 14, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dotcypress dotcypress deleted the dotcypress:unicode-perfomance-fix branch Dec 14, 2016
@b3ll
b3ll commented Dec 18, 2016

@dotcypress whilst this is a clever way of speeding things up, not all characters are displayed as px, which causes layout to break. In my case, I have an emoji in the prompt (OS X, 10.12), and this causes all subsequent characters to be displayed wrongly by about half a character's width (or more).

For this solution to work, any special spans should have their width set by either the DOM automatically, or using canvas's text measuring functions, rather than a global special span width.

In the screenshot, the cursor is supposed to be right after the -la, but it ends up being an entire character's width off.

span

@rauchg
Contributor
rauchg commented Dec 18, 2016
@b3ll
b3ll commented Dec 18, 2016

perhaps? I'm not entirely sure what the best fix is, I'm not super familiar with current web technologies. I just do know that setting a global CSS style for all specially marked unicode characters won't work.

A CSS style for each character should work, but I can see other languages / character sets causing performance to take a nose dive.

@rauchg
Contributor
rauchg commented Dec 18, 2016
@alexandernst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment