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

Terminal.app is very slow with Pragmata fonts #76

Closed
cedeber opened this Issue Sep 19, 2017 · 72 comments

Comments

@cedeber

cedeber commented Sep 19, 2017

Both of Pragmata (normal and mono) make Terminal.app very slow on macOS. Everything runs perfectly with SF Mono for instance, so it doesn't look like that it is a generic performance problem (I reset the Terminal to be sure)
Strangely, PragmataPro Mono Bold is not affected and the Terminal runs smoothly.

@Tekl

This comment has been minimized.

Tekl commented Sep 22, 2017

I can confirm that PragmataPro slows down the frame rate of scrolling. In my case it helped to use the PragmataPro Mono without ligatures.

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Sep 25, 2017

Thanks @Tekl and @cedeber to let me know it. I'm almost sure that this is caused by the high number of glyphs of PragmataPro (9000 vs. ≈300 of the usual monospaced). The solution is to create a light weight version with ligatures. To do this I need to know which are the essential Unicode sets for you. Could you help me in this choice?

@graycrow

This comment has been minimized.

graycrow commented Nov 2, 2017

I have exactly the same issue. Especially the apps using ncurses library are extremely slow. To answer your question, I can not speak for everyone of course, but for me it would be acceptable if light version will include Basic Latin, Latin-1 Supplement, Latin Extended-A, Cyrillic and Box Drawing.

@andreypopp

This comment has been minimized.

andreypopp commented Nov 24, 2017

Can confirm, the slowdown is even more noticable when inside tmux.

@chauncey-garrett

This comment has been minimized.

chauncey-garrett commented Nov 28, 2017

I use tmux as well and it's absolutely unusable with PragmataPro in Terminal.app. PragmataPro Essential works fine.

@fabrizioschiavi I think if you were to make a subset similar to Fura Code Powerline (basically, FiraCode with Nerd Fonts -- https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FiraCode) that it work better. I've been using Fura Code without problems for a while now.

@Porges

This comment has been minimized.

Porges commented Dec 5, 2017

I've also noticed that it's really slow in notepad. I don't remember it being this bad in the past, though, so maybe there's something that can be fixed? It seems to be fine in Visual Studio or gVim...

@mengelbrecht

This comment has been minimized.

mengelbrecht commented Dec 9, 2017

Like @Tekl I noticed that using PragmataPro Mono without ligatures is much faster than using the other variants.

@railwaycat

This comment has been minimized.

railwaycat commented Dec 21, 2017

Same case for me. I notice that iTerm handles it a bit better, but can still feel a lag comparing with other fonts like SF Mono.

Even with PragmataPro Mono without ligatures, when scrolling fast (for example compiling with tons output lines or keep scrolling a large text file), the slow/lag appears.

A PragmataPro lite would a great idea!

@andreypopp

This comment has been minimized.

andreypopp commented Dec 21, 2017

fwiw I've switched to alacritty which is super fast. It doesn't support ligatures but PragmataPro is great even without them.

@fabrizioschiavi fabrizioschiavi added this to ToDo in 0.827 Mar 22, 2018

@fabrizioschiavi fabrizioschiavi moved this from ToDo to InProgress in 0.827 May 12, 2018

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Jun 1, 2018

I decided to release a new Essential PragmataPro version in order to fix this issue.
Could you help me to find the very essential Unicode ranges and OpenType features, please?
https://www.fsd.it/2018/06/01/essential-pragmatapro-survey/

@andreypopp

This comment has been minimized.

andreypopp commented Jun 1, 2018

After Alacritty I've tried Kitty and settled with it — it supports ligatures and performs very well even with such big fonts as PragmataPro.

Screenshot:
plain-light

@jordwalke

This comment has been minimized.

jordwalke commented Jun 2, 2018

I can confirm Kitty is super fast with PP. MacVim chokes on the number of glyphs I believe (even without ligatures, but especially with ligatures).

@carloscabanero

This comment has been minimized.

carloscabanero commented Jun 2, 2018

My 2 cents as I would love to see this fixed too. Within Blink PP flies, but the liga is definitely slower. In our case you only notice it when loading or resizing, scroll is ok and cat large files is good too, but if you are used to the non-liga will notice the difference.

Just filled out the survey, but let me know if you would like us to help you test anything, we may have better control of the rendering.

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Jun 4, 2018

Thanks friends!
I have a suspect now: probably 'CALT' Open Type feature is the very guilty of this issue.
Probably OpenType experts like @tphinney @schriftgestalt @arialcrime @FontBoss @LettError can help

@LettError

This comment has been minimized.

LettError commented Jun 4, 2018

Make simpler fonts?

@schriftgestalt

This comment has been minimized.

schriftgestalt commented Jun 4, 2018

I don’t think that the number of characters is to blame. Have you tried to remove all OpenType features? Then add them piece by piece and see then it becomes slow again.

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Jun 4, 2018

Good suggestion! Thanks Georg!

@pkazmier

This comment has been minimized.

pkazmier commented Jun 5, 2018

I, too, can vouch for Kitty with Pragmata Pro - works great!

@andreypopp off-topic, but what nvim theme are you using? Although I've always preferred a dark theme, your screenshot has intrigued me. It looks super clean with Pragmata Pro and its lovely bold font.

@dop

This comment has been minimized.

dop commented Jun 5, 2018

Having the same issue here, Terminal.app is unusable.

@stefanfrede

This comment has been minimized.

stefanfrede commented Jun 30, 2018

I too have the problem with the Terminal.app, and I think that switching the editor can't be the solution.

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Jul 16, 2018

@LettError I just tried to remove 4000 glyphs but nothing changed. I suspect that the number of glyphs aren’t the cause. Probably some hide and untouchable glyph for Terminal?

