Hmm, I can't argue with you on this one. Numerous fActiveRecord extension classes here and I get about 9.63 MB memory usage from (memory_get_usage() / 1024 / 1024) after generation of my relatively simple homepage. I'm not complaining (yet) since the server I'm on has 1048864k memory and generally speaking, I'm the only user on besides a few testers.
Mem: 1048864k total, 616544k used, 432320k free, 3696k buffers
Swap: 530140k total, 297752k used, 232388k free, 33240k cached
Have a copy of JIRA running too, and a PHP-written daemon doing Twitter requests (takes up about 5 MB, and yes it uses fRecordSet therefore fActiveRecord).
This server I'm using is for development only. The server we will end up on for production will probably be far better.
The documentation has some really good information about caching and performance in general. Wikipedia and Twitter both use memcache, I'd suggest looking into it. Servers I've used in the past have used APC or Memcache (they were all running Drupal installs). http://flourishlib.com/docs/PerformanceTips I pretty much can't argue against any of these things mentioned here.
Another neat trick which I've looked into implementing in my own new Flourish-based site. The Drupal module named Boost (which I use on anfplaylists.com) does the following:
Page requested: Does the already-generated HTML exist in /caches?
YES - Can the user accept gzip/DEFLATE? Serve the gzip'd version
NO - The user cannot accept gzip, serve the non-gzip'd version
NO - Run the PHP code to generate the HTML, serve it to the user, save the HTML version and the gzip'd HTML version
Cron job: Flush all HTML caches if their expiration time is up
This would be relatively easy to implement especially with the help of the Flourish library.
Finally, if you REALLY want to reduce memory usage, start writing PHP extensions. Just note that call_user_func_array() I don't think works well from a PHP extension standpoint. And just look at how foreach works in C:
for (
zend_hash_internal_pointer_reset_ex(arr_hash, &pointer);
zend_hash_get_current_data_ex(arr_hash, (void**) &data, &pointer) == SUCCESS;
zend_hash_move_forward_ex(arr_hash, &pointer)
) { }
GAH! But hey, more speed! Extension Writing: http://devzone.zend.com/article/1022 I am actually looking into this to convert my translation class to C for more speed since string manipulation is often one of the largest bottlenecks in PHP applications.