https://debugpointer.com/javascript/optimize-io-operations-javascript