@LettError

This comment has been minimized.

LettError commented Jul 16, 2018

@fabrizioschiavi fabrizioschiavi moved this from InProgress to Done in 0.827 Jul 29, 2018

@tuscland

This comment has been minimized.

tuscland commented Aug 9, 2018

@fabrizioschiavi I noticed something recently.
On macOS, if you disable subpixel font rendering, Terminal becomes smooth and fast again. (In System Preferences / General, disable "Use LCD font smoothing when available.)

FYI, macOS Mojave might not have subpixel rendering anymore.

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Aug 9, 2018

Thanks @tuscland for letting me know this!
Anyway don’t worry because with the great help of @kelas the next release will be 10x faster!

@kelas

This comment has been minimized.

kelas commented Aug 9, 2018

Hello everybody,

I'm helping out @fabrizioschiavi with profiling and optimisations for the upcoming version of calt feature. Could someone please share a set of practical steps to reproduce an "unusable" Terminal.app on your system, using 826 Regular with ligatures enabled and empty scroll buffer? Please include your macOS version, font and window sizes, full content of the screen buffer and your system-wide sub-pixel setting.

This would be of immense help!

k.

@cedeber

This comment has been minimized.

cedeber commented Aug 9, 2018

Hi. I notice no differences with or without subpixel optimization. I did a copy of the default "Pro" theme and changed the font to Pragmata. I am using macOS 10.13.6 on a MacBook Pro 13" end 2013. The performance issue is visible after a few ls. I've got nothing special into the folder.

@tuscland

This comment has been minimized.

tuscland commented Aug 10, 2018

Hi @cedeber,
You are right. I suppose I got fooled by the fact I have two terminals running here with lots of data but for some reason there's no slowdown at all. I incorrectly inferred that my recent change to subpixel rendering was the reason it was smooth.
Sorry for the noise...

@schriftgestalt

This comment has been minimized.

schriftgestalt commented Aug 13, 2018

What I do in cases like this is to remove stuff from the font until the issue is fixed. Then add different pieces back to see when the issue reappears.

So:

  • remove all OpenType features
  • remove all unencoded glyphs
  • remove half of non ascii glyphs

And so on. That way I usually have the culprit in 10-20 min.

@kelas

This comment has been minimized.

kelas commented Aug 13, 2018

@schriftgestalt Thanks — that's pretty much exactly what we've done here so far. This is called binary search, and it is known to work really well :)

The problem is that Terminal.app is producing absolutely disastrous results for some people, and the lucky ones can hardly reproduce anything at all.

@kelas

This comment has been minimized.

kelas commented Aug 13, 2018

