SDCH compression for Node?
Asked Answered
G

1

21

Is there a SDCH (Shared Dictionary Compression over HTTP) library for Node? (Or any other implementations for that matter?)

A quick search on npm yielded nothing.

Gynecology answered 24/2, 2012 at 1:36 Comment(5)
Is it just on papers, or there is an implementations of it?Grooms
@alFReDNSH: Chrome implements SDCH decompression. What's really needed is a Node module that implements the VCDIFF algorithm, which is what SDCH uses to compress data. Chrome's implementation was open-sourced as open-vcdiff.Gynecology
A dirty and not really perfect implementation would be to spawn the binary command, pipe data to it, and then pipe the result to HTTP. This has an overhead due to creating the process and reading the dictionary file. I think a better one would be to write node bindings for it and then create it as a separate(since I think it's CPU intensive and blocks the event loop, though not measured) node process, and pipe data over IPC or STDIN and STDOUT.Grooms
Given that I'd like to use this on a high-load server, performance is paramount. I don't think spawning a separate process will yield acceptable results. That's why I'm looking for a VCDIFF module that works exactly like Node's zlib module. The module does the computationally expensive compression on a separate thread; it does not block the event loop, nor does it incur the overhead of IPC.Gynecology
@niutech: That project doesn't actually have any code.Gynecology
D
1

Looks lik this is still in a very early phases, and nothing out there seems to have an internal implementation (apache, nginx, etc)

Here is a JS library implementing VCDIFF https://github.com/plotnikoff/vcdiff.js. But there doesn't seem to be anything to implement the content negotiation with Chrome.

Disputable answered 2/5, 2013 at 2:58 Comment(1)
I've seen that library. Of course doing the compression in JavaScript means you're doing the heavy computational lifting on the event loop thread, which makes is a very bad thing.Gynecology

© 2022 - 2024 — McMap. All rights reserved.