ruffle-rs / ruffle

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

Pipe Riders -- Lag #14770

Open thenickman100 opened 7 months ago

thenickman100 commented 7 months ago

Describe the bug

The game "Pipe Riders" experiences tremendous lag. piperiders.zip

Expected behavior

I expect the game to not lag.

Content Location

Game attached to bug report

Affected platform

Self-hosted version

Operating system

Windows 10

Browser

Google Chrome Version 120.0.6099.199 (Official Build) (64-bit)

Additional information

6 Jan 2024 build of Ruffle self-hosted

evilpie commented 7 months ago

The performance when running on desktop (not web, I know) seems acceptable now at least.

Lord-McSweeney commented 5 months ago

This has been improved even more now. I was doing some testing on the SWF; here are the most-called functions, in order of most- to least- called: sandy.core.data::Polygon/get depth() (5 ops, trivial getter) sandy.materials::Appearance/get frontMaterial() (5 ops, same trivial getter) sandy.materials::Appearance/get backMaterial() (5 ops, same trivial getter) sandy.core.data::Polygon/get material() (21 ops, a non-trivial getter) sandy.core.data::Polygon/get normal() (9 ops, a simple-ish getter) sandy.core.scenegraph::Shape3D/get enableBackFaceCulling() (5 ops, another trivial getter)

Maybe adding a special-case for getter functions like the top 3 could speed it up?