ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.44k stars 800 forks source link

Grapple Cat: Performance degrades after a few minutes #11389

Open n0samu opened 1 year ago

n0samu commented 1 year ago

Describe the bug

Link to SWF: http://i.notdoppler.com/files/grapplecat.swf

Grapple Cat works fine at first, but after a few minutes of gameplay its performance degrades significantly, making it just about impossible to play. This actually happens even if you lose the game and sit idle on the "game over" screen for a while. Here is what that looks like (notice the extremely low framerate):

https://github.com/ruffle-rs/ruffle/assets/71368227/09925014-9346-48f5-9ad9-6f34b85d8116

Clicking the "Play Again" button returns the game to a normal framerate, probably because starting a new game destroys the objects that had accumulated.

Expected behavior

The framerate should remain acceptable during a reasonable gameplay session.

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

Note that this is not improved by the upcoming WeakObject PRs.

n0samu commented 1 month ago

After leaving the game running for about 2 hours, I was able to observe similar slowdown in Flash Player. So I guess we're not necessarily doing anything wrong, but something is just very unoptimized in Ruffle compared to Flash Player.

https://github.com/user-attachments/assets/f97bd2d4-01e5-4f8d-a11a-f17f6bbfbea4