@carloscabanero It all depends on the specific strategy of glyph atlas maintenance. I can easily imagine there is someone out there re-rasterizing ALL glyphs in the font at once, which is what they probably consider good enough for "most fonts out there" (although I'm really hoping nobody is doing something like that). But regardless, Pragmata Pro is a clear edge case, and it tests the limits of most editors and terminal emulators it is used with like nothing else.

@cedeber

This comment has been minimized.

cedeber commented Aug 13, 2018

I just had a crazy idea and thought about why not test zsh instead of sh.
So, I did it and I had a strange behavior: Different scroll performance depending on what shown on the screen. I did a copy of the Pro theme.

This is the console log:

Last login: Mon Aug 13 23:31:29 on ttys002
MacBook-Pro-de-Cedric:~ cedeber$ zsh
[Oh My Zsh] Would you like to check for updates? [Y/n]: Y
Updating Oh My Zsh
remote: Counting objects: 1575, done.
remote: Compressing objects: 100% (786/786), done.
remote: Total 1575 (delta 842), reused 1398 (delta 689), pack-reused 0
Receiving objects: 100% (1575/1575), 364.34 KiB | 585.00 KiB/s, done.
Resolving deltas: 100% (842/842), completed with 186 local objects.
From https://github.com/robbyrussell/oh-my-zsh
 * branch              master     -> FETCH_HEAD
   d848c948..af1709cf  master     -> origin/master
Updating d848c948..af1709cf
Fast-forward
 LICENSE.txt                                             |    2 +-
 README.md                                               |   51 +-
 custom/themes/example.zsh-theme                         |    4 +
 lib/compfix.zsh                                         |   44 +-
 lib/completion.zsh                                      |    3 +
 lib/correction.zsh                                      |    1 +
 lib/directories.zsh                                     |    4 -
 lib/functions.zsh                                       |   18 +-
 lib/git.zsh                                             |   14 +-
 lib/history.zsh                                         |   56 +-
 lib/spectrum.zsh                                        |    2 +-
 lib/termsupport.zsh                                     |    2 +-
 oh-my-zsh.sh                                            |   40 +-
 plugins/adb/README.md                                   |    2 +-
 plugins/adb/_adb                                        |   11 +-
 plugins/archlinux/README.md                             |   33 +-
 plugins/archlinux/archlinux.plugin.zsh                  |   70 +-
 plugins/asdf/asdf.plugin.zsh                            |   18 +-
 plugins/autojump/autojump.plugin.zsh                    |    6 +-
 plugins/aws/aws.plugin.zsh                              |   30 +-
 plugins/bbedit/README.md                                |    6 +-
 plugins/bgnotify/README.md                              |    4 +-
 plugins/bundler/README.md                               |    6 +-
 plugins/bundler/bundler.plugin.zsh                      |    7 +-
 plugins/bwana/bwana.plugin.zsh                          |    4 +-
 plugins/cargo/_cargo                                    |    5 +-
 plugins/catimg/catimg.plugin.zsh                        |    2 +-
 plugins/catimg/catimg.sh                                |    2 +-
 plugins/chruby/chruby.plugin.zsh                        |   22 +-
 plugins/chucknorris/LICENSE                             |    2 -
 plugins/chucknorris/fortunes/chucknorris                | 2545 ++++++++++++++++++++++++++++++++++++++---------
 plugins/coffee/_coffee                                  |    4 +-
 plugins/colored-man-pages/colored-man-pages.plugin.zsh  |    2 +-
 plugins/colorize/colorize.plugin.zsh                    |    5 +-
 plugins/command-not-found/command-not-found.plugin.zsh  |    2 +-
 plugins/common-aliases/common-aliases.plugin.zsh        |    4 +-
 plugins/composer/composer.plugin.zsh                    |    2 +-
 plugins/copydir/README.md                               |   10 +
 plugins/copyfile/README.md                              |   10 +
 plugins/dash/dash.plugin.zsh                            |   86 ++
 plugins/debian/debian.plugin.zsh                        |   11 +-
 plugins/dirhistory/dirhistory.plugin.zsh                |   57 ++
 plugins/django/django.plugin.zsh                        |    1 +
 plugins/docker-compose/_docker-compose                  |   38 +-
 plugins/docker-compose/docker-compose.plugin.zsh        |    2 +
 plugins/docker-machine/README.md                        |   19 +
 plugins/docker-machine/_docker-machine                  |  359 +++++++
 plugins/docker-machine/docker-machine.plugin.zsh        |   33 +
 plugins/docker/README.md                                |    2 +-
 plugins/docker/_docker                                  |  500 +++++++---
 plugins/doctl/doctl.plugin.zsh                          |    9 +
 plugins/dotenv/README.md                                |   19 +-
 plugins/dotenv/dotenv.plugin.zsh                        |   15 +-
 plugins/droplr/README.md                                |    2 +-
 plugins/eecms/eecms.plugin.zsh                          |   20 +
 plugins/emacs/emacs.plugin.zsh                          |    2 +-
 plugins/ember-cli/README.md                             |    4 +-
 plugins/ember-cli/ember-cli.plugin.zsh                  |    2 +-
 plugins/emoji/README.md                                 |    6 +-
 plugins/emoji/emoji-data.txt                            |    4 +-
 plugins/emoji/update_emoji.pl                           |   12 +-
 plugins/emotty/emotty.plugin.zsh                        |    5 +-
 plugins/extract/_extract                                |    2 +-
 plugins/extract/extract.plugin.zsh                      |    8 +-
 plugins/fasd/fasd.plugin.zsh                            |    2 +-
 plugins/fedora/README.md                                |    3 -
 plugins/fedora/fedora.plugin.zsh                        |   17 +-
 plugins/forklift/README.md                              |    2 +-
 plugins/forklift/forklift.plugin.zsh                    |  100 +-
 plugins/frontend-search/README.md                       |   12 +-
 plugins/frontend-search/frontend-search.plugin.zsh      |   10 +-
 plugins/geeknote/README.md                              |    2 +-
 plugins/git-extras/README.md                            |    2 +-
 plugins/git-extras/git-extras.plugin.zsh                |    6 +-
 plugins/git-flow-avh/git-flow-avh.plugin.zsh            |  823 ++++++++-------
 plugins/git-flow/git-flow.plugin.zsh                    |    4 +
 plugins/git-hubflow/git-hubflow.plugin.zsh              |    2 +-
 plugins/git-prompt/git-prompt.plugin.zsh                |    2 +-
 plugins/git-prompt/gitstatus.py                         |    4 +-
 plugins/git/git.plugin.zsh                              |   19 +-
 plugins/github/README.md                                |    6 +-
 plugins/github/_hub                                     |    2 +
 plugins/github/github.plugin.zsh                        |   10 +-
 plugins/gitignore/gitignore.plugin.zsh                  |    4 +-
 plugins/globalias/README.md                             |    2 +-
 plugins/golang/golang.plugin.zsh                        |    4 +-
 plugins/gpg-agent/gpg-agent.plugin.zsh                  |   49 +-
 plugins/gradle/gradle.plugin.zsh                        |    6 +-
 plugins/hanami/README.md                                |   32 +
 plugins/hanami/hanami.plugin.zsh                        |   19 +
 plugins/helm/helm.plugin.zsh                            |    7 +
 plugins/heroku/_heroku                                  |  151 ---
 plugins/heroku/heroku.plugin.zsh                        |    9 +
 plugins/history-substring-search/README.md              |    6 +-
 plugins/homestead/homestead.plugin.zsh                  |   10 +
 plugins/httpie/README.md                                |    4 +-
 plugins/iterm2/iterm2.plugin.zsh                        |   68 ++
 plugins/jake-node/jake-node.plugin.zsh                  |    4 +-
 plugins/jira/README.md                                  |    1 +
 plugins/jira/_jira                                      |    1 +
 plugins/jira/jira.plugin.zsh                            |   26 +-
 plugins/kitchen/_kitchen                                |    4 +-
 plugins/kops/kops.plugin.zsh                            |    9 +
 plugins/kube-ps1/README.md                              |   81 ++
 plugins/kube-ps1/kube-ps1.plugin.zsh                    |  147 +++
 plugins/kubectl/kubectl.plugin.zsh                      |   69 +-
 plugins/laravel5/laravel5.plugin.zsh                    |    2 +-
 plugins/last-working-dir/last-working-dir.plugin.zsh    |    6 +-
 plugins/lein/_lein                                      |   69 ++
 plugins/lein/lein.plugin.zsh                            |   43 -
 plugins/lighthouse/lighthouse.plugin.zsh                |    2 +-
 plugins/lol/lol.plugin.zsh                              |    3 +-
 plugins/magic-enter/Readme.md                           |   14 +
 plugins/magic-enter/magic-enter.plugin.zsh              |   24 +
 plugins/meteor/_meteor                                  |   47 +-
 plugins/minikube/minikube.plugin.zsh                    |    6 +
 plugins/mix-fast/README.md                              |    4 +-
 plugins/mix-fast/mix-fast.plugin.zsh                    |    2 +-
 plugins/mix/_mix                                        |   30 +-
 plugins/mvn/README.md                                   |    1 +
 plugins/mvn/mvn.plugin.zsh                              |  162 ++-
 plugins/nmap/nmap.plugin.zsh                            |   14 +-
 plugins/npm/README.md                                   |   26 +
 plugins/npm/npm.plugin.zsh                              |   13 +-
 plugins/npx/README.md                                   |   31 +
 plugins/npx/npx.plugin.zsh                              |    7 +
 plugins/nvm/_nvm                                        |   19 +-
 plugins/oc/oc.plugin.zsh                                |    7 +
 plugins/osx/README.md                                   |   27 +
 plugins/osx/osx.plugin.zsh                              |  269 +----
 plugins/osx/spotify                                     |  438 ++++++++
 plugins/pass/_pass                                      |   17 +-
 plugins/per-directory-history/README.md                 |   24 +-
 plugins/per-directory-history/per-directory-history.zsh |    2 +-
 plugins/percol/README.md                                |   20 +
 plugins/percol/percol.plugin.zsh                        |   22 +
 plugins/perl/perl.plugin.zsh                            |    2 +-
 plugins/perms/README.md                                 |    6 +-
 plugins/perms/perms.plugin.zsh                          |    8 +-
 plugins/pip/_pip                                        |    1 +
 plugins/pod/_pod                                        |    2 +-
 plugins/pow/pow.plugin.zsh                              |    2 +-
 plugins/pyenv/pyenv.plugin.zsh                          |   60 +-
 plugins/python/_python                                  |   54 -
 plugins/rails/_rails                                    |    3 +
 plugins/rails/rails.plugin.zsh                          |    8 +-
 plugins/rake-fast/README.md                             |    2 +-
 plugins/rand-quote/README.md                            |   15 +
 plugins/rand-quote/rand-quote.plugin.zsh                |   36 +-
 plugins/rbenv/rbenv.plugin.zsh                          |    3 +
 plugins/repo/README.md                                  |    2 +-
 plugins/ruby/ruby.plugin.zsh                            |    8 +
 plugins/rust/_rust                                      |   67 +-
 plugins/safe-paste/safe-paste.plugin.zsh                |    4 +-
 plugins/sbt/_sbt                                        |    1 +
 plugins/sbt/sbt.plugin.zsh                              |    1 +
 plugins/scala/_scala                                    |    4 +-
 plugins/scd/README.md                                   |    4 +-
 plugins/scw/_scw                                        |    2 +-
 plugins/shrink-path/README.md                           |    6 +-
 plugins/shrink-path/shrink-path.plugin.zsh              |   17 +-
 plugins/spring/README.md                                |   10 +-
 plugins/sprunge/sprunge.plugin.zsh                      |   22 +-
 plugins/ssh-agent/README.md                             |    4 +-
 plugins/ssh-agent/ssh-agent.plugin.zsh                  |    7 +-
 plugins/sublime/README.md                               |    6 +-
 plugins/sublime/sublime.plugin.zsh                      |   48 +-
 plugins/svn/README.md                                   |    2 +-
 plugins/swiftpm/_swift                                  |  362 +++++++
 plugins/symfony2/symfony2.plugin.zsh                    |    2 +
 plugins/systemadmin/systemadmin.plugin.zsh              |    1 -
 plugins/taskwarrior/README.md                           |    2 +-
 plugins/taskwarrior/_task                               |    2 +-
 plugins/terraform/README.md                             |   14 +-
 plugins/terraform/_terraform                            |  190 +++-
 plugins/terraform/terraform.plugin.zsh                  |    7 +
 plugins/textastic/README.md                             |    4 +-
 plugins/thefuck/thefuck.plugin.zsh                      |    5 +-
 plugins/tmux/tmux.plugin.zsh                            |  153 ++-
 plugins/tmuxinator/_tmuxinator                          |   55 +-
 plugins/tmuxinator/tmuxinator.plugin.zsh                |    5 +
 plugins/transfer/README.md                              |   24 +
 plugins/transfer/transfer.plugin.zsh                    |   67 ++
 plugins/ubuntu/readme.md                                |    2 +-
 plugins/ubuntu/ubuntu.plugin.zsh                        |   79 +-
 plugins/ufw/_ufw                                        |  115 +++
 plugins/urltools/urltools.plugin.zsh                    |    2 +-
 plugins/vagrant-prompt/README.md                        |    6 +
 plugins/vagrant-prompt/vagrant-prompt.plugin.zsh        |   38 +
 plugins/vagrant/_vagrant                                |    4 +-
 plugins/vault/README.md                                 |    8 +-
 plugins/vim-interaction/vim-interaction.plugin.zsh      |   10 +-
 plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh  |   18 +-
 plugins/vscode/README.md                                |   38 +
 plugins/vscode/vscode.plugin.zsh                        |   19 +
 plugins/vundle/vundle.plugin.zsh                        |    2 +-
 plugins/wd/README.md                                    |   23 +-
 plugins/wd/_wd.sh                                       |   21 +-
 plugins/wd/wd.sh                                        |   71 +-
 plugins/web-search/web-search.plugin.zsh                |    2 +
 plugins/wp-cli/README.md                                |    8 +-
 plugins/wp-cli/wp-cli.plugin.zsh                        |    2 +-
 plugins/xcode/README.md                                 |    6 +-
 plugins/xcode/xcode.plugin.zsh                          |   22 +-
 plugins/yarn/README.md                                  |   33 +
 plugins/yarn/_yarn                                      |  345 +++++++
 plugins/yarn/yarn.plugin.zsh                            |   99 +-
 plugins/z/z.1                                           |    6 +-
 plugins/z/z.sh                                          |   75 +-
 plugins/zeus/_zeus                                      |  110 +-
 plugins/zsh-navigation-tools/LICENSE                    |    8 +-
 plugins/zsh_reload/README.md                            |   23 +
 plugins/zsh_reload/zsh_reload.plugin.zsh                |   19 +-
 templates/zshrc.zsh-template                            |   16 +-
 themes/adben.zsh-theme                                  |    6 +-
 themes/agnoster.zsh-theme                               |    6 +-
 themes/arrow.zsh-theme                                  |    2 +-
 themes/avit.zsh-theme                                   |    6 +-
 themes/bira.zsh-theme                                   |    2 +-
 themes/clean.zsh-theme                                  |    2 +-
 themes/cloud.zsh-theme                                  |    4 +-
 themes/duellj.zsh-theme                                 |    2 +-
 themes/emotty.zsh-theme                                 |    4 +
 themes/example.zsh-theme                                |    5 -
 themes/funky.zsh-theme                                  |    4 +-
 themes/gallifrey.zsh-theme                              |    2 +-
 themes/gnzh.zsh-theme                                   |    1 -
 themes/half-life.zsh-theme                              |    6 +-
 themes/itchy.zsh-theme                                  |    2 -
 themes/jreese.zsh-theme                                 |    2 -
 themes/lambda.zsh-theme                                 |    2 -
 themes/lukerandall.zsh-theme                            |    2 +-
 themes/macovsky-ruby.zsh-theme                          |    2 +-
 themes/macovsky.zsh-theme                               |    2 +-
 themes/mh.zsh-theme                                     |    4 +-
 themes/michelebologna.zsh-theme                         |   10 +-
 themes/mikeh.zsh-theme                                  |    4 +-
 themes/mortalscumbag.zsh-theme                          |    6 +
 themes/philips.zsh-theme                                |    2 +-
 themes/pmcgee.zsh-theme                                 |    2 +-
 themes/rkj-repos.zsh-theme                              |    7 +-
 themes/rkj.zsh-theme                                    |    2 +-
 themes/simple.zsh-theme                                 |    2 +-
 themes/sorin.zsh-theme                                  |    8 +-
 themes/sporty_256.zsh-theme                             |    2 +-
 themes/steeef.zsh-theme                                 |    9 +-
 themes/sunaku.zsh-theme                                 |    1 -
 themes/tonotdo.zsh-theme                                |    4 +-
 themes/xiong-chiamiov-plus.zsh-theme                    |    2 +-
 themes/xiong-chiamiov.zsh-theme                         |    2 +-
 tools/check_for_upgrade.sh                              |   10 +-
 tools/install.sh                                        |   16 +-
 tools/theme_chooser.sh                                  |    2 +-
 tools/upgrade.sh                                        |    2 +-
 254 files changed, 7566 insertions(+), 2500 deletions(-)
 create mode 100644 custom/themes/example.zsh-theme
 delete mode 100644 plugins/chucknorris/LICENSE
 create mode 100644 plugins/copydir/README.md
 create mode 100644 plugins/copyfile/README.md
 create mode 100644 plugins/dash/dash.plugin.zsh
 create mode 100644 plugins/docker-machine/README.md
 create mode 100644 plugins/docker-machine/_docker-machine
 create mode 100644 plugins/docker-machine/docker-machine.plugin.zsh
 create mode 100644 plugins/doctl/doctl.plugin.zsh
 create mode 100644 plugins/eecms/eecms.plugin.zsh
 delete mode 100644 plugins/fedora/README.md
 mode change 100644 => 120000 plugins/fedora/fedora.plugin.zsh
 mode change 100644 => 100755 plugins/git-flow-avh/git-flow-avh.plugin.zsh
 create mode 100644 plugins/hanami/README.md
 create mode 100644 plugins/hanami/hanami.plugin.zsh
 create mode 100644 plugins/helm/helm.plugin.zsh
 delete mode 100644 plugins/heroku/_heroku
 create mode 100644 plugins/heroku/heroku.plugin.zsh
 create mode 100644 plugins/homestead/homestead.plugin.zsh
 create mode 100644 plugins/iterm2/iterm2.plugin.zsh
 create mode 100644 plugins/kops/kops.plugin.zsh
 create mode 100644 plugins/kube-ps1/README.md
 create mode 100644 plugins/kube-ps1/kube-ps1.plugin.zsh
 create mode 100644 plugins/lein/_lein
 delete mode 100644 plugins/lein/lein.plugin.zsh
 create mode 100644 plugins/magic-enter/Readme.md
 create mode 100644 plugins/magic-enter/magic-enter.plugin.zsh
 create mode 100644 plugins/minikube/minikube.plugin.zsh
 create mode 100644 plugins/npm/README.md
 create mode 100644 plugins/npx/README.md
 create mode 100644 plugins/npx/npx.plugin.zsh
 create mode 100644 plugins/oc/oc.plugin.zsh
 create mode 100644 plugins/osx/spotify
 create mode 100644 plugins/percol/README.md
 create mode 100644 plugins/percol/percol.plugin.zsh
 delete mode 100644 plugins/python/_python
 create mode 100644 plugins/rand-quote/README.md
 create mode 100644 plugins/swiftpm/_swift
 create mode 100644 plugins/terraform/terraform.plugin.zsh
 create mode 100644 plugins/tmuxinator/tmuxinator.plugin.zsh
 create mode 100644 plugins/transfer/README.md
 create mode 100644 plugins/transfer/transfer.plugin.zsh
 create mode 100644 plugins/ufw/_ufw
 create mode 100644 plugins/vagrant-prompt/README.md
 create mode 100644 plugins/vagrant-prompt/vagrant-prompt.plugin.zsh
 create mode 100644 plugins/vscode/README.md
 create mode 100644 plugins/vscode/vscode.plugin.zsh
 create mode 100644 plugins/yarn/README.md
 create mode 100644 plugins/yarn/_yarn
 create mode 100644 plugins/zsh_reload/README.md
 delete mode 100644 themes/example.zsh-theme
Current branch master is up to date.
         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       
Hooray! Oh My Zsh has been updated and/or is at the current version.
To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh
Get your Oh My Zsh swag at:  http://shop.planetargon.com/

 23:32:03  ~ 
$ ls
Applications                 Luniitheque                  Sites
Desktop                      Movies                       Snapshots
Documents                    Music                        cedeber.hvault
Downloads                    Pictures                     certbot.log
Library                      Public                       safari_custom_stylesheet.css

 23:32:05  ~ 
$ ls
Applications                 Luniitheque                  Sites
Desktop                      Movies                       Snapshots
Documents                    Music                        cedeber.hvault
Downloads                    Pictures                     certbot.log
Library                      Public                       safari_custom_stylesheet.css

 23:32:06  ~ 
$ ls
Applications                 Luniitheque                  Sites
Desktop                      Movies                       Snapshots
Documents                    Music                        cedeber.hvault
Downloads                    Pictures                     certbot.log
Library                      Public                       safari_custom_stylesheet.css

 23:32:07  ~ 
$ ls
Applications                 Luniitheque                  Sites
Desktop                      Movies                       Snapshots
Documents                    Music                        cedeber.hvault
Downloads                    Pictures                     certbot.log
Library                      Public                       safari_custom_stylesheet.css

 23:32:08  ~ 
$ 
  • the lines with the pipe | sign create the most lag.
  • the last lines, resulting from the ls command shown some difficulties to scroll smoothly
  • the lines with create mode 100644 scrolled perfectly well

I don't know if it can help, I don't find any logic here except the amount of space char 🤔

@kelas

This comment has been minimized.

kelas commented Aug 13, 2018

@cedeber Totally agree, there is no rhyme or reason to any of this :) I am also getting very bizarre behaviour (see 🍺report above).

