<div dir="ltr"><br><br><div class="gmail_quote">On Thu, May 27, 2010 at 11:28 AM, Ivan Miljenovic <span dir="ltr">&lt;<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@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="im">On 27 May 2010 18:23, Michael Snoyman &lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Thu, May 27, 2010 at 11:16 AM, Ivan Miljenovic<br>
&gt; &lt;<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 27 May 2010 17:55, Michael Snoyman &lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Two comments:<br>
&gt;&gt; &gt; * The exclamation point seems good enough for attributes. I copied that<br>
&gt;&gt; &gt; for<br>
&gt;&gt; &gt; Hamlet as well.<br>
&gt;&gt; &gt; * If you&#39;re standardizing on UTF-8, why not support bytestrings? I&#39;m<br>
&gt;&gt; &gt; aware<br>
&gt;&gt; &gt; that a user could shoot him/herself in the foot by passing in non-UTF8<br>
&gt;&gt; &gt; data,<br>
&gt;&gt; &gt; but I would imagine the performance gains would outweigh this. My recent<br>
&gt;&gt; &gt; benchmarks on the BigTable benchmark[1] imply a huge performance gap<br>
&gt;&gt; &gt; between<br>
&gt;&gt; &gt; ByteStrings and other contenders.<br>
&gt;&gt;<br>
&gt;&gt; Wow, I find it rather surprising that String out-performs Text; any<br>
&gt;&gt; idea why that is?  I wonder if you&#39;re just using it wrong...<br>
&gt;&gt;<br>
&gt; Could be, I&#39;d be very happy if that were the case. All of the benchmarks are<br>
&gt; available on Github, and the bytestring[1], text[2] and string[3] versions<br>
&gt; are all rather short.<br>
<br>
</div>Does using lazy Text values improve this?  I find it a little strange<br>
that you concatenate so many individual Strings that much.  Also, how<br>
about explicitly using Text values rather than OverloadedStrings?<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div>I don&#39;t do any string concatenation (look closely), I was very careful to avoid it. I tried with lazy text as well: it was slower. This isn&#39;t surprising, since lazy text- under the surface- is just a list of strict text. And the benchmark itself already has a lazy list of strict text. Using lazy text would just be adding a layer of wrapping.</div>
<div><br></div><div>I don&#39;t know what you mean by &quot;explicitly using Text values&quot;; you mean calling pack manually? That&#39;s really all that OverloadedStrings does.</div><div><br></div><div>You can try out lots of different variants on that benchmark. I did that already, and found this to be the fastest version. </div>
<div><br></div><div>Michael</div></div></div>