Reading and writing to the disk comes with a cost, so do other API calls or database requests.
Async writeFile?
You're right, it's better! But it will never be as fast as writing in memory.
Explanation for people who are new to JS: writeFile is async, a.k.a. it doesn’t leave the execution waiting for the file to be written.
writeFile
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.
re: Finding And Fixing Node.js Memory Leaks: A Practical Guide VIEW POST
VIEW FULL DISCUSSIONAsync writeFile?
You're right, it's better! But it will never be as fast as writing in memory.
Explanation for people who are new to JS:
writeFile
is async, a.k.a. it doesn’t leave the execution waiting for the file to be written.