Escribir/Leer archivos: NodeJS vs Python
Frecuentes
Visto 330 veces
0
I need to know what mechanism is more efficient (less RAM/CPU) to read and write files, especially write. Possibly a JSON data structure. The idea is perform these operations in a context of WebSockets (client -> server -> read/write file with data of the actual session -> response to client).... Best idea is to store the data in temporal variables and destroy vars when are not useful?
¿Alguna idea?
1 Respuestas
0
They will probably both be about the same. I/O is generally a lot slower than CPU, so the entire process of reading and writing files will depend on how fast your disk can handle the requests.
It also will depend on the data-processing approach you take. If you opt to read the whole file in at once, then of course it will use more memory than if you choose to read the file piece-by-piece.
So, the answer is: the performance will only (very minimally) depend on your choice of language. Choice of algorithm and I/O performance will easily account for the majority of CPU or RAM usage.
Respondido 28 ago 12, 08:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas python or haz tu propia pregunta.
Yeah, use database and don't worry about it. - freakish