However, looking at your scroll buffer... Could you do me a favour and temporarily kill your $PS1 provider script, then restart Terminal and test from scratch?

I get a feeling Terminal chokes on non-BMP code points.

@kelas

This comment has been minimized.

kelas commented Aug 13, 2018

So basically these are not your friends:

image

@kelas

This comment has been minimized.

kelas commented Aug 13, 2018

@carloscabanero Staying on the subject of terminal emulators, here's a good example what not to do in terms of GPU-side glyph cache management. Although it is designed to make an optical appearance of instant font resizing, Pragmata Pro is the ideal litmus paper to test some interesting assumptions people make when they think about typefaces. Try pasting Pragmata_Pro_All_chars.txt into Kitty's buffer, then change the font size and scroll around a bit.

I guess my point is that it is not always immediately clear what exactly goes "nuts" — the font, or the software that is trying to put it on screen. In case of Terminal.app it is clearly the latter. Not sure about Blink, but happy to discuss.

To the next aspiring engineer working on the next VT100 emulator, I highly recommend using only Pragmata font during the development — not only for his code editor, but also for testing the software :)

@cedeber

This comment has been minimized.

cedeber commented Aug 13, 2018

@kelas the squares render correctly on the term, it’s a big fat right arrow. I guess it’s simply not in the monospace font the browser uses.

