Open noumantahir opened 2 years ago
@feruzm check this.... so far I do not have a lock on how we can avoid this...but at-least we have some direction https://user-images.githubusercontent.com/6298342/170830490-9fcead6d-f500-4368-b570-4100464be8a7.mov
@feruzm check this.... so far I do not have a lock on how we can avoid this...but at-least we have some direction https://user-images.githubusercontent.com/6298342/170830490-9fcead6d-f500-4368-b570-4100464be8a7.mov
Wow, it is indeed huge drop in performance. Maybe best way is to have single button that opens modal and in that screen explains how to format content? Static text and examples?! So people can type in formatting text or copy table snippet or code, that would still keep performance better, what do you think?
Note to self: Study in detail https://blog.swmansion.com/hunting-js-memory-leaks-in-react-native-apps-bd73807d0fde
Alright so far we have tried a few things to test if editor performance become better in any way.
Tried to value directly using state instead of setNativeProps Result: this rather reduces the performance as TextInput becomes tightly bound to state.
Removing font styling from TextInput, Result: this gives some benefit but still does not remove the slowing down editor when setNativeProps is using
Removing all modal in editor just to see if that improves the performance Result: does not seem to improve performance in any way, though it does reduce the heap size used, may be something we can consider optimising moving forward
@feruzm
Alright, so what better way to testing the performance then to compare feature with something else... I compared editing after 500 with GitHub application... apparently both application slows down when handling such number words, the difference however is that. our app slows down even further after using setNativeProps...
My take away is that...
Proposed solution...
https://user-images.githubusercontent.com/6298342/170869097-e5834ed4-1d95-4e9a-b4e0-80b77e5c59ec.mov
Wow, it is indeed huge drop in performance. Maybe best way is to have single button that opens modal and in that screen explains how to format content? Static text and examples?! So people can type in formatting text or copy table snippet or code, that would still keep performance better, what do you think?
@feruzm What I have understood is, it not toolbar that is the source of problem for TextInput itself.
App crashes randomly while writing a post in editor..
Reported by Melinda
editor change PRs https://github.com/ecency/ecency-mobile/pull/2267/files https://github.com/ecency/ecency-mobile/pull/2249/files https://github.com/ecency/ecency-mobile/pull/2245/files https://github.com/ecency/ecency-mobile/pull/2243/files
Feruz's opinion: Might be related to link detection that was added, when typing or adding images, maybe link detect script causes memory leak somewhere