Daniel NicolettiBrazil, São Paulo http://dantti.wordpress.com 59 Posts
Cutelyst a Qt/C++ Web Framework got upped to 2.1. Yesterday I found a bug that although not critical it's important enough to roll out a new release.
As a new feature we have LangSelect plugin to help with auto detection of user language (Matthias).
And some important bug fixes:
- Fix compilation with Qt 5.11
- clazy fixes
- Fix undefined cutelyst2_plugin symbol of uWSGI plugin
- Fix for IPv6 address binding
- Fix StoreHtpasswd::addUser if file doesn't exist (Bart)
- Fix parsing when the url encoded (on body or query) has a key without a value but carries the equal sign (?foo=&bar)
Cutelyst the Qt/C++ web framework just got a major release update, around one and half year ago Cutelyst v1 got the first release with a stable API/ABI, many improvements where made during this period but now it was time to clean up the mistakes and give room for new features.
Porting applications to v2 is mostly a breeze, since most API changes were done on the Engine class replacing 1 with 2 and recompiling should be enough on most cases, at least this was the case for CMlyst, Stickyst and my personal applications.
Due cleanup Cutelyst Core module got a size reduction, and WSGI module increased a bit due the new HTTP/2 parser. Windows MSVC was finally able to build and test all modules.
WSGI module now defaults to using our custom EPoll event loop (can be switched back to Qt's default one with an environment variable), this allows for a steady performance without degradation when an increased number of simultaneous connections is made.
Validators plugins by Matthias got their share of improvements and a new password quality validator was added, plus manual pages for the tools.
The HTTP/2 parser adds more value to our framework, it's binary nature makes it very easy to implement, in two days most of it was already working but HTTP/2 comes with a dependency, called HPACK which has it's own RFC. HPACK is the header compression mechanism created for HTTP/2 because gzip compression as used in SPDY had security issues when on HTTPS called CRIME .
The problem is that HPACK is not very trivial to implement and it took many hours and made KCalc my best friend when converting hex to binary to decimal and what not...
Cutelyst HTTP/2 parser passes all tests of a tool named h2spec, using h2load it even showed more requests per second than HTTP/1 but it's complicated to benchmark this two different protocols specially with different load tools.
Upgrading from HTTP/1.1 is supported with a switch, as well as enabling H2 on HTTPS using the ALPN negotiation (which is the only option browsers support), H2C or HTTP/2 in clear text is also supported but it's only useful if the client can connect with previous knowledge.
I strongly recommend reading this https://jakearchibald.com/2017/h2-push-tougher-than-i-thought/ .
This does not mean SERVER_PUSH won't be implemented, quite the opposite, due the need to implement it properly I want more time to study the RFC and browsers behavior so that I can provide a good API.
I have also done some last minute performance improvements with the help of KDAB Hotspot/perf, and I must say that the days of profiling with weird/huge perf command line options are gone, awesome tool!
If you like it please give us a star on GitHub!
On Valentines day TechEmpower released the results of fifth round of it's benchmarks tests on web frameworks, it took almost a year since round 14 and I really hope round 16 comes out sooner.
Since this round took a long time and was scheduled to be release many times last year I decided not to update Cutelyst to avoid not having the chance to fix any issues and have broken results. Cutelyst 1.9.0 and Qt 5.9 were used, both had some performance improvements compared to round 14, and thus you can see better results on this round compared to 14, most notably the JSON tests went from 480k request/second to 611k req/s, also due this Cutelyst release used jemalloc was again not used due a bug we had in CMake files that didn't link against it.
In this round some other frameworks have also done their optimizations and a few managed to do better than Cutelyst, even though we were faster in all tests compared to the last round. It might be even related to some OS tuning as most results seemed to went up a bit, however if you put the filter on "FullStack" frameworks Cutelyst is leading in most tests.
TreeFrog framework had results in TechEmpower long before I wrote the tests for Cutelyst, but due errors on TreeFrog tests on last rounds this was the first round where you can compare the results of two Qt Web Frameworks.
For the next round I expect the results to be even better now that we will properly use jemalloc, and our epoll dispatcher got a better implementation, I also plan to use Cutelyst 2 and try increasing some buffers as the servers have plenty of RAM that I didn't care on using.
The year is about to end and so is Cutelyst v1 series, I wasn't planning for another release this year but Matthias added some nice new features that I decided to roll 1.12 in 2017 branching 1.x.x series and master is now officially Cutelyst 2 with no stable API/ABI until 2.0.0 is tagged.
HTTP/2 support will hopefully be part of Cutelyst 2.0.0, there aren't any drastic changes in v2, most important thing is fixing MSVC builds and removing deprecated API.
Back to this release it includes a new CSRF protection plugin, with a Grantlee tag similar to what Django has. Add to this many fixes and the epoll event loop dispatcher is now even faster and got many fixes, performance wise it's great advantage is when dealing with many simultaneous connections, it can lead to 2-3 times faster than default glib one.
Happy new hacking year!
Cutelyst the Qt Web framework got a new release, this is likely to be the last of the year and will be one of lasts releases of the 1.x.x series. I'd like to add HTTP/2 support before branching 1.x.x and having master as 2.0 but I'm not yet sure I'll do that yet.
For the next year I'd like to have Cutelyst 2 packaged on most distros soon due Ubuntu's LTS being released in April, and H2 might delay this or I delay it since it can be done using a front-end server like Nginx.
The 1.11.0 version includes three new plugins written by Matthias Fehring, a Memcached plugin that simplifies talking to a memcached server, a memcached based session store, that stores session information on the memcached server, and a static compressed plugin to serve compressed versions of static files.
Besides that I extended the EngineRequest class to serve as a base class for Engine's requests allowing to get rid of some ugly casts and void pointers that carry the real request/connection. This doesn't affect user code as long as they don't implement their own engine.
Setting a Json reply is now a bit simpler now that two overloads directly accepting QJsonObject and QJsonArray were added.
Cutelyst license preamble on files was fixed to state it's LGPLv2.1+, and finally pkg-config is now fully supported.
Go get/break/package/.* it!