Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rapid is really slow #1145

Open
marcregan opened this issue Oct 4, 2023 · 8 comments
Open

Rapid is really slow #1145

marcregan opened this issue Oct 4, 2023 · 8 comments
Labels
feature-performance Yes, performance is a feature feature-renderer Issue or request related to the renderer / WebGL top-priority Top priority issue

Comments

@marcregan
Copy link

Description

  • When I hover over an element, it takes 1-2 seconds to highlight.
  • Same with selecting an element
  • When I click and drag the map, it often doesn't move. Sometimes it will move a second later.
Screen.Recording.2023-10-04.at.12.42.35.PM.sm.mov
Untitled.mov

Version

2.1.1

What browser are you seeing the problem on? What version are you running?

Chrome v117.0

The OS you're using

mac

Steps to reproduce

This always happens.
MacOS 13.5.2
Using a 5K external display.
Macbook 13-inch, M1, 2020.

The browser URL at the time you encountered the bug

https://rapideditor.org/rapid#background=MassGIS_2021_Aerial&datasets=fbRoads,msBuildings&disable_features=boundaries&id=w845058106&map=20.00/42.36584/-71.10221

The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

@Bonkles
Copy link
Contributor

Bonkles commented Oct 4, 2023

Using a 5K external display.

Hmmmmmm! That's very interesting. Also, neither Bryan nor I have the M1 macs yet, wonder if there's something going on there.

I'm using rapid in a 3440x1440 Ultrawide screen, but nothing near a 5k screen. I may have to do some testing with a similar display to see if there's something going on in webGL-land.

Things to try:

  • If you disconnect from the monitor and use Rapid in your laptop screen, does that change the experience for you?
  • What if you use an incognito window (without extensions)?
  • Does enabling wireframe mode (w) change the repsonsivity of the hovering?

@bhousel bhousel added feature-renderer Issue or request related to the renderer / WebGL feature-performance Yes, performance is a feature labels Oct 23, 2023
@bhousel
Copy link
Contributor

bhousel commented Apr 18, 2024

Hey I was scanning the issues and I realized that this one has some news that might be useful for people reporting laggy rendering performance, particularly in Chrome or Safari, and particularly with Apple laptops.. (this seems to disproportionally affect the Meta folks - @cbeddow @marcregan, maybe others?)

For background, ANGLE is the technology used in most browsers to render accelerated 3D graphics. This tech is being migrated from OpenGL to newer lower level libraries like Vulkan (non-Apple) and Metal (on Apple).

The new rendering backend should end up being more performant eventually, but right now it is still causing some issues, and the OpenGL option may be the best one for now.

@Bonkles learned that there is a flag you can use to switch this:

  • In Chrome open a new tab and navigate to chrome://flags/

  • Find the "ANGLE graphics backend" option, and switch it to "OpenGL" - restart your browser and you might see vastly improved performance!

Screenshot 2024-04-18 at 10 10 15 AM

Let us know if it helps!

@bhousel bhousel added the top-priority Top priority issue label Apr 18, 2024
@Bonkles
Copy link
Contributor

Bonkles commented Apr 18, 2024

This x1000. It didn't bite me until I switched from my 2019 Intel to a more-current M1 macbook pro. But the slowdown in Rapid was immediately obvious and I could compare side-by-side.

Changing from 'Default' to 'WebGL' improved my framerate pretty significantly.

@gy-mate
Copy link

gy-mate commented May 20, 2024

@Bonkles learned that there is a flag you can use to switch this:

  • In Chrome open a new tab and navigate to chrome://flags/

@bhousel Is there an option like that in Safari? I'm also experiencing slow performance on Safari 17.5.

@bhousel
Copy link
Contributor

bhousel commented May 20, 2024

@bhousel Is there an option like that in Safari? I'm also experiencing slow performance on Safari 17.5.

It looks like prior to Safari 17 there was a toggleable feature flag for "WebGL via Metal", but this has been removed and I guess they are considering it stable enough.
https://ios.gadgethacks.com/how-to/safaris-massive-upgrade-comes-with-over-18-new-features-for-iphone-ipad-and-mac-0385417/

I do know there are lots of other places in our renderer where we can still improve the performance a bunch, so this will get better over time as we do more profiling and learn to use Pixi in a more efficient way.

Specifically I know that Safari doesn't support requestIdleCallback, which is a call we use to schedule validation work. So, on Safari only, this work can interrupt other important things on the main thread. (this is part of why #1077 would be useful).

@gy-mate
Copy link

gy-mate commented May 20, 2024

I see. Thank you for the answer!

@eneerhut
Copy link

I forgot about this issue and just reset the ANGLE graphics back to default only to see performance regress immediately. @bhousel @Bonkles do you think it could be worth notifying a user to make this change if we detect they are using an M1 mac?

@bhousel
Copy link
Contributor

bhousel commented Sep 26, 2024

do you think it could be worth notifying a user to make this change if we detect they are using an M1 mac?

My hope is that this can be fixed in the Pixi library and we don't need to bother our users with this detail.
I'm kind of hoping that the upgrade to v8 #1495 improves this, but once the upgrade is behind us, we can dig in more.

Incidentally , I think this might be the fix:
https://x.com/SebAaltonen/status/1796168886477324629

Screenshot 2024-09-26 at 10 43 03 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-performance Yes, performance is a feature feature-renderer Issue or request related to the renderer / WebGL top-priority Top priority issue
Projects
None yet
Development

No branches or pull requests

5 participants