I wrote an application that accumulates data (a few MB/sec, but updated like 10 times a second) and displays the current process in the browser via javascript.
The problem is that currently I write the data to file and load it with javascript, but this makes the application very laggy and people are complaining that their hdd is working a lot.
I would love to use some flags like “FILE_ATTRIBUTE_TEMPORARY” to tell my OS to not actually write the files to disk, but javascript requires me to close the file handle first (otherwise firefox couldn’t open it). Thus it will be written to disk at that point, killing the point in initially using that flag.
I thought about using something like a mysql database, but I really want to keep it as simple as possible, and I would prefer a solution that doesn’t force the user to set up some http or mysql server.
Include a webserver in your standalone C++ application and serve the data directly from memory.
I think that is the only option to avoid the I/O overhead which you are facing now. There is no interface to IPC, message queues or something similar in JS. TCP (or UDP, with websockets) seems to be the only possible way to avoid disk I/O. Another option would be to replace your JavaScript with a Browser Plugin which can access the capabilities of your operating system in native code.
Note: In a UNIX environment, you can create a FIFO socket in the File System, which may (or may not) serve your purpose as well. I don’t think windows supports something like this, though.