vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.69k stars 593 forks source link

Add jdisc support for brotli #5889

Open t1707 opened 6 years ago

t1707 commented 6 years ago

brotli compression algorithm (developed by Google) is considerably better in performance aspects(both speed and compression ratio) than gzip for both static and on-the-fly compressions.

I tried adding patch for brotli support but it seems like jdisc is built on jetty and as of now, jetty doesn't have any brotli support for dynamic requests(which is mostly the case for Vespa). I have created a separate issue here https://github.com/eclipse/jetty.project/issues/2553.

I think it's better to have support for brotli in Vespa. But it would be great to hear some comments from Vespa community?

bratseth commented 6 years ago

Thanks. Yes, supporting this makes sense when/if Jetty adds support.

joakime commented 6 years ago

Jetty already supports static / pre-compressed brotli served from the standard DefaultServlet.

There is currently no performant Brotli implementation for Java, which makes dynamic support difficult.

t1707 commented 6 years ago

@joakime

There is currently no performant Brotli implementation for Java, which makes dynamic support difficult.

Yes, agreed but I think that implementing JNI wrapper for Vespa would work too. As Pure Java version for decoding, is already available and writing wrapper for encoding shouldn't have that much affect over the performance.

bratseth commented 6 years ago

JNI is a PITA so I'd rather wait for somebody to write a pure Java implementation.