Replies: 6 comments 12 replies
-
No there is nothing for that. I recommend to pause the runtime in the
debugger while it freezes to see if you're in an endless loop, or to run
the profiler and check what takes so much time.
…On Fri, 8 Jan 2021, 18:56 Merynek, ***@***.***> wrote:
Hello,
I have problem with mobx freeted browser after big change.
I tried it without mobx and it works, so Issue is in mobx observable or
observer (mby)
private bigStore: IStore {
// some observable properties
store: {
// some observable properties
storeArray: [
// some observable stores with obserable properties
]
}
}
@action
private async processMethod(arg1: number, arg2: number) {
this.bigStore.processBigChange(); // this line change very big and deep store with observable and another stores.
}
The issue is that i run lot of changes on stores which have lot of
observable properties and it stops main thread in browser,
I tried it run in setTimeOut, but I need run it in one transaction
(action).
Is it possible to disable mobx reaction, actions and every call in mobx
for this code? and after that I turn on again, mby it is not that issue but
I tried lot of things but no success :-(.
*Version*
"mobx": "^5.15.7",
"mobx-react": "^6.3.1"
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2705>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBBH3YPOQHCUYGOW3B3SY5INZANCNFSM4V22RZNQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Ok, the chrome profiler is perfect then to find out where it is spend.
…On Fri, 8 Jan 2021, 19:19 Merynek, ***@***.***> wrote:
It freezed only for 20second, it is not endless loop
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2705 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBAOL2OEMWHESY4INUTSY5LDPANCNFSM4V22RZNQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Also check modifiers like observable.ref / .shallow in case you're making
things unnecessarily deeply observable
…On Sun, 10 Jan 2021, 15:20 Daniel K., ***@***.***> wrote:
Without some actionable example, we can't really do much. You have to
either profile it specifically yourself, might be some reaction that's
taking too much time. Or supply runnable example that shows the problem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2705 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBF4TQ4XEIYUHOMNMXTSZHASFANCNFSM4V22RZNQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Here is the example of my issue. Stores:
View:
Data:
|
Beta Was this translation helpful? Give feedback.
-
In the example I notice you do twice a lookup by id using a find operation,
which makes your update quadratic in performance, I expect the slowness
will disappear if you use maps instead where your items are stored by id
(or if you do the updates in terms of index). Note that maps do preserve
insertion order.
…On Mon, Jan 11, 2021 at 9:19 AM Merynek ***@***.***> wrote:
Here is example:
Just click on update.
There is debugger before and after long action, and rerendere is freeze
the browser.
https://codesandbox.io/s/gracious-tereshkova-jo6qd?file=/src
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2705 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBDXNEQXDP4EUK24TCLSZK7CJANCNFSM4V22RZNQ>
.
|
Beta Was this translation helpful? Give feedback.
-
I'm assuming something like this might help:
https://github.com/petyosi/react-virtuoso
…On Mon, Jan 11, 2021, 7:52 AM Merynek ***@***.***> wrote:
Yes, you are right. Find function is called everytime.
@FredyC <https://github.com/FredyC> - "And if you limit rendering to for
example to 20 first items you get a pretty fast response given the amount
of data it's processing there."
What does it mean? Rendering part by part? Using i setTimeout ??
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2705 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCW4U5TNX4ABM3SRGFFLLSZL7DLANCNFSM4V22RZNQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I have problem with mobx freeted browser after big change.
I tried it without mobx and it works, so Issue is in mobx observable or observer (mby)
The issue is that i run lot of changes on stores which have lot of observable properties and it stops main thread in browser,
I tried it run in setTimeOut, but I need run it in one transaction (action).
Is it possible to disable mobx reaction, actions and every call in mobx for this code? and after that I turn on again, mby it is not that issue but I tried lot of things but no success :-(.
Version
"mobx": "^5.15.7",
"mobx-react": "^6.3.1"
Beta Was this translation helpful? Give feedback.
All reactions