Skip to content

add key for rendering items #220

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

Merged
merged 1 commit into from
May 28, 2020

Conversation

linniksa
Copy link
Contributor

@linniksa linniksa commented May 23, 2020

it will increase speed of VNode-Dom comparison and patch

for example for list of images when new slots added to the list only these images will requested from server (at this moment all 30 will be requested) also no visual glitches when this images downloaded (rerender from previous image to new)

it will increase speed of VNode-Dom comparison and patch
for example for list of images when new slots added to the list only these images will requested (at this moment all 30 will be requested)
@tangbc
Copy link
Owner

tangbc commented May 27, 2020

Did you make a comparison with it?

@linniksa
Copy link
Contributor Author

linniksa commented May 27, 2020

only by hands in chrome with x6 slowdownm, each item contains ~23-25 dom nodes (one of them is img)

default keeps (30) and slow scroll (range change)

before

[Violation] 'scroll' handler took 700-860ms and all 30 images requested from server (all images receives new src and request it from server or cache - this has visual glitch when new image replaces old image)

after
[Violation] 'scroll' handler took 370-460ms and 10 images requested from server and no visual glitch

full replace (.scrollToOffset(0)) almost the same ~800ms in both cases

@tangbc tangbc merged commit 1eb52b0 into tangbc:master May 28, 2020
@tangbc
Copy link
Owner

tangbc commented May 28, 2020

Er, this will make chat-room demo bug.

In here:

this.$nextTick(() => {
const vsl = this.$refs.vsl

Where $nextTick was triggered before item really render into DOM.

I need find out and check performance again.

@linniksa linniksa deleted the linniksa-add-key-to-slot-list branch May 28, 2020 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants