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

Performance improvement: linked lists for events #23

Closed
wooorm opened this issue Sep 29, 2020 · 3 comments
Closed

Performance improvement: linked lists for events #23

wooorm opened this issue Sep 29, 2020 · 3 comments
Labels
🏁 area/perf This affects performance 💪 phase/solved Post is done 💬 type/discussion This is a request for comments 🦋 type/enhancement This is great to have

Comments

@wooorm
Copy link
Member

wooorm commented Sep 29, 2020

Subject of the feature

Given that on large markdown files we are dealing with tons (literally, 100k or so) of events, improving performance might be switching from arrays to linked event objects.

Problem

Operations on big arrays can be slow, such as #21.
Switching to linked lists adds complexity (while removing it in certain other cases!), but will probably/hopefully improve perf.

Alternatives

We’re already using really fast array methods. And everything is mutating already. Maybe linked lists won’t net a lot.

@wooorm wooorm added 🦋 type/enhancement This is great to have 🏡 area/internal This affects the hidden internals 🙉 open/needs-info This needs some more info 💬 type/discussion This is a request for comments 🏁 area/perf This affects performance and removed 🏡 area/internal This affects the hidden internals labels Sep 29, 2020
@wooorm wooorm added 👍 phase/yes Post is accepted and can be worked on 🙆 yes/confirmed This is confirmed and ready to be worked on and removed 🙉 open/needs-info This needs some more info labels Apr 12, 2021
@3y3
Copy link

3y3 commented Aug 25, 2022

Things about linked list
https://gist.github.com/3y3/cd4d9272a5a309502ae7c2bf961788d1

This improves speed x2-x3 on this benchmark, but slows down processing of small files in markdown-it benchmark

@wooorm
Copy link
Member Author

wooorm commented Aug 25, 2022

Ah, cool! Thanks for checking and providing code :)

This comment has been minimized.

@wooorm wooorm added the 💪 phase/solved Post is done label Apr 15, 2024
@github-actions github-actions bot removed 👍 phase/yes Post is accepted and can be worked on 🙆 yes/confirmed This is confirmed and ready to be worked on labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏁 area/perf This affects performance 💪 phase/solved Post is done 💬 type/discussion This is a request for comments 🦋 type/enhancement This is great to have
Development

No branches or pull requests

2 participants