As recently some effort has been involved in improving the performances of TurboGears2, I was curious to see how much things improved. As usually, the test isn’t really reliable in any way and was just for fun.
All the graphs report the request/sec the application has been able to perform on my computer with only 1 concurrent client. So higher is better.
Here is the comparison between TG2.0 and TG2dev (will be 2.1.4)
I also compared various setups with different template engines on TG2dev
The comparison happened on an application similar to the quickstarted one.
Actually as there is no database involved in this application the template engine impacts a lot and so was a good benchmark for the template engines themselves.
New features introduced are:
- Assets manager, Upload your videos and images using the Asset manager instead of the RDisk if you want to create slices from them. Assets manager will also create thumbnails for everything and will convert the videos to support HTML5
- BlogPost view (an HTML view with a title)
- Attributes for Pages and Slices
- Hide Pages from menu with hidden=1 attribute
- Reorder Pages in menu menu-weight attribute
- Add metatag description to pages with description attribute
- Automatic Database migrations, never care about changes to the schema when you upgrade acr again, it will be automatically upgraded by acr itself on first visit
- Hide edit bars in edit mode to view the slice as a standard visitor
- Abstraction layer for encoding data, now each view encodes using EncodedView, so that it will be possible to switch to any key/value encoding or store in the future
After a reflection moment caused by the need to think what will follow after the pylons and repoze.bfg merge in pyramid the TurboGears2 team has decide to gather up all its forces and give to TurboGears2 its own independent life.
The first steps have been oriented to improve the framework reliability and brought to life the TurboGears continuous integrations system and a standard project release process.
After a few months of work 2.1.1 has been released and it brings many fixes and improvements, 2.1.2 is under its way and a 2.2 release with major improvements is already planned!
* Fixed dependencies for Python 2.4. Now any packages that are
needed are automatically installed.
* Updated package requirements as high as possible.
* Verified nested RestControllers work as expected
* Added/fixed Kajiki support
* Ignore repoze.who_testutil when running nosetests
* Fixed import order for pylons.middleware
* Fixed crash when PYTHONOPTIMIZE is enabled
* Report a warning about ErrorMiddleware is disabled
* Fixed concurrency issues with use_custom_format
* Fixed 404 errors if a controller uses only custom formats
* Verified that user object is available inside of the error controller/template
* Fixed expansion of arguments on before/after calls
* Fixed wrong header response for 405 error
* Fixed WebOb version requirment. Newer version required
* Added test case to check for replace_header when called from WSGIApp
* Fixed issues with Content-Type header appearing multiples times on 204/205 responses
* Removed redundant hasattr checks on override_template
* Improved support for pylons 1.0 strict_c
* Fixed post traceback, now reports to Pylons correctly
* Added test case to check for spurious content type removal on empty content
* Fixed crash when content type header is missing
* Fixed crash when response Content-Type is set to None
* Fixed support for etags. Pylons 1.0 changes slightly, we support the correct version now
* Added dependency_links and setup.cfg allow_hosts: easy_install TurboGears2 now works
* Fixed DecoratedController. should not call super(), 2.6 revealed a problem
* Fixed Genshi output method. Use XHTML if none specified, instead of XML
* Fixed Python 2.4 compatibility issues. Dependencies are now automatically specified
* Updated package version requirements as high as possible
* Fixed about.html instructions about where the logo is found
* Set “zip_safe=False” by default in the templates now
* Tests fixed, now pass
* Added support for sqlalchemy-migrate
* Added option to choose config file
* Added archive_tw_resources command for projects
* Fixed deprecated redirect calls
* Set Genshi templating method by default to XHTML
* Adding dependency_links: easy_install tg.devtools now works
Want to handle long operations in your web application without having your users wait for minutes?
If you are using turbogears2 you might find tgext.asyncjob useful. Asyncjob extension provides background method calls and helpers to manage your database queries in the asynchronous functions. Makes also easy to implement an AJAX progress bar for your long running operations.
We just released tgext.mobilemiddleware for turbogears2 to make easier to handle templates for mobile devices and detect mobile devices requests.
Indeed it is quite simple to use as it makes possible just to register a different template by using @expoe_mobile decorator which will be used for mobile devices, making possible to create mobile version of web page by using for example jquery mobile
Spent some time renewing the ACRCms web page, I was a bit tired of the old style and wanted something more structured, so here is the new look and feel. Hope everyone enjoys it 😀
While I’m not sure if it is a good or really stupid idea I decided to start trying to implement a RPC library on the redis database.
In theory it should be a good idea as you can have a very fast and persistent multi-consumer queue of tasks (like rabbit-mq or other AMQP) which can be worked out to also give answers back. Also using redis permits to quickly distribute work over multiple servers by simply running another server without any change to the code itself.
If you want to check REPC (yes, this is the only name I have been able to think of…), you can take a look at https://github.com/amol-/repc
Serialization format for data is JSON just because it was something quick to have. Currently my main target is trying to have something with a very small code footprint and reliable enough to be used.
Recently while coding a game/scene library for Canvas I had the idea of implementing pixel perfect collision by using an offscreen canvas where to draw the two objects alone and check if they collide.
This can be easilly done with the source-in/destination-in composite operation. If any pixel of the offscreen canvas if not white then the two objects collide. It seems a great idea, but I had a bad surprise when testing it on Chrome and Safari.
Indeed it seems that source-in and destination-in have been differently intended on webkit. I find the Mozilla implementation more useful, but as the Canvas 2D specifications are written it is difficult to understand what they mean by Display the source image wherever both the source image and destination image are opaque. Display transparency elsewhere
Here you can find a screenshot of the two different behaviours
It seems that one of the main problems with websites on iPad when handling with a lot of images is the limited memory reserved for images. If you have a lot of big images you will start seeing white boxes instead of your pictures when viewing the site on the iPad.
It seems somehow that Safari for iOS ignores the memory limit for background images, so you can consider substituting your img with divs with background-image to avoid hitting against the limit.
This is also valid for iOS Applications that use UIWebView.