Sam Tobin-Hochstadt
Sam Tobin-Hochstadt
I started looking at this because I was worried it was Typed Racket-induced contract overhead, but that doesn't seem to be the case. One thing I did see is that...
I believe that Typed Racket program has no contract boundaries that aren't there always in plot -- ie, I don't think there's anything Typed Racket about your example. To see...
My guess is that the contract cost is in the result contract, not shown in the print out, which is Renderer2d. That's an object which will impose cost on every...
One other thing, @alex-hhh, I think you meant to use `vs1` in the call to `draw-lines`.
I'm now much more confused. I tested with the following program: ``` #lang typed/racket/base (require (only-in plot/private/common/parameters plot-decorations?) (only-in plot/private/no-gui/plot2d plot-bitmap) (only-in plot/private/plot2d/line lines)) (: points (Listof (List Real Real)))...
Removing the contract inside racket/draw doesn't remove the wrapper-object so I'm still confused.
Further investigation: I put some printouts inside `class-internal` to see what the contracts were. They are very close to the types in `gui-types.rkt` in TR, but not exactly the same....
Further investigation: the mysterious contract is applied as part of this line: https://github.com/racket/plot/blob/master/plot-lib/plot/private/no-gui/plot2d.rkt#L108 However, I don't know why there's a contract there. `bitmap-dc%` on that line is imported from `typed/racket/draw`,...
At @rfindler's suggestion, I investigated @alex-hhh's hypothesis that calling `draw-lines` on a dc in Typed Racket is the slow thing; fortunately that doesn't seem to be the case. Here's the...
One additional note -- I tried using `plot-pict` instead of `plot-bitmap`, and that reduces the time to 1 second from 47 seconds, and more significantly, the `draw-lines` call takes only...