Cutelyst 0.8.0 – featuring better stats

Cutelyst the Qt Web Framework just got a new release!

With 0.8.0 some important bugs got fixed which will allow for the CMS/Blogger app CMlyst to get a new release soon. Besides bugs being fixed a class to take out stats from the application was created, Cutelyst::Stats matches what Catalyst::Stats does, and produces a similar output:

cutelyst-stats

 

  • There you have a box, and the time which each action took to complete, looking at the /End action it is clear that it took more time but most of the time was due it calling the Grantlee View.
  • On the Request took: …  line there is the 1278.772/s value which means how many requests could be handled within a second, of course that value is for the exact same request and for the single core where it was run.
  • The first line now shows which HTTP method was used, which resource the user wants and where the request came from.

All of that can and should be disabled on production by setting cutelyst.*.debug=false on the [Rules] section of the application ini file (–ini of uWSGI). Yeah this is new too :)

Speaking of debugging we now have more information about what user data was sent, if cutelyst.request.debug logging category is enabled you will see:

cutelyst-body A similar output is printed for url query parameters and file uploads.

The HTTP/1.1 support for chunked responses was added, once c->response()->write(…) is called the response headers are send and a chunk is sent to the client, this is new and experimental, but worked without complaints from web browsers.

An easier way to declare action arguments or capture arguments was implemented, :AutoArgs and :AutoCaptureArgs, both are not present in Perl Catalyst because there is no way to introspect methods signature in the language, @_ can provide many things, but with Qt meta information we can see which types of arguments a method has as well as how many arguments:

C_ATTR(some_method, :Local :AutoArgs)
void some_method(Context *c, const QString &year, const QString &month);

That will automatically capture two arguments matching an URL like “/some_method/2014/12″.

Last the Headers class got many fixes and improvements such as striping the fragment due RFC 2616.

As always if you have questions show up in #cutelyst at freenode or send me a mail.

Download 0.8.0 here

Enjoy!

Cutelyst 0.8.0 – featuring better stats

Cutelyst 0.7.0 is out and now has a tutorial!

Cutelyst the Qt/C++ web framework just got a new release, 0.7.0 brings many improvements, bugfixes and features.

Most notably of the changes is a shinny new Chained dispatcher that finally got implemented, with it Cutelyst Tutorial got finished, and a new command line tool to bootstrap new projects.

* Request::bodyData() can return a QJsonDocument is content-type is application/json
* Chained dispatcher
* Fixes on QStringListeral and QLatin1String usage
* More debug information
* Some API changes to match Catalyst’s
* Some rework on the API handlying Plugins (not the best thing yet)
* Moved to Gitlab (due to the gitorious being acquired by it)
* “cutelyst” command line tool

For the next release I’ll try to make the QML integration a reality, and try to improve the Plugins API, which is right now the part that needs more love would love to hear some advice.

Download it here.

Have fun!

Cutelyst 0.7.0 is out and now has a tutorial!

CMlyst got it’s first release

Now that Cutelyst is allowing me to write web applications with the tools I like, I can use it to build the kind of web applications I need but am not fine with using the existing ones…

WordPress is a great software, but it’s written in PHP, which is not a language I like, and there are many other software like this written in all sorts of languages but C++/Qt/Cutelyst, so why not?

This first release is a very shine one, it allows for templating, static pages and posts (without comments) and even a RSS feed.

To make things more interesting CMlyst has a separate library, this library abstracts the Content Management part, allowing for different backends to be written, the current one is based on QSettings files, but it’s very easy to write one for SQL, git who knows :P

I have not measured it speed against WordPress or any other CMS, it probably won’t be fair. But if you are curious I have run it against weighttp and it gives me 4k req/s on a page show, 2,5k req/s on last posts listing and 6,5k on RSS feed delivering, this on a Core2Duo 2.4Ghz, using ~10MB of RAM.

Give it a try!

Download here.

CMlyst got it’s first release

Cutelyst 0.6.0 is released

Cutelyst, the Qt/C++ web framework just got another step into API stabilization.

Since 0.3.0 I’ve been trying to take the most request per second out of it, and because of that I decided to replace most QStrings with QByteArrays, the allocation call is indeed simpler in QByteArray but since most of Qt use QString for strings it started to create a problem rather than solving one. Grantlee didn’t play nice with QByteArray breaking ifequal and in the end some implicit conversions from UTF-8 were triggered.

So on 0.6.0 I’ve replaced all QByteArray usage in favor of QString, and from the benchmarks of hello world the difference is really negligible.

Another big change I actually took today was to change the Headers class that is used on Request and Response, the keys stored there were always in camel-case style and split by dashes, and if you want to get say the User-Agent in a Grantlee template it won’t work as dashes will break the variable name, so now all keys are lower casa and words are separated by underscores. Allowing for {{ ctx.request.headers.user_agent }} in Grantlee templates.

Some changes were also made to make it behave more close to what Catalyst does, and fixed a bunch of bugs from last release.

On my TODO list still need to:
Write a chained dispatcher to allow a more flexible way of dispatching.
Write tutorials, yeah this is boring…
Write QML integration to allow for writing the application logic in QML too!

This last one would allow for something like this:

Application {
    Controller {
        Action {
            attributes: ":Path(hello)"
            onRequest: {
                ctx.response.body = "Hello World!"
            }
        }
    }
}

Download here

Have fun!

Cutelyst 0.6.0 is released

Cutelyst 0.5.0

A bit more than one year after the initial commit, Cutelyst makes it’s 5th release.

It’s now powering 3 commercial applications, the last one recently got into production and is the most complex of them, making heavy use of Grantlee and Cutelyst capabilities.

