<br>Hello all.  Using s-xml-rpc with SBCL 1.0.14 and was seeing a lot of consing. <br>Just attempted to hit some low hanging fruit and got lucky.<br><br>Please excuse any wierd table cut-and-paste formatting below. <br><br>
I am using hunchentoot as the front end and was calling as such:<br><br><span style="font-family: courier new,monospace;">(handle-xml-rpc-call (raw-post-data :want-stream t) id)</span><br><br>Profiling gave: (note that the lisp test system was calling itself so both the call and answer are shown, <br>
but I really only care about the answer.)<br><br><span style="font-family: courier new,monospace;">;;   seconds  |    consed   |  calls |  sec/call  |  name</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;; ----------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;     10.430 | 107,109,496 |     32 |   0.325942 | S-XML-RPC:XML-RPC-CALL</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;;      5.583 |  57,897,032 |  1,670 |   0.003343 | S-XML::PARSE-IDENTIFIER</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;      1.179 |  12,740,176 |    835 |   0.001412 | S-XML::PARSE-XML-ELEMENT</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;;      1.073 |   9,625,512 |  1,845 |   0.000582 | S-XML::PARSE-WHITESPACE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;      0.988 |   8,591,704 |    239 |   0.004132 | S-XML::PARSE-TEXT</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;;      0.425 |   4,491,216 |    899 |   0.000472 | S-XML::SKIP-WHITESPACE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;      0.111 |      53,968 |  1,670 |   0.000067 | S-XML:RESOLVE-IDENTIFIER</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;;      0.041 |           0 | 11,810 |   0.000003 | S-XML::IDENTIFIER-CHAR-P</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;      0.028 |     516,088 |     64 |   0.000436 | S-XML-RPC::FORMAT-HEADER</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;;      0.021 |         720 |  1,670 |   0.000013 | S-XML::FIND-NAMESPACE-BINDING</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;      0.021 |           0 |  1,845 |   0.000011 | S-XML::GET-BUFFER</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;;      0.013 |           0 |  1,670 |   0.000008 | S-XML:SPLIT-IDENTIFIER</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;;      0.011 |           0 |    835 |   0.000013 | S-XML-RPC::DECODE-XML-RPC-FINISH-ELEMENT<br><br style="font-family: arial,sans-serif;"><br style="font-family: arial,sans-serif;">
</span><span style="font-family: courier new,monospace;"><span style="font-family: arial,sans-serif;">When I changed handle-xml-rpc-call to take a string as make its own stream as such:<br><br></span>(handle-xml-rpc-call-string (raw-post-data) id)</span><br style="font-family: courier new,monospace;">
<br style="font-family: arial,sans-serif;"><span style="font-family: courier new,monospace;"><span style="font-family: arial,sans-serif;"></span><br>(defun handle-xml-rpc-call-string (string id)<br>    (with-input-from-string (in string)<br>
      (let ((call (decode-xml-rpc in)))<br>        (let ((result (apply *xml-rpc-call-hook*<br>                             (first call)<br>                             (rest call))))<br>          (encode-xml-rpc-result result))))))<br>
<br><font face="arial,sans-serif">I now profile:<br><br> <span style="font-family: courier new,monospace;"> seconds  |   consed   |  calls |  sec/call  |  name</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">---------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">     0.985 | 15,135,160 |     32 |   0.030786 | S-XML-RPC:XML-RPC-CALL</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">     0.023 |    118,296 |  1,670 |   0.000014 | S-XML:RESOLVE-IDENTIFIER</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">     0.021 |          0 | 11,810 |   0.000002 | S-XML::IDENTIFIER-CHAR-P</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">     0.019 |    769,856 |     32 |   0.000593 | RPC-HANDLER</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">     0.016 |    459,688 |     64 |   0.000248 | S-XML-RPC::FORMAT-HEADER</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">     0.013 |     11,128 |    899 |   0.000014 | S-XML::SKIP-WHITESPACE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">     0.010 |     12,536 |  1,670 |   0.000006 | S-XML::PARSE-IDENTIFIER</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">     0.009 |          0 |  1,670 |   0.000006 | S-XML::GET-MINI-BUFFER</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">     0.009 |          0 |  1,670 |   0.000006 | S-XML:SPLIT-IDENTIFIER</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">     0.004 |          0 |      8 |   0.000498 | UPDATE-SEARCH-STRING</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">     0.004 |      7,944 |     32 |   0.000118 | S-XML-RPC::ENCODE-XML-RPC-RESULT</span><br> <br>For a 10 fold speed increase.</font><br><br><font face="arial,sans-serif">I just thought this might be of use to someone down the line.<br>
<br>Will<br></font></span>