@carloscabanero

This comment has been minimized.

carloscabanero commented Aug 14, 2018

@kelas I can speak for Blink. We are a heavily modified HTerm and use WebKit for this calculation. It is possible that this is not a very optimized path within the rendering engine, but at the same time it is a very specific gesture (pinch to zoom) that “feels” slow just because you are used to a smoother experience. Not a gigantic deal and no one complained, but I feel it.

That’s why I was curious to know if there may be something else to be optimized on either side. Because whatever calculations take place, they only take this long with Pragmata.

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@cedeber Please cat the contents of this file into a fresh term window and let me know if any specific areas seem to produce worse lag than the others during scroll.
All_chars.txt

@dop

This comment has been minimized.

dop commented Aug 14, 2018

All_chars.txt worked fine with Pragmata Pro, but had some small lag with Pragmata Pro Mono where the glyphs were missing (rendered as question marks or native macOS emojis.)

I think I just figured what makes Terminal.app slow for me. It's colors! I set my prompt to have blue color so that I can distinguish it easier from the output and it makes the Terminal.app crawl.

This reproduces it for me:

#!/bin/sh

BLUE="$(tput setaf 27)"
RESET="$(tput sgr0)"

for i in `seq 1 100`; do
    echo "${BLUE}>${RESET} $i"
