Skip to content

Displaying help takes a long time #505

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

Closed
iSchluff opened this issue Jan 25, 2022 · 7 comments · Fixed by #619
Closed

Displaying help takes a long time #505

iSchluff opened this issue Jan 25, 2022 · 7 comments · Fixed by #619
Labels
question Further information is requested to reproduce Issue still needs to be reproduced by a maintainer

Comments

@iSchluff
Copy link

Bringing up the help takes about ten seconds for me.

The following is logged by Talon:

2022-01-25 13:49:10 WARNING [watchdog] "user.cursorless-talon.src.cheatsheet.cheat_sheet.draw" @2.0s
   13:                                     talon/canvas.py:17 |
   12:                                     talon/canvas.py:164|
   11:                         talon/scripting/dispatch.py:144|
   10:                         talon/scripting/dispatch.py:135|
    9:                             talon/scripting/rctx.py:233| # 'draw' user.cursorless-talon.src.cheatsheet.cheat_sheet:draw()
    8: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:123| self.draw_section(canvas, "Special mar..
    7: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:161| self.draw_items(canvas, items)
    6: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:236| self.draw_dict(canvas, items)
    5: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:254| self.draw_value(canvas, text)
    4: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:283| canvas.paint.typeface = text_font
    3:                                 talon/skia/paint.py:189|
    2:                                  talon/skia/font.py:79 |
    1:                              talon/skia/typeface.py:44 |
2022-01-25 13:49:13 WARNING [watchdog] "user.cursorless-talon.src.cheatsheet.cheat_sheet.draw" @2.0s
   13:                                     talon/canvas.py:17 |
   12:                                     talon/canvas.py:164|
   11:                         talon/scripting/dispatch.py:144|
   10:                         talon/scripting/dispatch.py:135|
    9:                             talon/scripting/rctx.py:233| # 'draw' user.cursorless-talon.src.cheatsheet.cheat_sheet:draw()
    8: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:123| self.draw_section(canvas, "Special mar..
    7: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:161| self.draw_items(canvas, items)
    6: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:236| self.draw_dict(canvas, items)
    5: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:254| self.draw_value(canvas, text)
    4: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:283| canvas.paint.typeface = text_font
    3:                                 talon/skia/paint.py:189|
    2:                                  talon/skia/font.py:79 |
    1:                              talon/skia/typeface.py:44 |
2022-01-25 13:49:15 WARNING [watchdog] "user.cursorless-talon.src.cheatsheet.cheat_sheet.draw" @2.0s
   13:                                     talon/canvas.py:17 |
   12:                                     talon/canvas.py:164|
   11:                         talon/scripting/dispatch.py:144|
   10:                         talon/scripting/dispatch.py:135|
    9:                             talon/scripting/rctx.py:233| # 'draw' user.cursorless-talon.src.cheatsheet.cheat_sheet:draw()
    8: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:111| self.draw_section(
    7: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:161| self.draw_items(canvas, items)
    6: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:236| self.draw_dict(canvas, items)
    5: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:254| self.draw_value(canvas, text)
    4: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:283| canvas.paint.typeface = text_font
    3:                                 talon/skia/paint.py:189|
    2:                                  talon/skia/font.py:79 |
    1:                              talon/skia/typeface.py:44 |
2022-01-25 13:49:17 WARNING [watchdog] "user.cursorless-talon.src.cheatsheet.cheat_sheet.draw" @2.0s
   13:                                     talon/canvas.py:17 |
   12:                                     talon/canvas.py:164|
   11:                         talon/scripting/dispatch.py:144|
   10:                         talon/scripting/dispatch.py:135|
    9:                             talon/scripting/rctx.py:233| # 'draw' user.cursorless-talon.src.cheatsheet.cheat_sheet:draw()
    8: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:123| self.draw_section(canvas, "Special mar..
    7: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:161| self.draw_items(canvas, items)
    6: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:236| self.draw_dict(canvas, items)
    5: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:254| self.draw_value(canvas, text)
    4: user/cursorless-talon/src/cheatsheet/cheat_sheet.py:283| canvas.paint.typeface = text_font
    3:                                 talon/skia/paint.py:189|
    2:                                  talon/skia/font.py:79 |
    1:                              talon/skia/typeface.py:44 |

I am running talon v0.2.0-305-g968a (305)
cursorless-talon 0.25.0
and knausj_talon commit ea9b2d767be59cfccb5e6831874f2173114cd6bb
on Linux.

Greetings, Anton

@pokey
Copy link
Member

pokey commented Jan 25, 2022

@lunixbochs @AndreasArvidsson any idea why we'd be getting watchdogs with a stacktrace like the above? If I'm reading the trace correctly, it's happening while setting the font? Seems odd...

@pokey pokey transferred this issue from cursorless-dev/cursorless-talon Jan 25, 2022
@pokey pokey added the to reproduce Issue still needs to be reproduced by a maintainer label Jan 25, 2022
@lunixbochs
Copy link

As this is on Linux it might be nice to get a strace -tt -eopenat,stat or perf trace output for the period the watchdog is active. We're probably stalled on something Skia is doing, which might be stalled in the GPU driver or filesystem, and I have no idea what exactly without some kind of trace.

Also are you setting the font multiple times? Those watchdogs are each for 2s. Maybe it will improve if you only set it once per draw?

@pokey
Copy link
Member

pokey commented Jan 25, 2022

Also are you setting the font multiple times? Those watchdogs are each for 2s. Maybe it will improve if you only set it once per draw?

Ah yes we do set it repeatedly, actually to the same thing. Didn't realise setting font would have such a performance penalty. We could reduce the number of times we set it by a bunch. That's fairly low-hanging fruit

@lunixbochs
Copy link

lunixbochs commented Jan 25, 2022

Would love to get a trace to know why it's slow, I assume it needs to go actually find and load the font from disk every time on that system for some reason.

@pokey pokey added the question Further information is requested label Jan 25, 2022
@pokey
Copy link
Member

pokey commented Feb 8, 2022

As this is on Linux it might be nice to get a strace -tt -eopenat,stat or perf trace output for the period the watchdog is active. We're probably stalled on something Skia is doing, which might be stalled in the GPU driver or filesystem, and I have no idea what exactly without some kind of trace.

@iSchluff any chance you'd be able to post this output to help us debug this one?

@iSchluff
Copy link
Author

iSchluff commented Feb 9, 2022

Sorry for the delay, haven't been keeping up with GitHub so much lately ^^'
strace.txt
Apparently its locking a lot and checking the permissions of the fonts, but no open/read.

perf trace -s
syscall summary.txt

@pokey
Copy link
Member

pokey commented Feb 10, 2022

thanks @iSchluff! @lunixbochs does the above help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested to reproduce Issue still needs to be reproduced by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants