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

Severe performance drop since 1.123 #12356

Open
jfayot opened this issue Dec 4, 2024 · 6 comments · May be fixed by #12358
Open

Severe performance drop since 1.123 #12356

jfayot opened this issue Dec 4, 2024 · 6 comments · May be fixed by #12358

Comments

@jfayot
Copy link
Contributor

jfayot commented Dec 4, 2024

What happened?

Since Cesium v1.123 I'm getting a severe performance drop when moving 10-20 entities on large distances.

Reproduction steps

Check below sandcastle. In Cesium v1.122 the FPS is 60 while here it is 6.

The strange thing is that if you change the playRate value from 64 to 1 (interval update staying unchanged to 50ms) the FPS is back to 60 with some drops from time to time.

The same thing occurs when using CesiumWidget instead of Viewer.
The same thing occurs when using PositionCallbackProperty instead of direct position update.

Sandcastle example

https://sandcastle.cesium.com/#c=jVNtb9owEP4rJ7QPoWQOUKgm3rSOalKlTavGtE+RVhMfYM2xke3AWMV/38VJaDfQNkTil3t57p57khntPOwk7tHCFDTuYY5OFjn7Gu6itJWF89xoz6VGm7ZieEo1gNuYQolbLXPucQQrrhzGqT62x6lOdZWSuQw1MoHLYr3YmP17y3N0D2gXmBktCNHbAkPAqtCZl0ZDZpESfjQCVSRFDFvjZGloV7AWfWF1XTJD7cmIjnEhomAHkGJET1wdmujRaVcb8hJgBHUMQGHlCNIWYwn9FzzfKrzjnifBzyUVK7fS1rtvtGVrtSQ6mgy5JC6K/EH+QLWQP4mT635tPIY1UHMsm1XoQXEqvRBIJAyGZFgZC1FpkHTTHdMygT6tnY6sW3/JzGPo/PDqSR4f42Zmc2497bi+Zitr8jtcW0QXve6xYXzCi+FNt9ttl7XAcxEdwmS9pr6a3YymZTlbqcMXU7Er0HmpecXo/6AO6Ol1w68dSBCFrcO7J7GUXWvqusTPgiK3ih8+U7N0eTMIPg79vfZod1xFURums5qT4K6MXjdklrjQoXxXz1muqDmqoN+7qbq+QD/AvwcAZ7Jbo393uBe/jaPNGqlRnr9zdKr7bDzjCu98PiSj8tXp6HJYMQyDbytuTZw/KJw1anwr862xnnStIlK0R1I0UeGSZZF9R88y5xqQSfIydCLkjr6f6YUvHzLFnSPLqlBB4mlrNknI/yxUGS6kXn/aoaUZlG6b3uxDdckYmyR0vBzpjVFLbv/I/As

Environment

Browser: Chrome 131
CesiumJS Version: v1.123 and above
Operating System: masOS Sequoia

@jfayot
Copy link
Contributor Author

jfayot commented Dec 4, 2024

git bisect is pointing to commit 12588d2 (Fix height)

@jfayot
Copy link
Contributor Author

jfayot commented Dec 4, 2024

DynamicEnvironmentMapManager.js, line 246:

  position: {
    get: function () {
      return this._position;
    },
    set: function (value) {
      if (
        Cartesian3.equalsEpsilon(
          value,
          this._position,
          0.0,
          this.maximumPositionEpsilon,
        )
      ) {
        return;
      }

      this._position = Cartesian3.clone(value, this._position);
      this.reset();
    },
  },

The setter was updated with an absolute and relative epsilon, which causes this regression.
Not sure however how this can be explained...

@jfayot
Copy link
Contributor Author

jfayot commented Dec 4, 2024

So yes, this is clear now: if the entity moves for more than 1000m (default DynamicEnvironmentMapManager.maximumPositionEpsilon value), then a new environment map is created. This clearly tears performances down.

So is there a way to disable this ?

@jfayot
Copy link
Contributor Author

jfayot commented Dec 4, 2024

I don't see any easy way to workaround this regression right now!
What would be the best way to fix it, still using the entity framework?
My first though would be to add another option to ModelGraphics constructor and to propagate it down to ModelVizualizer, and then use it to configure or disable the model's DynamicEnvironmentMapManager if it's possible.

What are your thoughts?

jfayot added a commit to jfayot/cesium that referenced this issue Dec 4, 2024
@jfayot jfayot linked a pull request Dec 4, 2024 that will close this issue
6 tasks
@ggetz
Copy link
Contributor

ggetz commented Dec 6, 2024

Thanks for pointing this out @jfayot! I'm looking into https://community.cesium.com/t/procedural-ibl-gpu-memory-leak/36760 now to hopefully address the underlying issue.

@ggetz
Copy link
Contributor

ggetz commented Dec 6, 2024

My first though would be to add another option to ModelGraphics constructor and to propagate it down to ModelVizualizer, and then use it to configure or disable the model's DynamicEnvironmentMapManager if it's possible.

I think this general approach will work, but have a more specific suggestion that I will comment over in your PR: #12358.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants