-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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 section pool of ideas #302
Comments
@js-kyle You're the man I adjusted the list a bit and added my suggestion within the status column. Seems to me like we need to refine & enrich this list a bit with @BrunoScheufler and @sagirk , I personally plan to read some perf stuff in the next few days to be able to suggest few more p.s. Shall we add below the table a bibliography with great articles? |
@js-kyle I added @Berkmann18 idea from #256 about avoiding user land util methods @Berkmann18 Thanks for the great advice, you wanna take the lead and write this bullet? |
@i0natan Sure, I'll get on it when I can. |
I will remove |
Hey @mcollina, so we're pushing soon the performance section. The ideas we collected thus far are listed above, will be honored if you feedback or suggest some other ideas. Concurrent question - during the writing we're probably gonna benchmark few things and would like to ensure we pick the right benchmarking tools. As of API/network benchmarking I'm pretty confident with auto-canon (:)), what would you recommend for micro-benchmarks (e.g. compare the run-time of two different functions in-process)? |
Some notes:
Feel free to ping me for reviews. |
Thanks @mcollina!! Could you elaborate on 3? I think |
All the following examples are wrong: async function a () {
const content = fs.readFileSync(__filename)
return await b(content)
} async function a () {
return await b()
}
// Do not use async!!!
async function b () {
return 42
} async function a () {
return await b()
}
// Do not use async!!!
function b () {
return Promise.resolve(42)
} Avoid synchronous function can be intended as "always put async in front of functions" - which is a very bad advice. |
@mcollina Thanks a bunch for these words of wisdom. 99% resonates with me. Few minor following questions/remarks:
Could you recommend one or this is a tautology to saying there's not even one?
Just curious, any solid benchmarks on the cost of building the dependencies tree (e.g. evaluating 200 require calls and loading files)?
I believe this is related to blocking the flow with sync IO (e.g. fs.readFileSync, --trace-sync-io) - does this make sense? |
Ah okay I see. So we just need to clarify what we mean by avoid sync and possibly reword the tip. I have a small start on an issue that I've been meaning to turn into a PR. And I'll do that then ask for your help on clarifying the above if you don't mind. |
Yes exactly. |
@VinayaSathyanarayana @migramcastillo @Berkmann18 @js-kyle @TheHollidayInn @BrunoScheufler @js-kyle Performance writers, let's make this happen and share this vital knowledge? we would like release ~5 more performance items by 15th May. This means that if we take it together - each has to write a single bullet in a month. Would you like to participate? If yes, please pick from the approved items in the list above which is your favorite topics 👋 before writing the entire bullet, consider opening an issue for a short brainstorming - this can greatly help to ensure all the important piece of information are included @TheHollidayInn This release will include your generic list and don't block the loop items 😄 I'm taking the item "Focus on customer-facing metrics" and have more than a few ideas to share with the writers of the other bullets |
@i0natan I'm up for that. I'll happily have a go at either of the following:
|
@Berkmann18 I'm happy. @TheHollidayInn Is already taking care for this with a comprehensive generic list. Let's do treeshaking dependencies, would you mind opening an issue to discuss the TOC of this? See also @mcollina on this above: treeshaking is only one technique to boost the app start time, maybe we should focus on the goal (faster bootstrap) and name various techniques like tree shaking, minifying, etc. Could be also great to show some benchmark how faster a code/serverless boost when remove the need to resolve 200 files during bootstrap @BrunoScheufler @js-kyle @VinayaSathyanarayana @migramcastillo What's your preferred topics? |
@i0natan Wait, so @TheHollidayInn is working on both topics? |
@i0natan sorry I've been very busy lately, so I'm retaking this and reading some stuff above and in other issues, few doubts:
|
Note that |
Oh no, only on the 'generic items'. Can you handle the 'optimize dependencies for faster bootstrap' (or how you want to call it)? |
Both items are valid. I would prioritize the process replication since parallelizing things (Promise.all) is more of a generic advice that applies to many programming language where the need to replicate processes is more unique to the webserver-less approach of node. Pick your preferred idea. Shall we start with an issue that lists the TOC? |
Ah okay, sure! On that note, have you had time to explore the idea you mentioned on my test repo? |
Yes, can we hop on a call sometime next week? would you kindly approach via me at goldbergyoni.com? |
Sure, email sent. |
@Berkmann18 Cool, anyway feel free to push the faster bootsrap item |
Hello there! 👋 |
This is our list of performance best practice ideas. Here we filter and finalize the list of items to write about.
Based upon the discussion in #256, this is an issue to track what bullets are approved, and/or who is working on them.
The text was updated successfully, but these errors were encountered: