Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Performance problem with Haskell/OpenGL/GLFW
      (Hollister Herhold)
   2. Re:  Performance problem with Haskell/OpenGL/GLFW
      (Hollister Herhold)
   3. Re:  Performance problem with Haskell/OpenGL/GLFW (Andrey Yankin)
   4. Re:  Performance problem with Haskell/OpenGL/GLFW
      (Hollister Herhold)


----------------------------------------------------------------------

Message: 1
Date: Sun, 10 Mar 2013 08:23:30 -0500
From: Hollister Herhold <[email protected]>
Subject: Re: [Haskell-beginners] Performance problem with
        Haskell/OpenGL/GLFW
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1


I'm building glfw now on 10.7.5 and I'll try your test code. 

I've been learning haskell (still very much a beginner) but I know OpenGL, so 
I'm very interested in how this turns out.

-Hollister


On Mar 10, 2013, at 4:38 AM, Jesper S?rnesj? wrote:

> On Sun, Mar 10, 2013 at 4:46 PM, Jesper S?rnesj? <[email protected]> wrote:
>> I've figured out what the problem is: the Haskell program is using a
>> software implementation of OpenGL, so rendering *does* in fact happen
>> on the CPU.
>> 
>> It would appear that there is in fact some relevant difference between
>> the Haskell and C versions of my program, or possibly some way
>> in which the bindings from the GLFW-b package are different from the C
>> library.
> 
> To remove any possibility of the problem being in GLFW-b or OpenGLRaw,
> I created two new programs, one in Haskell [1] and one in C [2], that
> don't import or include anything related to OpenGL, and that simply
> create a context, check if it is hardware accelerated, and then exit.
> That is all. And still, the Haskell program receives a software
> renderer, while the C program receives a hardware one:
> 
>    $ ghc -O2 Test2.hs -lglfw -framework OpenGL -fforce-recomp && ./Test2
>    [1 of 1] Compiling Main             ( Test2.hs, Test2.o )
>    Linking Test2 ...
>    software
>    (2,7,7)
>    (3,2,0)
>    $ gcc -O2 test2.c -lglfw -framework OpenGL && ./a.out
>    hardware
>    2.7.7
>    3.2.0
> 
> I haven't had the chance to run these programs on any OS other than
> Mac OS X 10.8.2, so I don't know if this problem is Mac-specific.
> Still, it's really weird that the system would differentiate between
> Haskell and C programs in this way.
> 
> If anyone has any ideas about what's going on here, I'd very much like
> to hear them.
> 
> -- 
> Jesper S?rnesj?
> http://jesper.sarnesjo.org/
> 
> [1] https://gist.github.com/sarnesjo/5116084#file-test2-hs
> [2] https://gist.github.com/sarnesjo/5116084#file-test2-c
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners




------------------------------

Message: 2
Date: Sun, 10 Mar 2013 09:14:41 -0500
From: Hollister Herhold <[email protected]>
Subject: Re: [Haskell-beginners] Performance problem with
        Haskell/OpenGL/GLFW
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1


OK, I get the same results as you. I ran a dtruss on the two different apps to 
look at the system calls being made and I can see where the C code opens the 
OpenGL hardware driver and the haskell code does not, but I'm not sure why. 
There are a lot of preferences files flying around. Still digging.

I do know that both apps are using the same glfw library.


On Mar 10, 2013, at 8:23 AM, Hollister Herhold wrote:

> 
> I'm building glfw now on 10.7.5 and I'll try your test code. 
> 
> I've been learning haskell (still very much a beginner) but I know OpenGL, so 
> I'm very interested in how this turns out.
> 
> -Hollister
> 
> 
> On Mar 10, 2013, at 4:38 AM, Jesper S?rnesj? wrote:
> 
>> On Sun, Mar 10, 2013 at 4:46 PM, Jesper S?rnesj? <[email protected]> wrote:
>>> I've figured out what the problem is: the Haskell program is using a
>>> software implementation of OpenGL, so rendering *does* in fact happen
>>> on the CPU.
>>> 
>>> It would appear that there is in fact some relevant difference between
>>> the Haskell and C versions of my program, or possibly some way
>>> in which the bindings from the GLFW-b package are different from the C
>>> library.
>> 
>> To remove any possibility of the problem being in GLFW-b or OpenGLRaw,
>> I created two new programs, one in Haskell [1] and one in C [2], that
>> don't import or include anything related to OpenGL, and that simply
>> create a context, check if it is hardware accelerated, and then exit.
>> That is all. And still, the Haskell program receives a software
>> renderer, while the C program receives a hardware one:
>> 
>>   $ ghc -O2 Test2.hs -lglfw -framework OpenGL -fforce-recomp && ./Test2
>>   [1 of 1] Compiling Main             ( Test2.hs, Test2.o )
>>   Linking Test2 ...
>>   software
>>   (2,7,7)
>>   (3,2,0)
>>   $ gcc -O2 test2.c -lglfw -framework OpenGL && ./a.out
>>   hardware
>>   2.7.7
>>   3.2.0
>> 
>> I haven't had the chance to run these programs on any OS other than
>> Mac OS X 10.8.2, so I don't know if this problem is Mac-specific.
>> Still, it's really weird that the system would differentiate between
>> Haskell and C programs in this way.
>> 
>> If anyone has any ideas about what's going on here, I'd very much like
>> to hear them.
>> 
>> -- 
>> Jesper S?rnesj?
>> http://jesper.sarnesjo.org/
>> 
>> [1] https://gist.github.com/sarnesjo/5116084#file-test2-hs
>> [2] https://gist.github.com/sarnesjo/5116084#file-test2-c
>> 
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners




------------------------------

Message: 3
Date: Sun, 10 Mar 2013 18:31:24 +0400
From: Andrey Yankin <[email protected]>
Subject: Re: [Haskell-beginners] Performance problem with
        Haskell/OpenGL/GLFW
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CANxQ4Z22PP2x0Uha-qo=24T_m2u9a7gb4_cjO=lpxtjfy4y...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi.

AFAIK glfw-b uses its own version of glfw which is built during setup.
There is a makefile inside the package.

Can't reproduce this error on Arch.



2013/3/10 Hollister Herhold <[email protected]>

>
> OK, I get the same results as you. I ran a dtruss on the two different
> apps to look at the system calls being made and I can see where the C code
> opens the OpenGL hardware driver and the haskell code does not, but I'm not
> sure why. There are a lot of preferences files flying around. Still digging.
>
> I do know that both apps are using the same glfw library.
>
>
> On Mar 10, 2013, at 8:23 AM, Hollister Herhold wrote:
>
> >
> > I'm building glfw now on 10.7.5 and I'll try your test code.
> >
> > I've been learning haskell (still very much a beginner) but I know
> OpenGL, so I'm very interested in how this turns out.
> >
> > -Hollister
> >
> >
> > On Mar 10, 2013, at 4:38 AM, Jesper S?rnesj? wrote:
> >
> >> On Sun, Mar 10, 2013 at 4:46 PM, Jesper S?rnesj? <[email protected]>
> wrote:
> >>> I've figured out what the problem is: the Haskell program is using a
> >>> software implementation of OpenGL, so rendering *does* in fact happen
> >>> on the CPU.
> >>>
> >>> It would appear that there is in fact some relevant difference between
> >>> the Haskell and C versions of my program, or possibly some way
> >>> in which the bindings from the GLFW-b package are different from the C
> >>> library.
> >>
> >> To remove any possibility of the problem being in GLFW-b or OpenGLRaw,
> >> I created two new programs, one in Haskell [1] and one in C [2], that
> >> don't import or include anything related to OpenGL, and that simply
> >> create a context, check if it is hardware accelerated, and then exit.
> >> That is all. And still, the Haskell program receives a software
> >> renderer, while the C program receives a hardware one:
> >>
> >>   $ ghc -O2 Test2.hs -lglfw -framework OpenGL -fforce-recomp && ./Test2
> >>   [1 of 1] Compiling Main             ( Test2.hs, Test2.o )
> >>   Linking Test2 ...
> >>   software
> >>   (2,7,7)
> >>   (3,2,0)
> >>   $ gcc -O2 test2.c -lglfw -framework OpenGL && ./a.out
> >>   hardware
> >>   2.7.7
> >>   3.2.0
> >>
> >> I haven't had the chance to run these programs on any OS other than
> >> Mac OS X 10.8.2, so I don't know if this problem is Mac-specific.
> >> Still, it's really weird that the system would differentiate between
> >> Haskell and C programs in this way.
> >>
> >> If anyone has any ideas about what's going on here, I'd very much like
> >> to hear them.
> >>
> >> --
> >> Jesper S?rnesj?
> >> http://jesper.sarnesjo.org/
> >>
> >> [1] https://gist.github.com/sarnesjo/5116084#file-test2-hs
> >> [2] https://gist.github.com/sarnesjo/5116084#file-test2-c
> >>
> >> _______________________________________________
> >> Beginners mailing list
> >> [email protected]
> >> http://www.haskell.org/mailman/listinfo/beginners
> >
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130310/d74ce699/attachment-0001.htm>