done
@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@dop bravo, this connects. I get the same.

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@dop And now the fun part. if you disable ANSI colors and anti-aliasing in the profile, what do you get? :)

@dop

This comment has been minimized.

dop commented Aug 14, 2018

It still scrolls terribly slow. Is that expected?

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

None of this is expected. No wonder this went uncaught for so long. It is not just colors, it is specific sequences!

This kills the scroll:

#!/bin/sh

BLUE="$(tput setaf 27)"
RESET="$(tput sgr0)"

for i in `seq 1 100`; do
    echo "1${BLUE}0${RESET}"
done

And this doesn't:

#!/bin/sh

BLUE="$(tput setaf 27)"
RESET="$(tput sgr0)"

for i in `seq 1 100`; do
    echo "${BLUE}10${RESET}"
done

But anyway — we finally have a reproducible case, and can apply divide and conquer as @schriftgestalt suggests.

@dop very nice catch, amazing intuition.

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

Happy to let everyone know that the issue is finally isolated.

Those who think Terminal.app is still a good idea in A.D. 2018, expect good news soon :)

@schriftgestalt

This comment has been minimized.

schriftgestalt commented Aug 14, 2018

I pinged a contact at Apple and he told me that you should file a bug. If you do, post the radar number that I can send it to him.

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@schriftgestalt The horrors I have seen in the past few hours looking at Terminal's process stack samples trying to understand what is it burning 100% CPU on while scrolling a trivial terminal window set in Pragmata or Iosevka, make me think Terminal authors are the last people I wanna deal with :) Hope they are still around, because the software looks a bit summer 2000.

