File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed
Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1010[submodule "h1spec "]
1111 path = h1spec
1212 url = https://github.com/uNetworking/h1spec
13+ [submodule "libdeflate "]
14+ path = libdeflate
15+ url = ./libdeflate
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ int main(int argc, char **argv) {
1515 strcat (CXXFLAGS , " -march=native -O3 -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -std=c++20 -Isrc -IuSockets/src" );
1616 strcat (LDFLAGS , " uSockets/*.o" );
1717
18+ // We can use libdeflate as a fast path to zlib (you need to build it first)
19+ if (env_is ("WITH_LIBDEFLATE" , "1" )) {
20+ strcat (LDFLAGS , " libdeflate/libdeflate.a" );
21+ strcat (CXXFLAGS , " -DUWS_USE_LIBDEFLATE -I libdeflate" );
22+ }
23+
1824 // By default we use LTO, but Windows does not support it
1925 if (!env_is ("WITH_LTO" , "0" )) {
2026 strcat (CXXFLAGS , " -flto=auto" );
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ int main() {
1919 .passphrase = " 1234"
2020 }).ws <PerSocketData>(" /*" , {
2121 /* Settings */
22- .compression = uWS::CompressOptions (uWS::DEDICATED_COMPRESSOR_4KB | uWS::DEDICATED_DECOMPRESSOR ),
22+ .compression = uWS::CompressOptions (uWS::DEDICATED_COMPRESSOR | uWS::SHARED_DECOMPRESSOR ),
2323 .maxPayloadLength = 100 * 1024 * 1024 ,
2424 .idleTimeout = 16 ,
2525 .maxBackpressure = 100 * 1024 * 1024 ,
@@ -36,7 +36,9 @@ int main() {
3636 /* This is the opposite of what you probably want; compress if message is LARGER than 16 kb
3737 * the reason we do the opposite here; compress if SMALLER than 16 kb is to allow for
3838 * benchmarking of large message sending without compression */
39- ws->send (message, opCode, message.length () < 16 * 1024 );
39+
40+ /* Never mind, it changed back to never compressing for now */
41+ ws->send (message, opCode, false );
4042 },
4143 .dropped = [](auto */*ws*/, std::string_view /*message*/, uWS::OpCode /*opCode*/) {
4244 /* A message was dropped due to set maxBackpressure and closeOnBackpressureLimit limit */
Submodule libdeflate added at 8d351ab
You can’t perform that action at this time.
0 commit comments