From: Bruce S. <Bru...@nc...> - 2012-06-08 23:15:09
|
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 <Bru...@nc...> 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 |