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

Expensive render / Takes a second or two to initialize #769

Closed
brunolemos opened this issue Feb 26, 2018 · 23 comments
Closed

Expensive render / Takes a second or two to initialize #769

brunolemos opened this issue Feb 26, 2018 · 23 comments
Labels

Comments

@brunolemos
Copy link

brunolemos commented Feb 26, 2018

Issue Description

GiftedChat is a bit slow to initialize : to show some cached messages. Seems like it's not optimized for performance.

Related report on this comment: #298 (comment) by @amitava82

Steps to Reproduce / Code Snippets

Render a GiftedChat with a dozen messages set.

Expected Results

See messages instantly, without seeing a loader nor a blank screen.

Additional Information

  • Nodejs version: 8.9.0
  • React version: 16.2.0
  • React Native version: 0.52.2
  • react-native-gifted-chat version: 0.2.9
  • Platform(s) (iOS, Android, or both?): iOS (did not test on android)
@brunolemos brunolemos changed the title Delay to show cached conversation Takes a few seconds to initialize / Delay to show cached messages Feb 26, 2018
@brunolemos brunolemos changed the title Takes a few seconds to initialize / Delay to show cached messages Expensive render / Takes a few seconds to initialize Feb 27, 2018
@amitava82
Copy link

Yes, it is because of the md5 calculation that adds up time depending on number of messages. Once #705 gets merged, it should be fast

@brunolemos brunolemos changed the title Expensive render / Takes a few seconds to initialize Expensive render / Takes a second or two to initialize Feb 27, 2018
@brunolemos
Copy link
Author

Not sure about that, I tested that PR and the initial render speed was not affected

@Jarred-Sumner
Copy link

@amitava82 is it possible to avoid doing the MD5? Perhaps just relying on the IDs of the messages and requiring the contents of the message otherwise to be immutable? Or would that not work?

@nuonical
Copy link

@Jarred-Sumner I removed the MD5 calculation and just used id's, and I didn't really see a performance difference.

@rodgetech
Copy link

Any updates on this yet?

@Faolain
Copy link
Contributor

Faolain commented Dec 8, 2018

any thoughts here @FaridSafi ?

@stale
Copy link

stale bot commented Feb 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 12, 2019
@adilosa
Copy link

adilosa commented Feb 18, 2019

Still experiencing this issue. I've added a spinner underneath the <GiftedChat> component to smooth out the UX a bit, but the delay is still too long.

I also noticed the Chat screen with <GiftedChat> gets unmounted when navigating back to the main contacts list screen. Perhaps this issue could be mitigated by leaving the Chat screen mounted.

@stale stale bot removed the wontfix label Feb 18, 2019
@stale
Copy link

stale bot commented Apr 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 26, 2019
@piranna
Copy link

piranna commented May 3, 2019

We are having the same problem here.

@stale stale bot removed the wontfix label May 3, 2019
@iskenz
Copy link

iskenz commented May 10, 2019

Same here !

@hubermat
Copy link
Contributor

hubermat commented Jul 5, 2019

Same here.

@stale
Copy link

stale bot commented Sep 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 3, 2019
@stale stale bot closed this as completed Sep 10, 2019
@aravi365
Copy link

The issue still persist! Any workarounds?? anyone ??

@noway
Copy link

noway commented Mar 9, 2020

Can this be reopened?

@noway
Copy link

noway commented Mar 9, 2020

It might be happening because the component spends first render on getting the height of the parent view:

isInitialized: false, // initialization will calculate maxHeight before rendering the chat

@axeljeremy7
Copy link
Contributor

anyone has fixed or can explain?

@fractalgelfo
Copy link

following, experiencing some supreme, UI-blocking slowness with long chat threads (100+ messages)

@AliSaeed090
Copy link

Still facing the same issue. Is there any update or any fix? using "react-native-gifted-chat": "^0.16.3",

@dwome
Copy link

dwome commented May 4, 2022

Same for me. Experiencing the performance slow down even for simple text messages

@ChronoByteCosmonaut
Copy link

Same

@WillSmithTE
Copy link

I see there are already some sponsors on this project, what would it take to push this great library's focus towards performance for a while?

@derek-primumco
Copy link

I'm not sure anyone has identified why the first-pass rendering is so slow.

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

No branches or pull requests