[racket] datum-intern-literal and lists?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Tue Jun 26 17:04:05 EDT 2012

[I thought I had done Reply to All, but apparently not.  CCing the list...]

On Mon, Jun 25, 2012 at 10:47 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> Another thought: maybe more agressive shortcircuiting might help?

[Note: I find a place in Scribble that might help improve speed by
about 15%.  See below.]

I'll tried adding the fast path computation, with no effective
difference. The statistical profiler is not working well in this
instance.  When I manually measure the time it takes to call decode on
the documents, it's insignificant, in terms of milliseconds.

However, I did some more measurements, and got a  very surprising
result.  Decode takes almost zero time, and what dominates the
rendering time in html-render.rkt are the following conceptual steps:

   1. constructing the xexpr from the doc,
   2. translating the xexpr to an xml structure, and
   3. using write-xml/content on that xml structure

(See around: https://github.com/plt/racket/blob/master/collects/scribble/html-render.rkt#L666)

I did not expect steps 2 and 3 to take that much time, but according
to (time ...), they take a significant amount of time.  Out of the 26
seconds on my machine, it takes about four seconds to do step 2, and
another three seconds to do step 3.

So about 15% of the time in html-render is spent coersing xexprs to
xml structure!  But there's already a function in the xml collection
that knows how to write xexprs directly to output ports.  I informally
replaced steps 2 and 3 with a direct call to xml:write-xexpr, and was
able to cut down the runtime a bit.

Can anyone else verify this?

Posted on the users mailing list.