 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Symfony Blog: How to create an optimized version of your website for the iPhone in symfony 1.1
by Chris Cornutt June 12, 2008 @ 14:24:10
With the recent stir caused by the new iPhone, it's only natural that developers are looking for easy ways to make their sites as compatible as possible with the mobile platform. The Symfony project has posted a guide to helping you make your apps optimized for mobile use.
symfony 1.1 introduces native support for different formats and mime-types. This means that the same model and controller can have different templates based on the requested format. The default format is still HTML but symfony supports several other formats out of the box as defined in the factories.yml file.
Using this system, it's easy to add new output formats by adding to the default layouts the framework comes equipped with. The Content-Type can be changed and layouts can be disabled as needed. This lets you make a custom definition just for use with the iPhone without a lot of hassle.
They also include an example of how to make one of these optimized layouts, including some iPhone "screenshots" of the resulting pages.
voice your opinion now!
optimize iphone website version symfony layout contenttype
C7Y: Optimizing with APC
by Chris Cornutt May 28, 2008 @ 12:58:07
Brian Shire has posted a new tutorial talking about some of the benefits of caching the functionality of your website (with things like APC, not file or database caching):
Opcode caches save energy, expenses, improve overall user experience on web sites, and it's often one of the simplest optimizations to implement. This article will explain the basics of installing, configuring, and tuning an opcode cache for PHP, the Alternative PHP Cache (APC).
The article focuses on how the APC works and how to get it up and working on your installation (as pulled from the pecl repositories). They look at some of the functions the extension's API includes (like ap_cache_info or ap_store for manual caching) as well as some more advanced topics like locking performance, working with TTL, cache priming and filtering.
voice your opinion now!
tutorial optimize apc alternative cache pecl extension
Reinhold Weber's Blog: 40 signs you really are a lousy PHP programmer
by Chris Cornutt February 08, 2008 @ 15:23:00
Reinhold Weber has put together a list of signs (40 in all on his "programming list of shame") that you're a lousy PHP programmer. Here's a sampling:
- don't see the need and/or benefits of a good programming IDE like Zend Studio or Eclipse PDT
- have never used some form of version control like Subclipse
- don't use a consistent methodology
- don't use test-driven development
- don't return content but echo or print it from your functions or classes
- return HTML, not data, strings, or objects.
- don't allow intelligent error handling
- you think reusable software equals/requires your code to be OOP
Now granted, some of them are a bit more high level than others, but if you're not headed towards a lot of these, you might change paths, hop out of that comfort zone and branch out into the community and the language a little bit more.
voice your opinion now!
lousy programmer test optimize list oop intelligent regularexpression
Stuart Herbert's Blog: More about Performance Tuning
by Chris Cornutt February 05, 2008 @ 07:57:00
Based off of a previous article from Mike Willbanks, Stuart Herbert has posted some of his own thoughts on tuning and tweaking your applications for the best performance you can get out of them.
There's some good advice in there, and I thought it'd be a good idea to quickly add a bit more detail about the separate approaches that Mike raises.
He goes over the APC caching, memcache, the "gzip trick", the "Not Modified" header and optimized SQL statements.
He also mentions one thing that Mike didn't mention - a split between static files (no PHP needed) and their dynamic cousins. Having a more pure Apache (no PHP installed) can help give a minute jump in speed that, depending on the size of the site, could really add up from a user's perspective.
voice your opinion now!
performance tune memcache apc sql optimize gzip notmodified
Symfony Blog: Is symfony too slow for real-world usage?
by Chris Cornutt June 12, 2007 @ 12:05:00
On the symfony blog today, there's a new article looking to dispel some misunderstanding that's come up surrounding the speed of symfony applications and what effect it can have in a real-world situation.
We regularly see framework benchmarks pop up somewhere on the net, comparing symfony to other frameworks, either in PHP or in other languages. The conclusion of some of them is "symfony takes more time than other frameworks to display a 'hello, world', which makes it unsuitable for real-world web applications".
If some benchmarks show that symfony is slower, jumping to the conclusion that symfony is not optimized is a big mistake. [...] If symfony is well implemented (or so we think), then its speed is just the sum of the individual speeds of all the features it includes. Or, to put it differently, Symfony's speed is the consequence of a series of choices that we made to decide whether a feature should or should not make it to the core.
They suggest that the speed of symfony applications does not come as a result of the main portion of the framework, but rather as a choice of the development team as to what parts they wanted to include in the core and what not to. They also point out that, while speed does matter somewhat, especially in larger applications, it shouldn't be highest on the list.
voice your opinion now!
symfony framework speed benchmark helloworld optimize symfony framework speed benchmark helloworld optimize
Joakim Nygard's Blog: Optimizing PHP Through Habits
by Chris Cornutt April 25, 2007 @ 10:39:00
Spurred on by some previous benchmarks [pdf] from Ilia Alshanetsky, Joakim Nygard decided to run some his own benchmarks on the same sort of functionality.
There are numerous discussions in the blogosphere about whether to use echo versus print, if for() is faster than while(), etc. and though the gains are usually very small, I decided to add my thoughts to the debate. I found an article on optimization through coding habits in Ilia Alshanetsky's zend performance slides.
According to his results:
- Calling require_once() 10000 times in a for() loop with an empty file is 4x faster.
- With a simply autoload requiring a class and 10000 loops of new Foo() versus require_once('foo.php'); new Foo() shows that __autoload() is ~3.7 times faster.
- If a class method can be static, declare it static. Speed improvement is by a factor of 4.
- Avoid function calls within for() loop control blocks
- Always, always quote array keys.
- Get rid of 'harmless' error messages - they take time to generate and output.
I am not out to prove Ilia wrong - he knows PHP better than most - and for all I know, they could have optimized those very functions in PHP 5.2. [...] It would appear that there are improvements, albeit small, to achieve from minimal effort. Plus I was surprised by the discrepancies I found compared to Ilia's recommendations.
voice your opinion now!
optimize coding habit benchmark requireonce autoload loop optimize coding habit benchmark requireonce autoload loop
|
Community Events
Don't see your event here? Let us know!
|