[Haskell-cafe] Ridiculously slow FFI, or cairo binding?

Eugene Kirpichov ekirpichov at gmail.com
Wed Nov 2 11:15:56 CET 2011


Any idea how to debug why all the GMP calls?
I'm looking at even the auto-generated source for cairo bindings, but I
don't see anything at all that could lead to *thousands* of them.

On Wed, Nov 2, 2011 at 2:14 PM, Vincent Hanquez <tab at snarc.org> wrote:

> On 11/02/2011 10:10 AM, Eugene Kirpichov wrote:
>
>> Oh. This is pretty crazy, I wonder what they're doing with GMP so much...
>>
>> I modified the Haskell program to use cairo directly, even with safe
>> calls, and it now takes the same time as the C program.
>>
>>  yep, i ended up doing the exact same thing for testing,
>
> foreign import ccall "cairo_rectangle"
>  my_rectangle :: CI.Cairo -> CDouble -> CDouble -> CDouble -> CDouble ->
> IO ()
>
> and just replacing the rectangle call make almost all the difference for
> me (almost as fast as C)
>
> --
> Vincent
>



-- 
Eugene Kirpichov
Principal Engineer, Mirantis Inc. http://www.mirantis.com/
Editor, http://fprog.ru/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111102/a56e4d03/attachment.htm>


More information about the Haskell-Cafe mailing list