Re: Does Glowscript have numpy-like performance?

Bruce Sherwood <[email protected]> Fri, 8 Jun 2012 20:36:38 -0600
Newsgroups gmane.comp.python.visualpython.user
Message-ID <CAFDG03jAd-WO_XcgmnxpZUuE0r3LvJs-egKzaEQ8zr5nzywj4A@mail.gmail.com>
I was wrong. Firefox on my Windows 7 machine is also a 32-bit
application, but it runs the gas program about twice as fast as
Chrome. I also see the higher speed in Safari on a Macbook Pro of
comparable speed.

Bruce Sherwood

On Fri, Jun 8, 2012 at 3:49 PM, Bruce Sherwood <[email protected]> wrote:
> Correction: I made my measurements with Chrome on a 64-bit Windows
> machine, unaware that Chrome runs slowly on 64-bit machines because it
> is a 32-bit application. Here are improved measurements, copied from
> comments in the GlowScript program:
>
> On a 32-bit Windows computer running Chrome: VPython gas.py with 100
> atoms, dt = 1e-5, rate(100), no graphing: 100 iterations = 1 second.
>
> The similar Glowsript program with same conditions: 100 iterations =
> 4.5 seconds.
>
> /With rate(300), VPython is 0.35 s, GlowScript remains 4.5 s.
>
> Presumably the big difference is the Python numpy library, which runs
> at C speed, and which eliminates some explicit loops.
>
> Note that on a 64-bit Windows computer Chrome runs this program half
> as fast as on a 32-bit computer, because Chrome is a 32-bit
> application. On 64-bit Windows Firefox is a 64-bit application and
> runs the program twice as fast as Chrome.
>
> Bruce Sherwood
>
> On Thu, Jun 7, 2012 at 10:47 PM, Bruce Sherwood <[email protected]> wrote:
>> I've now converted the VPython demo program gas.py to GlowScript:
>>
>> http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/HardSphereGas
>>
>> To run the program, you need to have a WebGL-enabled browser and a
>> modern graphics card. For details, see the Help at glowscript.org.
>>
>> As for speed, this is what I found:
>>
>> VPython gas.py with 100 atoms, dt = 1e-5, no graphing: 100 iterations
>> = 1.1 seconds. This similar Glowsript program with same conditions:
>> 100 iterations = 11.7 seconds. Presumably the big difference is the
>> Python numpy library, which runs at C speed, and which eliminates some
>> explicit loops.
>>
>> Bruce Sherwood

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/