Kelp version 2 released!


I'm proud to announce the versions 2.00 and 2.10 release of Kelp, a nutritious Perl web framework.

Version 2.00 contains a bunch of new features, bug fixes, refactors and performance improvements. Version 2.10 is a result of a very wild bug-hunting spree and contains a bewildering number of improvements. In addition to code changes, Kelp now has a unique look with its own logo, new github page devoted to promoting Kelp, friendlier GitHub readme and extended documentation pages. Most impactful changes are listed below:

  • Router has been overhauled. Route destinations are now resolved eagerly, right after the route is registered. Previously, most of the procedure was done on request, which was both slower and allowed incorrect configurations to go unnoticed as long as they weren't tested by somebody. Moreover, the internal structure is now more friendly to extensions and the path matching algorithm has been optimized to be about 50% faster.
  • The request and response encoding of the framework has been solved. Previously, request data would not get decoded (other than JSON if so configured), yet response data would get encoded to application's charset. Kelp now has a second configurable charset, request_charset. As usual, it's best to keep it UTF-8.
  • Fixed a bunch of bugs in patterns and added a new placeholder >slurpy which is helpful for registering an entire path for a sub-application. Patterns are now safer by disallowing all regex components.
  • Kelp can now natively mount a PSGI-compilant application with psgi routing flag. Extra plack apps can be mounted right in Kelp, without the need for Plack::Builder.
  • Method param has been made safe by default, no longer suffering from a possible security hole of using it in a list context (like in CGI). A bunch of new related methods have been added: query_param, body_param, json_param.
  • A new before_dispatch hook has been added, which by default generates an access log. This means that Kelp access logs can now be disabled or changed by overriding this hook, in addition to already existing method of disabling info level logs. Disabling them this way can also improve performance.
  • Response context is properly cleared when an error occurs. Any response code, body or headers set up to this point will be cleared. Previously, headers would not be cleared, which resulted in weird behavior for rendering error pages when Content-Type was set.
  • Controller support is now much more robust. A new manual page has been added, explaining all the details: Kelp::Manual::Controllers.

Full changelog can be found here.

In addition to changing the framework itself, a new major version of Kelp::Module::Symbiosis has been released and an effort has been made to fix and update the Kelp benchmarks on TechEmpower framework benchmarks site. When the pull request is accepted by the maintainers, Kelp will be benchmarked on two database types (MySQL, MongoDB) and four different Plack webservers (Starman, Starlet, Gazelle, Twiggy::Prefork), for a total of 8 configurations.

I also intend to modify the code of all other Perl framework benchmarks to bring them to the same value of maximum requests handled by a process before it exits and a new one is spawned. It now varies greatly, with Dancer having the Starman's default 1,000, Mojolicious using infinity, and Plack having an astounding 10,000,000 which is a funny way to write infinity. Without this value unified, there is no point in comparing the results between the frameworks. On the other hand, infinity is not a viable production value. My plan is to bring them all to 100,000, which is neither too high nor too low and should not hinder them too much so that they can't compete with other languages. If you think I'm wrong, please tell me before I start coding that up!


Comments? Suggestions? Send to bbrtj.pro@gmail.com
Published on 2024-06-24