-
Notifications
You must be signed in to change notification settings - Fork 5
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
Optimizing for faster load times #48
Comments
Thanks so much for this! I am not super active wth this project anymore so I can't promise that this will all get addressed. As you can probably tell, this was hacked together to fit some idea in my head with the sincere hope that I would have the time and energy and support to rewrite it in a better language one day. And this hasn't happened. I started a rewrite in django and didn't get anywhere. As to the specific concerns
|
holy shit LMAO But yeah, I completely understand both the feeling of not having enough time for one specific project (because you just randomly started 4 other big projects last week for no reason what so ever), and the feeling when you just decide to rewrite an entire app for shits and giggles but then spend 100 hours refactoring random arbitrary bits of code before you give up lol Want me to make a gradient in inkscape real quick that looks similar enough to pink.jpg, but is significantly smaller? It wouldn't take too long. |
Okay, so I spent like 30 minutes making an svg that looks pretty similar, and then I loaded it in chrome and it turns out it uses svg 2.0 features that have actually been removed from the svg spec, and takes like 30 seconds to load in chrome and firefox I'm gonna figure out how else I can do it without that feature... |
Optimizing for faster load times
Here are some issues I noticed with load times on your site:
sortable.js
is not minified.sortable.min.js
andsortable.js
. Not sure why.owasp-password-strength-test.js
is not minified.moment.js
is not minifiedWhen on the root page, it seems to load every. single. pronoun... This takes around 400ms and should probably be avoided. I'm assuming this is for the feature to load 3 random example pronouns for new users, but you should probably:
(Looking at the code, it seems like you're caching them, but I don't believe you're cacheing the raw string data. If there's a way to do that (again, idk js), then perhaps you might be able to speed it up. I believe you should just be able to do something like
let cachedString = JSON.stringify(obj)
, and then you can send it withres.send(cachedString)
. I believe this should be faster, and won't introduce any weird bugs.)loooooool what's
pink.jpg
??? It seems to load a 1MB image every single time it loads the main page, which can take around 300ms-400ms to load. (with my internet speeds. Which are pretty good, though not the best. But still, gives you an idea of how it's a tad too big.)Edit: okay I figured out that it's on the home page for non logged in users. But there are a few very obvious optimizations you can (and should) make:
Other than that, the next slowest things are all the js scripts the browser needs to download, and the main html file itself, which seems to take around 200ms of waiting and 100ms of download. (You don't happen to be dynamically generating custom html content per user by any chance, do you? Because if so, that should reaaally be avoided...) But I'm assuming there aren't many optimizations that can be done there, as you probably need most, if not all, of those js scripts for fancy js stuff.
(Okay actually, I just checked and it seems all the pages take like 300ms-500ms to load... And looking at the source, you don't seem to be doing any dynamic bullshitery, though I could be wrong, so the long wait time might just be because nodejs is slow, and bad, and sucks, and nobody should ever use it lol. It might be worthwhile to eventually switch to java with sprint boot, but I'm not going to, in all seriousness, suggest that you completely throw out all the code and rewrite it from scratch for some slight performance boosts. Realistically, nobody's gonna do that, but you might want to switch one day. idk.)
Also, I just want to let you know that none of this stuff is "you must do it or else your app will die", these are just some perf optimizations that I thought of which shouldn't be too hard to implement. I just like applications with minimal amounts of bloat, and thought I'd point these out.
The text was updated successfully, but these errors were encountered: