Well, having the compressedData array isn't going to be very efficient as it's just a normal array by the look of it. I'd consider just having a big ArrayBuffer and then use a DataView to set the 3 bytes directly. It even has a setUint16 so you can avoid that shifting you were doing.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well, having the compressedData array isn't going to be very efficient as it's just a normal array by the look of it. I'd consider just having a big ArrayBuffer and then use a DataView to set the 3 bytes directly. It even has a setUint16 so you can avoid that shifting you were doing.