-
Notifications
You must be signed in to change notification settings - Fork 2k
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
1.7.0 "stats & performance" demo on my local have much bigger stats value than office demo site #1001
Comments
Thanks for reporting, I actually noticed this too while I've been working on some performance improvements. It turns out that the default Adding the line For example I'd recommend anybody using Webpack with Matter.js to make this change in their own config to get the correct performance in development builds, but also check your production builds too. It's now default on the development server in this project's own config too, but releases themselves should not have been affected. Let me know if this resolves for you, I'll likely have to make note of this in the readme I think. |
hi @liabru , adding dev-tool to the webpack.demo.config.ts fixed the issue. Thanks :) Now just wondering if prod will be affected by this. I can see the demo webpack config is resolve"matter-js" from src folder. It will be helpful to let demo to use "build" min file so we know the build file doesnt have this issue. |
Hello :) I have terrible performances running matter-js on a Vue-JS 2 project. I added the Have a good day :) |
Ok nevermind i found out the issue ! It seems to be due to Vue adding watchers ! If I set it as private to remove the reactivity things run fine ! That may help others knowing this :) |
@Durss thanks for the update, that will probably help some Vue users I'm sure. |
If you use the Vue 3 you need to use the shallowRef() for the engine, runner, bodies, etc (everything that has heavy and deep modifications). It avoid deep reactivity. |
Hi, Please, How do I set it as private to remove the reactivity things run fine ? I'm not quite sure what you mean |
If you're on vue 3 with class decorators you'll need to declare every matterjs vars outside of the class as simple vars. let engine = blabla;
class YourVueComponent {
public mounted() {
...
}
} With vue2 and class decorators just use private keyword |
Thank you very much for your reply. svelte1.svelte `<script lang="ts"> MatterEngine.ts constructor(canvas: HTMLCanvasElement) { } That's what I understand, but it doesn't seem to solve my problem. |
I saw 1.7 release on top of this issues list, so I tried checkout my local branch to 1.7.0, but the 2nd "ut" time after "fps" is 6 - 7 times longer than the same demo on 1.7.0 official site (https://brm.io/matter-js/demo/#stats), I can see the lagging issue when my local demo page just refreshed (when the balls start falling down).
I tried reopen browser (chrome 90.0.4430.72), re-installed whole node_modules folder, could reproduce the issue.
Below screenshot is taken from same PC side by side, left is official demo site, right side is my local demo running "dev" npm task.
Is there anything from my local webpack dev server will affect it?
Thanks for help.
The text was updated successfully, but these errors were encountered: