<div>I understand that part, but the strings are generated from SDocs, and So unless internally SDoc doesn&#39;t use String then I&#39;m afraid there&#39;s nothing I can do about that :/</div>
<div> </div>
<div>Or rather, Is there a way to efficiently make CWStrings from SDocs?</div>
<div> </div>
<div>Regards,</div>
<div>Phyx<br><br></div>
<div class="gmail_quote">On Tue, Jul 13, 2010 at 6:56 PM, Thomas DuBuisson <span dir="ltr">&lt;<a href="mailto:thomas.dubuisson@gmail.com">thomas.dubuisson@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">That code is effectively copying the data (thats what those peeks /<br>pokes do), so it stands to reason it would be slow by most performance<br>
standards.  The reason ByteStrings are fast when used both by C and<br>Haskell is there is a zero-copy `useAsCString`.<br><br>Cheers,<br>Thomas<br>
<div>
<div></div>
<div class="h5"><br>On Tue, Jul 13, 2010 at 7:49 AM, Phyx &lt;<a href="mailto:lonetiger@gmail.com">lonetiger@gmail.com</a>&gt; wrote:<br>&gt; Marshalling large amount of data from and to C<br>&gt;<br>&gt; <a href="http://phyx.pastebin.com/WXGBr1bX" target="_blank">http://phyx.pastebin.com/WXGBr1bX</a> shows the code I use to do this (it&#39;s<br>
&gt; autogenerated, so just looking at 1 block should be enough)<br>&gt;<br>&gt; The tool is mine, so i can change the code it generates, but i would need to<br>&gt; know how to do it better first.<br>&gt;<br>&gt; On Tue, Jul 13, 2010 at 3:30 PM, Magnus Therning &lt;<a href="mailto:magnus@therning.org">magnus@therning.org</a>&gt;<br>
&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; On Tue, Jul 13, 2010 at 13:29, Phyx &lt;<a href="mailto:lonetiger@gmail.com">lonetiger@gmail.com</a>&gt; wrote:<br>&gt;&gt; &gt; Hello<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; I&#39;m wondering if anyone ever benchmarked marshalling in Haskell/GHC. No<br>
&gt;&gt; &gt; matter how much I optimize my Haskell code my program still seems to run<br>&gt;&gt; &gt; slow, which leads me to beleive that Marshalling is painfully slow.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Does anyone know a way I can test this and fix it?<br>
&gt;&gt;<br>&gt;&gt; What kind of marshalling are you referring to?<br>&gt;&gt;<br>&gt;&gt; /M<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt; Magnus Therning                        (OpenPGP: 0xAB4DFBA4)<br>&gt;&gt; magnus@therning.org          Jabber: magnus@therning.org<br>
&gt;&gt; <a href="http://therning.org/magnus" target="_blank">http://therning.org/magnus</a>         <a href="http://identi.ca/" target="_blank">identi.ca</a>|twitter: magthe<br>&gt;<br>&gt;<br></div></div>&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>&gt;<br></blockquote></div><br>