<div dir="ltr"><br><br><div class="gmail_quote">On Thu, May 27, 2010 at 12:57 PM, Johan Tibell <span dir="ltr">&lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Thu, May 27, 2010 at 10:23 AM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">


<div dir="ltr"><div class="gmail_quote"><div><div class="im">On Thu, May 27, 2010 at 11:16 AM, Ivan Miljenovic <span dir="ltr">&lt;<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a>&gt;</span> wrote:<br>


</div><div class="im"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Wow, I find it rather surprising that String out-performs Text; any<br>
idea why that is?  I wonder if you&#39;re just using it wrong...<br>
<font color="#888888"><font color="#000000"><font color="#888888"><br></font></font></font></blockquote></div></div><div class="im"><div>Could be, I&#39;d be very happy if that were the case. All of the benchmarks are available on Github, and the bytestring[1], text[2] and string[3] versions are all rather short.</div>


</div></div></div></blockquote></div><br>Do you include the cost of encoding the result as e.g. UTF-8? The hope would be that the more compact Text would be faster to traverse, and thus encode, than the list based String.<br>
<br>

</blockquote></div>No, but this is done on purpose. One of my goals in this benchmark was to determine whether I should consider switching Hamlet to ByteStrings. If I were to do so, then the UTF-8 encoding would be done at compile-time instead of run-time.<div>
<br></div><div>You&#39;re correct that a fair comparison would be to UTF-8 encode the Strings as well. However, that&#39;s not what most users are going to do most of the time: when dealing with ASCII data, a straight Char8.pack encoding will do the same as UTF-8. I&#39;m simply pointing out that I think Blaze should support this style.</div>
<div><br></div><div>Michael</div></div>