phetsims / plinko-probability

"Plinko Probability" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
5 stars 7 forks source link

[Edge] Ball motion performance #92

Open phet-steele opened 7 years ago

phet-steele commented 7 years ago

The below Skype chat with @pixelzoom should speak for itself, but here is the test I ran.

Using this link, http://www.colorado.edu/physics/phet/dev/html/plinko-probability/1.0.0-rc.1/plinko-probability_en.html?maxBallsLab=100, set the rows to max and the binary probability to 1 (or 0). Keeping the hopper in Ball mode and selecting continuous play, I recorded the time it took until the "Out of Balls" window appeared, followed by how long it took all 100 balls to enter the bin.

Time to "Out of Balls" Time until bin is full
Edge 11.84 secs 27.93 secs
Other browsers 11.64 16.93
iPad 2 12.3 19.37

Frame rate comparison below. The video capture hardly does this justice, just watch the spacing between each ball:

Chrome pp02

Edge (much more bunched together) pp01

[9/19/16, 4:21:02 PM] Steele Dalton: Edge is taking longer to let its balls travel down the board, but still dispenses balls from the hopper at the same rate as other browsers [9/19/16, 4:22:34 PM] Chris Malley: What's the frame rate on Edge? [9/19/16, 4:24:11 PM] Steele Dalton: Running, before Out of Balls: 36 Running, after Out of Balls: 21 Idle: 60 [9/19/16, 4:24:27 PM] Steele Dalton: idk why it drops so fast after the Out of Balls pop up [9/19/16, 4:25:24 PM] Chris Malley: I suspect that dispensing is done at some constant rate (balls/second), whereas the motion of balls is some function of dt (the time between frames). So balls will be dispensed at the same rate regardless of platform speed, but will move more slowly on slower platforms. [9/19/16, 4:26:14 PM] Chris Malley: I haven't confirmed this, and don't know if it's intentional (by design). But this is what I suspect from the related code that I poked around in previously. [9/19/16, 4:26:15 PM] Steele Dalton: could also be the 4k screen [9/19/16, 4:26:32 PM] Chris Malley: yep, could be that too. Test the (my) hypothesis on iPad. [9/19/16, 4:28:47 PM] Steele Dalton: I’m pretty sure that’s how it works. The balls sort of “bunch together” on Edge, with less space between each falling ball [9/19/16, 4:29:01 PM] Chris Malley: Is that the case on iPad2 also? [9/19/16, 4:29:09 PM] Chris Malley: ... or some other slower platform. [9/19/16, 4:29:17 PM] Steele Dalton: and fewer balls have made it into the bin before Out of Balls pops [9/19/16, 4:29:21 PM] Steele Dalton: checking [9/19/16, 4:31:59 PM] Chris Malley: In the Intro screen, dt is constrained like this: [9/19/16, 4:32:01 PM] Chris Malley: var dtCapped = Math.min( 0.1, dt * 5 ); // Cap the dt so that the balls don't make a big jump [9/19/16, 4:32:13 PM] Chris Malley: In the Lab screen, it's constrained differently: [9/19/16, 4:32:21 PM] Chris Malley: var dtCapped = Math.min( 0.090, dt * 10 ); // Cap the dt so that the balls don't make a big jump [9/19/16, 4:32:54 PM] Chris Malley: Looks like b.s. to me. 0.1 vs 0.090 is not going to be noticeable. [9/19/16, 4:33:10 PM] Chris Malley: (units are seconds) [9/19/16, 4:33:22 PM] Steele Dalton: iPad2 actually performs much better than edge (albeit a little, tiny, small bit worse than other browsers) [9/19/16, 4:33:52 PM] Chris Malley: Does this phenomenon occur on both the Intro and Lab screen on Edge? [9/19/16, 4:34:40 PM] Chris Malley: Given the different calculations (dt_5 vs dt_10), I might expect it to occur on Intro but not Lab. [9/19/16, 4:35:26 PM] Steele Dalton: It’s hard to tell, I can’t set up a consistent test on the Intro tab, nor do I get the Out of Balls popup [9/19/16, 4:35:52 PM] Steele Dalton: fps while dropping all is 47 [9/19/16, 4:36:20 PM] Chris Malley: I'm inclined not to worry about it, since people aren't typically comparing rates across platforms. But create an issue if you wish. [9/19/16, 4:36:46 PM] Steele Dalton: I more than likely will, because 21 fps starts to look noticeably slow [9/19/16, 4:37:31 PM] Steele Dalton: it’s a mystery to me why fps would drop so far after dispensing has finished [9/19/16, 4:38:39 PM] Chris Malley: If you erase or reset, does the frame rate return to "normal"? [9/19/16, 4:39:01 PM] Steele Dalton: while balls are falling? [9/19/16, 4:40:08 PM] Chris Malley: let me understand... are you saying that when the "Out of Balls" dialog appears, the frame rate suddenly drops and that affects balls that are continuing to fall? [9/19/16, 4:40:17 PM] Steele Dalton: si [9/19/16, 4:40:40 PM] Chris Malley: curious. again, not too concerned because the user will be preoccupied with the dialog, not the balls.

For phetsims/tasks/issues/702. URL: http://www.colorado.edu/physics/phet/dev/html/plinko-probability/1.0.0-rc.1/plinko-probability_en.html?maxBallsLab=100 Version: 1.0.0-rc.1 2016-09-16 19:30:26 UTC Features missing: touch Flags: pointerEnabled, pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 Language: en-US Window: 1536x747 Pixel Ratio: 2.5/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 Vendor: Microsoft (Microsoft Edge) Vertex: attribs: 16 varying: 15 uniform: 512 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"7d27130a","branch":"HEAD"},"axon":{"sha":"e0192608","branch":"HEAD"},"babel":{"sha":"c041de05","branch":"master"},"brand":{"sha":"f0b1f7da","branch":"HEAD"},"chipper":{"sha":"07058555","branch":"HEAD"},"dot":{"sha":"39436598","branch":"HEAD"},"joist":{"sha":"b513b5ee","branch":"HEAD"},"kite":{"sha":"73302899","branch":"HEAD"},"phet-core":{"sha":"c48bf320","branch":"HEAD"},"phetcommon":{"sha":"83ea84c8","branch":"HEAD"},"plinko-probability":{"sha":"3a105d26","branch":"HEAD"},"query-string-machine":{"sha":"05231e54","branch":"HEAD"},"scenery":{"sha":"e78ee413","branch":"HEAD"},"scenery-phet":{"sha":"f0fc9ae8","branch":"HEAD"},"sherpa":{"sha":"bcc28cd6","branch":"HEAD"},"sun":{"sha":"f2bd9d60","branch":"HEAD"},"tandem":{"sha":"d369b847","branch":"HEAD"},"vibe":{"sha":"b422db9c","branch":"HEAD"}}

pixelzoom commented 7 years ago

My recommendation is to ignore this for 1.0.0 release, because:

(1) The performance is generally acceptable on Edge. (2) Edge represents a small percentage of PhET usage. (3) Users are unlikely to compare animation performance between platforms. (4) When the "Out Of Balls!" dialog is open, the user will be occupied with the dialog and not the fact that any balls still on the board may be moving a bit more slowly.

@ariel-phet @amanda-phet How do you want to proceed?

ariel-phet commented 7 years ago

@pixelzoom I think we are fine leaving this as an open issue, and considering addressing on a later release.

Marking priority deferred

amanda-phet commented 7 years ago

I agree that we should defer this issue. I'm not too concerned about the impact of the performance in this case.