The issue seems pretty clear, Terminal is badly confused by the fact that Pragmata is not monospaced and has additional substitution features.

Still have to discuss with @fabrizioschiavi, but I think there is a relatively painless solution. @dop 's amazing insight came right on time :)

And thank you!

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@carloscabanero sorry for the wait. I'm Blink's paying customer for a while now, always thought mosh was a strong idea, but I've been out of touch with mobile terminals lately.

So basically I understand you're having issues achieving a responsive zoom of a text viewport set in PPro. As you figured, I've seen plenty of this lovely font lately, including some major performance bottlenecks in a scenario similar to yours — only the surface had a bit more pixels and the target frame rate was a bit higher. Responsiveness is never easy, but there is always a hack which is sometimes hard to spot. And it is never the font's fault, I realized :) You're not necessarily completely bound by Webkit's text layout performance, and what you're seeing with Pragmata could be a hint at a more general potential improvement.

@schriftgestalt

This comment has been minimized.

schriftgestalt commented Aug 14, 2018

But as you have a proper test case, filing a bug is easy. And it might actually get fixed.

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@carloscabanero Only when everything else fails trying to achieve something truly responsive, people finally quit trying to make sense of countless Apple's deprecated APIs and remember that SGI gave us OpenGL sometime around mid 90's.

Sublime Text, for example, had a major difficulty keeping their viewport responsive when Retina popped out, so pretty much the only thing you see these days when you scroll a document in Sublime Text on a Mac is an OpenGL front buffer (although not without some non-portable, poorly documented IOSurface in the back).

@kelas

This comment has been minimized.

kelas commented Aug 14, 2018

@schriftgestalt It is all up to @fabrizioschiavi anyway. I only drive the bus :)

@kelas

This comment has been minimized.

kelas commented Aug 15, 2018

Why am I seeing random/weird colors?

Most likely because your terminal does not support 24-bit RGB color escape sequences. This in turn probably means that you are using macOS' default Terminal.app, which is the only major terminal emulator still missing that feature. [...] Switch to a terminal that supports true color escape sequences. A well-researched list of such terminals can be found here.

@kelas

This comment has been minimized.

kelas commented Aug 15, 2018

I’ve noticed that Terminal.app slows dramatically when outputting non-latin unicode ranges. I’m aware of three things that might cause this: having to load different font pages, and having to parse code points outside of the BMP, and wide characters. The first probably boils down to a very complicated mix of lazy loading of font glyphs, font fallback calculations, and caching of the glyph pages or however that works. The second is a bit speculative, but I would bet that Terminal.app uses Cocoa’s UTF16-based NSString, which almost certainly hits a slow path when code points are above the BMP due to surrogate pairs.

I might add that in case of colour output NSString becomes NSAttributedString, which makes matters an order of magnitude worse.

Sorry about the spam, but all of this just might save someone a lot of time. We get to suffer, but the next guy doesn't have to.

@kelas

This comment has been minimized.

kelas commented Aug 16, 2018

@dop Building on your idea, here is a fun way to benchpress a terminal emulator with a given font:

curl -OJ https://github.com/haasn/interpolation-samples/raw/master/60fps/native.mkv
TERM=ansi
HD="--vo-tct-width=96 --vo-tct-height=54"
PLAY="mpv --vo tct --vo-tct-256=yes --vo-tct-algo=plain"
$PLAY $HD native.mkv

$PLAY $HD native.mkv > stream.txt
cat stream.txt

The above is best enjoyed at silky 60fps in iTerm2 and snappy 2000fps in Alacritty. Back at Terminal.app, we take comfort in counting dropped frames and drawing comparisons:

image

On a more serious note, a modified version of @dop's script can be used to show that any font, ligature or not, monospaced or not, can render Terminal.app unusable. At 10pt in a 134x45 window running on macOS Mojave, the output of the following script causes completely substandard latency with Fira Code, Hasklig, Iosevka and Menlo. @fabrizioschiavi I now agree with @schriftgestalt this should be reported as defect. A modern terminal emulator doesn't have to be this slow, really.

#!/bin/sh

TERM=ansi

bold=$(tput bold)
r=$(tput setaf 1)
g=$(tput setaf 2)
b=$(tput setaf 4)
R=$bold$r
G=$bold$g
B=$bold$b
X=$(tput sgr0)

# disable colors
#unset r g b R G B X bold

# ppro, iosevka, fira
L1="->"; L2="<-"; L3="!=" ; L4="0>="; L5="1<="; L6="2=="

