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

core ext javascript blocking time #60

Open
Messj1 opened this issue Apr 8, 2021 · 3 comments · May be fixed by #61
Open

core ext javascript blocking time #60

Messj1 opened this issue Apr 8, 2021 · 3 comments · May be fixed by #61

Comments

@Messj1
Copy link

Messj1 commented Apr 8, 2021

Ah yes. This is not pure, but there is an issue with the notify sometimes taking too long, so I tried to split up the work. Chrome complains sometimes about setTimeout handler taking too long to complete. This happens when it hovers around the 50ms mark.

Originally posted by @Download in #52 (comment)

@Messj1
Copy link
Author

Messj1 commented Apr 8, 2021

As shown, there is a problem in core/index.js ext function:

@Download I think this doesn't work since it seems to be a problem with the ext core function in notify 🤨

ulog - watch browser performance

The problem is, that this function calls itself with every logger instance. So it would be better to do the logger ext call asynchronous.

core/index.js:33

for (logger in ulog()) {
	window.setTimeout(function updateLogger() {
              ulog.ext(ulog(logger))
	}, 0);
}

As example with more than 20 ulog instances:

ulog - core ext performance

@Messj1 Messj1 linked a pull request Apr 8, 2021 that will close this issue
@Download
Copy link
Owner

Download commented Apr 8, 2021

Mmmm I think I like this idea!
Thank you thank you for your enthusiasm @Messj1 !!
I will review and merge this asap

@Download
Copy link
Owner

Download commented May 5, 2021

Ok so I did not merge this. Sorry.
The reason is that I noticed that there is a real perf issue, only when you change config and have many loggers.
With a thousand loggers it takes 4 - 8 seconds! That's way too long.

It's better to fix the real perf issue than to hide it behind setTimeout I think.

I have some ideas on how to tackle it but it might make the API for mods (even) more messy.... Then I got a new job and got totally swamped with work and stopped working on this for a while.
But I will get back to this. Eventually. You are not forgotten.

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

Successfully merging a pull request may close this issue.

2 participants