Remix.run Logo
diffuse_l 2 days ago

I'm pretty sure that the website will reside in cache in any case.

cr125rider 2 days ago | parent [-]

Yup! The kernel will pull the page from disk and keep it in its disk cache in RAM. Since the kernel is solely in control of what gets written to disk it can be sure it doesn’t become stale, just “dirty” when it gets updated. It will then flush it to disk, but still keep active, hot pages in memory.

gnyeki 2 days ago | parent [-]

Yes, neither Nginx nor Neovim should be hitting the disk when serving the requests.

One difference I can imagine is context switching due to system calls. If Nginx incurs a context switch when it calls into the kernel for the disk cache, then it suffers a performance penalty. Neovim avoids this because the file contents are loaded into a table. When requests are served, getting the content is done fully in userspace.

I have no idea if this actually accounts for the performance difference though.