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

Typing view slow performance #153

Closed
oasis345 opened this issue Mar 26, 2021 · 5 comments
Closed

Typing view slow performance #153

oasis345 opened this issue Mar 26, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@oasis345
Copy link

oasis345 commented Mar 26, 2021

first
thank you for letting me use a nice App!.

anyway I found a problem.

A lot of messages make typing slow. ( eventlistener, v-model ...)

So I fixed it temporarily.

Feedback thank u

room (2).zip

.diff

@antoine92190
Copy link
Collaborator

Can you create a pull request with your changes?

@yleclanche
Copy link

You can reproduce it on the demo page. You juste have to add a tons of message, and the typing is getting slower.
Instead of using a debounce, I think you could use v-model.lazy.
Or extract the textarea in another component to avoid rerenders.

@antoine92190 antoine92190 changed the title typing view slowly performance Typing view slowly performance Jul 1, 2021
@antoine92190 antoine92190 changed the title Typing view slowly performance Typing view slow performance Jul 1, 2021
antoine92190 added a commit that referenced this issue Jul 17, 2021
Fix #153 - Vanilla debounce and associated changes to improve performance
@natsumework
Copy link
Contributor

@antoine92190
#185 improved the typing performance, but the typing speed is still slow on mobile devices.
After loading about 30 messages on my phone, I start to feel the typing speed slows down. After loading about 100 messages, the typing speed becomes unacceptable.

It can be observed in debug mode that the components under room.vue will be rerendered every time typing in textarea.
I think we really need to extract the textarea to another component to avoid rerenders.

vue-chat.mp4

@antoine92190 antoine92190 reopened this Sep 18, 2021
@antoine92190
Copy link
Collaborator

antoine92190 commented Sep 19, 2021

Actually, I found out that this code is causing many re-renders

<template v-for="(idx, name) in $scopedSlots" #[name]="data">
  <slot :name="name" v-bind="data" />
</template>

It's used everywhere in the app to pass slots across components, not sure yet how to solve it.

Ref: vuejs/vue#6351

@antoine92190 antoine92190 added the priority To be fixed in priority label Oct 9, 2021
@antoine92190 antoine92190 added the help wanted Help from the community is appreciated label Nov 16, 2021
@antoine92190
Copy link
Collaborator

Fixed in 8393592

@antoine92190 antoine92190 removed help wanted Help from the community is appreciated priority To be fixed in priority labels Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants