I updated the test program from @robby to set the smoothing on the device context and to use the same font that the plot package is using. This should match closely what the plot package is doing with regard to drawing the labels. For me, even the updated example shows shows the same timings for both versions, but maybe there is something different on your machine?
Smoothing affects drawing performance for plots with lots of elements, see Large overhead for drawing plots with lots of data points · Issue #94 · racket/plot · GitHub
@benknoble, can you try the updated program below?
Thanks,
Alex.
#lang racket/gui
(require plot)
(define font
(if (plot-font-face)
(send the-font-list find-or-create-font
(plot-font-size)
(plot-font-family)
'normal
'normal)
(send the-font-list find-or-create-font
(plot-font-size)
(plot-font-face)
(plot-font-family)
'normal
'normal)))
(define N 2000)
(define (do-drawing str)
(define (draw c dc)
(send dc set-smoothing 'smoothed)
(send dc set-font font)
(time
(for ([x (in-range N)])
(define-values (w h _1 _2) (send dc get-text-extent str))
(send dc draw-text str 0 0)
(send dc draw-text str w 0)
(send dc draw-text str 0 h))))
(define f (new frame% [label ""] [width 200] [height 200]))
(define c (new canvas% [parent f] [paint-callback draw]))
(define b (new button% [parent f] [label "refresh"] [callback (λ _ (send c refresh))]))
(send f show #t))
(do-drawing "☼↯∅▲※")
(do-drawing "*sobd")