Speaking of Grantlee if you use it on Qt5 you will get hit by QTBUG-41469 which sadly doesn’t seems to get fixed in time for 5.4, but uWSGI can constrain your application resources so your server doesn’t go out of memory (worth the leak due to it’s usefulness).

Here is an overview since 0.4.0 release:

  • Remove hardcode build setting to “Debug”, so that one can build with “Release” increasing performance up to 20% – https://gitorious.org/cutelyst/pages/CutelystPerformance
  • Request::uploads() API was changed to be useful in real world, filling a QMap with the form field name as a key and in the proper order sent by the client
  • Introduced a new C_ATTR macro which allows to have the same Perl attributs syntax like C_ATTR(method_name, :Path(/foo/bar) :Args)
  • Added an Action class RoleACL which allows for doing authorization on control lists, making it easy to deny access to some resources if a user doesn’t match the needed role
  • Added a RenderView class to make it easier to delegate the rendering to a view such as Grantlee
  • Request class is now QObject class so that we can use it on Grantlee as ctx.request.something
  • Make use of uWSGI ini (–init) configuration file to also configure the Cutelyst application
  • Better docs
  • As always some bugs were fixed

I’m very happy with the results, all those site performance tools like webpagetest give great scores for the apps, and I have started to work on translating Catalyst tutorial to Cutelyst, but I realize that I need Chained dispatcher working before that…

If you want to try it, I’ve made a hello-world app available today at https://gitorious.org/cutelyst/hello-world

Download here!

Cutelyst 0.5.0

Cutelyst 0.4.0 is out!

This is yet another big step for Cutelyst, this release bring several important fixes to the last version, and stabilizes the API a bit more. So far I have successfully deployed 3 commercial applications build on top of Cutelyst + Grantlee5, and the result is great.

If you don’t know Cutelyst yet it’s a Web Framework allowing you to build web applications using Qt, for more info check (this blog and) our website/wiki which is still work in progress: http://cutelyst.org or join #cutelyst on freenode

This release brings the following improvements:

  • Further speed improvements by simplifying several code paths and improving the dispatcher logic was an overall of 15% speedup
  • Added an API to enable Grantlee template caching which greatly improve speed when using Grantlee templating
  • Improved Query and Body parameters to allow for properly dealing with posts that contains the same field id multiple times

New features:

  • REST API – Since 0.1.0 I was asked about supporting REST, and since I needed it for another project that I got involved the support landed early, the behavior is the same as Catalyst::Action::REST which allows you to easily add a foo_DELETE method which will get automatically called if the request method is DELETE for example.
  • Added a Credential HTTP plugin to handle Basic HTTP (and in future Digest) authentication
  • Added support for Authenticate and ProxyAuthenticate basic parsing on the Headers class
  • Finished Context::uriFor() methods that allows for easily building an URI.
  • Added a method to do a DNS PTR lookup to get the hostname of the client
  • Added a C_PATH to more easily set the matching part of the path (thanks to Dan Vrátil)

Fixes:

  • Fixed a few memory leaks
  • Fixed a crash if the body wasn’t set
  • Fixed uWSGI body buffered device
  • And a lot of other misbehaviors found on post release…

For the next release I hope to be able to port the Catalyst tutorial to the Cutelyst equivalent, and finish a few other API changes.

As before the API is unstable but don’t be afraid of playing with it, most changes will simply require a rebuild of your application.

Have fun! https://gitorious.org/cutelyst/cutelyst/archive/0f28d7da9b04061fe80f7e9cf24a120250a02e02.tar.gz

Cutelyst 0.4.0 is out!

Apper 0.9.1 released!

Another mostly bugfix release to make packagers and users happy :)

Sadly I needed to change the direction of where I put most of my efforts, which means that I’m focusing more on getting some commercial products done to get bills payed (as fundraising campaigns doesn’t work well all the time). For a long time I’ve been trying to polish everything I could to have the desktop I wanted, but recently I realized that the way I was doing it would never work, first because I’d need to convince people to think like I do, second because no one in free software writes stuff for free, and this took me a lot of time to realize.

Almost everyone writes stuffs for himself, otherwise there’s no pleasure, so unlike companies you can’t tell a free software developer to work on something he/she doesn’t like, which is one explanation for why most of the projects I started received very little help, an important help (don’t get offended) but still I don’t have active developers in Apper*, print-manager, libudisks-qt, colord-kde, aptcc* (* Matthias and some Fedora dudes have added some nice features) and a few others. The KDE community has always been kind to notice my code mistakes or even fix the code by themselves but featurea are a different matter.

Don’t worry I’m not moving to OSX :P

But for a long time I’ve been building in my mind the Workspace that I want, and with Wayland I realized It would be somehow easy to achieve what I want when speaking of a desktop shell, which would basically be a shell where all widgets are independent process, where a QML compositor just properly place it’s surfaces, Aaron already covered the pros/cons of such approach however I’m stubborn …, I know it’s a huge task to start a new workspace/DE whatever and I’m not going to do that right away (tho I have played with some Wayland code already), instead I’m trying to get my commercial software to pay for it, which might take quite some time :P

So I just would like to maybe catch someone that cares for some of these stuff I maintain and give a hand, specially on KF5. I don’t yet have KF5 packages ready in my distro and as I said I’m focusing on other stuff, I’ll still maintain them and eventually port them by myself but I’m mostly in bugfix mode :P except for Cutelyst which is a project I’m actively working on as I need it for the web stuff I’ve been doing :)

A good start is porting print-manager to KF5 which should be rather easy.

And here is hopefully the last Qt4/KDE4 based Apper :P

http://download.kde.org/stable/apper/0.9.1/src/apper-0.9.1.tar.xz.mirrorlist

Enjoy.

Apper 0.9.1 released!