------------------------------

Message: 4
Date: Sun, 10 Mar 2013 10:01:07 -0500
From: Hollister Herhold <[email protected]>
Subject: Re: [Haskell-beginners] Performance problem with
        Haskell/OpenGL/GLFW
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"


I don't think so - I had to build and install glfw from source to get the 
Haskell code to link after building glfw-b (which built fine without GLFW 
installed, incidentally).

I get the following for library dependencies - it looks like they're using the 
exact same libs (aside from iconv):

hhmacbook:~/Development/haskell/OpenGL:6> otool -L ./a.out 
./a.out:
        @executable_path/libglfw.dylib (compatibility version 1.0.0, current 
version 1.0.0)
        /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 
(compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 159.1.0)
hhmacbook:~/Development/haskell/OpenGL:7> otool -L ./Test2
./Test2:
        @executable_path/libglfw.dylib (compatibility version 1.0.0, current 
version 1.0.0)
        /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 
(compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 
7.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 159.1.0)
hhmacbook:~/Development/haskell/OpenGL:8> 


On Mar 10, 2013, at 9:31 AM, Andrey Yankin wrote:

> Hi.
> 
> AFAIK glfw-b uses its own version of glfw which is built during setup.
> There is a makefile inside the package.
> 
> Can't reproduce this error on Arch.
> 
> 
> 
> 2013/3/10 Hollister Herhold <[email protected]>
> 
> OK, I get the same results as you. I ran a dtruss on the two different apps 
> to look at the system calls being made and I can see where the C code opens 
> the OpenGL hardware driver and the haskell code does not, but I'm not sure 
> why. There are a lot of preferences files flying around. Still digging.
> 
> I do know that both apps are using the same glfw library.
> 
> 
> On Mar 10, 2013, at 8:23 AM, Hollister Herhold wrote:
> 
> >
> > I'm building glfw now on 10.7.5 and I'll try your test code.
> >
> > I've been learning haskell (still very much a beginner) but I know OpenGL, 
> > so I'm very interested in how this turns out.
> >
> > -Hollister
> >
> >
> > On Mar 10, 2013, at 4:38 AM, Jesper S?rnesj? wrote:
> >
> >> On Sun, Mar 10, 2013 at 4:46 PM, Jesper S?rnesj? <[email protected]> 
> >> wrote:
> >>> I've figured out what the problem is: the Haskell program is using a
> >>> software implementation of OpenGL, so rendering *does* in fact happen
> >>> on the CPU.
> >>>
> >>> It would appear that there is in fact some relevant difference between
> >>> the Haskell and C versions of my program, or possibly some way
> >>> in which the bindings from the GLFW-b package are different from the C
> >>> library.
> >>
> >> To remove any possibility of the problem being in GLFW-b or OpenGLRaw,
> >> I created two new programs, one in Haskell [1] and one in C [2], that
> >> don't import or include anything related to OpenGL, and that simply
> >> create a context, check if it is hardware accelerated, and then exit.
> >> That is all. And still, the Haskell program receives a software
> >> renderer, while the C program receives a hardware one:
> >>
> >>   $ ghc -O2 Test2.hs -lglfw -framework OpenGL -fforce-recomp && ./Test2
> >>   [1 of 1] Compiling Main             ( Test2.hs, Test2.o )
> >>   Linking Test2 ...
> >>   software
> >>   (2,7,7)
> >>   (3,2,0)
> >>   $ gcc -O2 test2.c -lglfw -framework OpenGL && ./a.out
> >>   hardware
> >>   2.7.7
> >>   3.2.0
> >>
> >> I haven't had the chance to run these programs on any OS other than
> >> Mac OS X 10.8.2, so I don't know if this problem is Mac-specific.
> >> Still, it's really weird that the system would differentiate between
> >> Haskell and C programs in this way.
> >>
> >> If anyone has any ideas about what's going on here, I'd very much like
> >> to hear them.
> >>
> >> --
> >> Jesper S?rnesj?
> >> http://jesper.sarnesjo.org/
> >>
> >> [1] https://gist.github.com/sarnesjo/5116084#file-test2-hs
> >> [2] https://gist.github.com/sarnesjo/5116084#file-test2-c
> >>
> >> _______________________________________________
> >> Beginners mailing list
> >> [email protected]
> >> http://www.haskell.org/mailman/listinfo/beginners
> >
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130310/1d3adf59/attachment.htm>

------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 57, Issue 10
*****************************************

Reply via email to