t="${r}R${X}${g}G${X}${b}B${X}${r}${L1}${X}${g}${L2}${X}${b}${L3}${X}${r}${L4}${X}${g}${L5}${X}${b}${L6}${X}"
T="${R}R${X}${G}G${X}${B}B${X}${R}${L1}${X}${G}${L2}${X}${B}${L3}${X}${R}${L4}${X}${G}${L5}${X}${B}${L6}${X}"

for i in `seq 1 500000`; do
   echo "$i $T$t$T$t$T$t$T"
done

#//:~

To measure raw terminal sink speed without the overhead of echo, the output wants to be cached as shown below. We can ignore 500mb SSD read time because the bottleneck is definitely elsewhere:

$ ./nuketty.sh > payload.txt
$ time cat payload.txt

image

These timings are not useful for any precise calculations — it is easy to see that under high bitrate Terminal.app drops to a lower FPS and begins to skip large chunks of input stream. As there seem to be some hardcoded limits to that (I'm guessing 5000 lines/2 FPS), time-per-frame eventually begins to impact stream processing speed; in turn, characteristics of the font affect time-per-frame, so, all other things being equal, total time is a useful measure of the font's relative performance in Terminal.app.

By itself, adaptive frame rate is a perfectly valid way to save a lot of CPU cycles and make non-interactive streams (cat /dev/urandom | hexdump -n 1000000) flush much faster while still giving reasonable visual feedback. iTerm2 is using a similar mechanism by default, only it is optional and fully configurable. Alacritty seems to be less worried about such things, and relies on sheer power of a simple and efficient OpenGL pipeline.

Back at Terminal.app, adaptive frame rate heroics no longer help when the user starts to scroll the buffer using a precision HID such as Apple trackpad. In that case, poor time-per-frame can no longer be swept under the rug as it becomes an integral part of sensory feedback loop. Human brain, as slow as it is, easily picks up latencies above 15ms, and is not easily fooled — normally you simply have to render fast enough to provide feedback before 15ms deadline. With that in mind, a few seconds of difference on 500,000 lines of synthetic input might still not seem like a big deal, but when 0.827 comes out I strongly recommend to try this benchmark with Terminal.app and compare your personal scrolling experience using different fonts. Be ready for surprises.

What is really amusing about benchmarking Terminal.app this way (attn @carloscabanero) is that disabling ligatures actually results in measurably worse performance. The only explanation I can think of is that because we have twice as many glyphs to be rendered and UTF-16-encoded NSAttributedStrings are longer, ligature processing simply ends up being cheaper. Sure enough, this is can only be true for contrived inputs that consist mostly of ligatures.

In reality, complex contextual substitution will surely slow things down, although the relative impact on the overall text layout performance is clearly not what is commonly believed. On the other hand, it is perfectly possible (and very easy!) to produce a substitution table that will utterly crush user experience — that's why, as with any software, profiling and regression testing of OpenType features on carefully chosen test data is absolutely essential.

@schriftgestalt Your articles are awesome. Thinking out loud, there is absolutely no shortage of OT syntax manuals in the wild, but it proves to be impossible for a newcomer like me to find a single public resource about the actual design of substitution tables. Given that some of these state machines are designed by people who have little clue what an FSM is, it really seems the world could use a good read on this — most importantly, the basic pitfalls to be avoided. Although it could be true that the vast majority of all CPU cycles in the Universe are spent on rendering OpenType text, it is not immediately clear how much of those are spent on meaningful work :)

@kelas

This comment has been minimized.

kelas commented Aug 18, 2018

image

Problem:
=======

Performance of Terminal.app’s rendering pipeline fails to deliver acceptable UX of flushing/scrolling/typing into the buffer filled with the output of the attached shell script.


Steps to reproduce:
==================

1. Ensure your hardware has a Retina display and is running Mojave Beta 6
2. Launch Terminal.app, clone the default profile called “Man Page” and modify the copy as follows:

  * Default font (SF Mono Regular 11pt)
  * No antialiasing
  * Don’t use bold fonts
  * Disallow blinking text
  * Display ANSI colours
  * Use bright colours for bold
  * In “Background” dialogue, set Opacity 100%, Blur 100%
  * Window size 150*55
  * Limit scrollback to 1000 rows
  * Everything else by default

2. Launch a new window using the new profile and run the provided shell script as follows:

$ ./nuketty.sh > payload.txt
$ time cat payload.txt


Observed behaviour:
==================

1. Total sink time (screenshot of the final frame attached):
real	0m44.786s
user	0m0.012s
sys	0m7.182s

2. CPU load around 120-145% during the entire execution (Terminal process sample attached)

3. No dramatic impact on malloc (goes from default 70Mb to 130Mb and back)

2. Subsequent attempts to scroll the trailing 1000 lines of buffer using a trackpad produce a clearly noticeable frame drop and response latency well above 15ms.


Expected behaviour:
==================

1. Total sink time of the same file not above 2.0s
1. Frame rate not below 60 FPS
2. No more than 20ms motor feedback latency

These expectations are met by all major alternatives to Terminal.app. Hope something can be done - rendering a monospaced font in 16 colours doesn’t have to be this slow.


Thanks
k.

File Uploads

* System Information report
* System Diagnostics (sysdiagnose)
* nuketty.sh
* Final frame.png
* Sample of Terminal at 140 pct CPU.txt

@fabrizioschiavi

This comment has been minimized.

Owner

fabrizioschiavi commented Sep 7, 2018

With the great help of @kelas PragmataPro is now one of the quickest typefaces in absolute.
Please download version 0.827 to see the changes
loading_time_0827

@cedeber

This comment has been minimized.

cedeber commented Sep 11, 2018

@fabrizioschiavi Hi, did you update the fonts on MyFonts? I don't see any updates. Thanks

@cedeber

This comment has been minimized.

cedeber commented Sep 12, 2018

It works like a charm. Thanks a lot 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment