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
Infinite loop (in scheduler?) #86
Comments
I debugged the benchmark, there are two reasons:
|
I looked around, and there's not much to go on - but I did find this: vuejs/vue@850555d#diff-9ddd49414faddc237ff7c47aedcb12ff It looks like Vue also had problems with The commit log says this fixed a number of problems: Here's the current version on their dev-branch: https://github.com/vuejs/vue/blob/dev/src/core/util/next-tick.js Maybe this is helpful? That's all I could find. |
I'm back. I fixed this bug now. The behavior of fre is now similar to react. When the task has expired, it will render synchronously. But I made a buffer. It should expire more slowly than react. |
Same problem as before, sorry. It's not random - I have exact steps to recreate the problem:
It consistently freezes up moments after the last click on "Swap Rows". You actually see the log message in the console before it freezes - and there's a moment after that where the browser is still responsive: table rows still highlight if you move the mouse over the table immediately after pressing "Swap Rows". My guess is the loop somehow doesn't end after "Swap Rows" - it keeps going for some reason... I'm betting you could set a breakpoint in exactly the right place, you'd be able to see what it's doing after it completes the "Swap Rows" operation? |
Today's research results, I have found the cause of memory leaks, which from dom and reconciler.I still need some time. |
I wish I could be of more help, but I honestly don't understand all the details. 😌 |
Good news, I have fixed this bug now. You can check the latest code. Now I'm trying to explain why. When we remove the elements, I find that we will skip the updates of buttons, which causes the events of buttons to not be removed, and eventually leads to memory leakage. Now it works well, including scheduler and reconciler. |
I'm sorry, I haven't had a chance to look at your work in the past few days. I just checked current I don't know how come the tests are passing? (The scheduler of course works differently under test, because It looks you introduced a call to |
In the benchmark, only one line was added because I used a while loop for commitWork, which may not save variables in the stack. I have no idea for it now. You can change your code here, move it inside the Component, such as here Also you can check the benchmark demo, It works well. And for the tests, I only change the |
The one in your demo folder? I'm talking about Krause's benchmark - and it looks similar to the one in your demo folder, it just doesn't work anymore. This is the one I've been testing with. I found the crashing/freezing issues while running this. Those issues aside, it was able to render before, and now doesn't work at all. Maybe try it out and see what you make of it? I don't know why it shouldn't work. There are not errors in the console when pressing the "create rows" button, it just doesn't work anymore.
Would it make more sense to just use |
|
Look at this line, this is why benchmark not work, just move it inner component. |
Hey, I created a PR, please check it: mindplay-dk/js-framework-benchmark#1 |
I've fixed all bugs now. I hope this is the last time. benchmark is works well now. |
Benchmark confirmed: no stalling or freezing, produces expected results! 😀🎉 I do believe this introduced a new issue with Good work! 🙂 |
The problem of useeffect is here: #87 |
(You said in #84 you thought this problem was fixed, but I still have this issue with version
1.8.7
- I'm opening a separate issue to avoid getting sidetracked in other issues.)I've created a preliminary benchmark, which sometimes causes Chrome to lock up:
The only way out is to kill the browser tab via Chrome's task manager.
To recreate the problem, be sure to build the fre benchmark with
npm run build-prod
- for some reason, the problem doesn't seem to appear withnpm run build-dev
, not sure (?)Click on the button to create 10,000 rows - then click repeatedly on the "update" and "swap" buttons, which seem most likely to trigger the problem.
The text was updated successfully, but these errors were encountered: