A few off-the-cuff comments...

* At first glance, looks like `consolidate` could be rewritten for wins a few regards (e.g., probably accumulate strings so no incremental string appends, computations that happen multiple times, unnecessary see whether the small utility procedures are efficient).  Once you hit the obvious big stuff, if you still need more speed, you can do another pass of analysis and profiling. Working through it and getting it correct, maintainable, and fast-enough/near-optimal would probably take hours.

* Or, do you really need to combine strings ever in SXML, or just consolidate SXML elements?  One of the wins of SXML over xexpr is that SXML makes for very efficient splicing in/out of stuff, since you don't have do do things like flatten content lists or append big content strings.

* Or, maybe you don't have to go through `consolidate` at all, or even SXML at all: are you just doing an algorithm that takes SXML or some `text%` value, and needs to emit XML?  That could just be a data structure traversal with a bit of state, writing XML serially to an output port incrementally.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to