I'm using DrRacket on a 64-bit Ubuntu 16.04 system with the default Unity windowing system, and am finding that typing in the definitions window is laggy. The problem isn't a show-stopper, as it keeps up more or less as I type, but it's disorienting. I teach a class using DrRacket, and I had the experience today of coding in front of the class and the lag was just disorienting enough that I kept making typos I don't usually make. It's a psychological thing. That, and when I hold down a cursor key to quickly move through the program and then let go, the cursor keeps moving for a while from buffered keystrokes. If I give it a good burst of typing, I can sit back and watch the text fill in while I wait. I don't see this behavior in other programs (terminal windows, text editors, etc.)
I've tried both version 6.3 (in the Ubuntu repos) and 6.8 (downloaded from racket-lang.org).
I've have tried turning off incremental syntax checking and background expansion. No significant effect. What does matter is the size of the window. If I shrink the DrRacket window, typing lag goes away. So, I can solve the problem by making the window significantly smaller than I'd like, but of course, I'd prefer to run maximized. I'm running on a Lenovo Thinkpad t460s at native resolution, which is 1920x1080. I'm otherwise running at Ubuntu defaults on the display settings, as far as I know. I typically set menu/title-bar scaling to 1.25, but I've verified that the same behavior persists in DrRacket if I drop that scaling back down to 1.
Any thoughts on how this might be resolved?
Thanks, much appreciated.
--
Dave Musicant
#lang racket/gui
(require profile)
(require profile/analyzer)
(require profile/render-text)
(require profile/sampler)
(define s (create-sampler (current-thread) 0.0))
(s 'get-snapshots)
(define ec%
(class editor-canvas%
(define/override (on-paint)
(profile (super on-paint) #:threads #t #:order 'self))
(define/override (on-char e)
(profile (super on-char e) #:threads #t #:order 'self))
(super-new)))
(define frame (new frame% [label "Simple Edit"]
[width 1800]
[height 1800]))
(define canvas (new ec% [parent frame]))
(define text (new text%))
(send canvas set-editor text)
(send frame show #t)
(render (analyze-samples (s 'get-snapshots)))
================================================================================================================
Caller
Idx Total Self Name+src Local%
ms(pct) ms(pct) Callee
================================================================================================================
call-with-break-parameterization [2] 100.0%
[5] 19000(10.6%) 6221(3.5%) dispatch-on-char method in window% ...ow.rkt:778:4
??? [45] 29.3%
flush-display [14] 27.8%
call-pre-on-char method in window% [15] 10.2%
----------------------------------------------------------------------------------------------------------------
call-with-break-parameterization [2] 100.0%
[7] 2580(1.4%) 2580(1.4%) ??? ...acket/collects/ffi/unsafe/atomic.rkt:115:16
----------------------------------------------------------------------------------------------------------------
dispatch-on-event method in window% [9] 3.1%
dispatch-on-char method in window% [5] 96.9%
[14] 5442(3.0%) 5442(3.0%) flush-display ...d/private/wx/gtk/window.rkt:891:0
----------------------------------------------------------------------------------------------------------------
??? [13] 100.0%
[22] 179456(100.0%) 158080(88.1%) loop .../drracket/drracket/private/rep.rkt:1456:17
??? [3] 11.3%
wait-now [32] 0.0%
----------------------------------------------------------------------------------------------------------------
??? [70] 100.0%
[75] 5512(3.1%) 5512(3.1%) channel-put ...lects/racket/private/misc.rkt:169:2
----------------------------------------------------------------------------------------------------------------
(define (flush-display)
(try-to-sync-refresh)
;; (gdk_window_process_all_updates)
(gdk_display_flush (gdk_display_get_default)))
gdk_window_process_all_updates
has been deprecated since version 3.22 and should not be used in newly-written code.
gdk_window_process_all_updates
but I don't know if there are other Racket instances out there relying on older GTK versions that need this call. Is there a way to check for that?#lang racket
(require racket/gui)
(define frame (new frame% [label "Simple Edit"]
[width 1800]
[height 1800]))
(define canvas (new editor-canvas% [parent frame]
[style (list 'transparent)]))
(define text (new text%))
(send canvas set-editor text)
(send frame show #t)
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/c369c5b0-9c78-4636-be07-1a36c4f35bdd%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to racket...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/c369c5b0-9c78-4636-be07-1a36c4f35bdd%40googlegroups.com.