I’ve gone through several iterations with my to-do list. I usually have a pretty large list of things that need to be done either as long term goals or short term by the hour or day tasks. I’ve found that a lot of people use plain text files to track their lists or notes, I did this for a while but found that I really wanted hierarchical formatting to better organize my thoughts and text files don’t necessarily offer the best feature set or visual display of this type of information. For a long time I was using OmniOutliner for this purprose but this was a bit heavy handed (feature and price wise) and not really it’s intended purpose. Edgies is another great application for this sort of thing, and my good friend uses these, but I didn’t find that they suited me for really long lists of tasks that I may not actually get to until a year from now.
I’ve finally landed on TaskPaper, it’s my ideal tool for tracking tasks, goals, notes, and most other things. It works like a plain text editor, but understands special formatting like a ‘-’ character to start a bullet point or a ‘:’ following a word to signify a project, as well as proper indenting to show a hierachy. It also supports marking tasks as done, arhiving, searching, and tagging. All very necessary features. I do have a few complaints such as the ability to drop photos or other files. I also find it’s not really feasible to paste a large block of code or text like an email. Despite this however, I’ve been very satisfied and definitely recommend it. Now I just need to actually complete some items…<sigh>
Recently I posted to the PHP Internals regarding lazy loading support for APC. I’ve been working on this for a while internally at Facebook, and we’ve actually become quite dependent on this feature. When you run an include in PHP with APC loaded, you incur a cost of copying opcode and associated data for the compiled files. APC files are stored in a shared memory segment, but sometimes this data needs to be copied into the local process space. Lazy loading is a feature that avoids this cost based upon the concept that large code frameworks are only likely to actually require a portion of their code.
While not entirely accurate or proven, a good way to describe this is with the 80-20 rule or Pareto principle which estimates that in many situations 80% of the effects (in this case processor time) are caused by 20% of the causes (code). With this in mind we can optimize for this situation by delaying copying of functions and classes from the APC cache until we actually need them, thus reducing our number of copies. Of course this depends entirely upon the structure of the code, for example using the autoloading feature can often significantly reduce these costs as well. If you’re running code that is very intelligent with it’s includes, you also probably won’t see a significant gain unless your you have a significant amount of code or are very performance oriented. It’s been my experience, however, that includes often get out of hand as demonstrated by the inclued graphs that people have generated. It’s also logical to assume that you won’t always be using every method in a class, or every function in an included file. As an example, a database include that has read, write, and search functions is likely to only use one call depending on the request. Sometimes good organization costs us in other un-obvious ways.
To get started with lazy loading you’ll need to get the latest version of APC from CVS, and apply some patches to PHP. I’ve posted the patch for php-5.3 here: http://tekrat.com/downloads/bits/apc_lazy_php53.patch
Two INI settings enable lazy loading for functions and classes respectively:
apc.lazy_functions=On|Off
apc.lazy_classes=On|Off
This is just a first run, and I will be making some more optimizations in the near future including looking at method level lazy loading and reducing the cost of tracking lazy loaded entries themselves. I would love to hear any feedback, results, problems you encounter with this feature!
It’s been a while since I’ve given my last talk, and my next one will be in May at PHP|Tek 2009 in Chicago. I need all the time I can get to prepare too as I intend to completely re-factor my previous talk with updated benchmarks, information, and overall format. My goal is to make my next session as up to date as possible, which means I’ll be tinkering with it until May comes around. I also want to challenge myself to make this talk more engaging visually as well as useful for attendees (I’m talking to you conference nappers!). I’ll be cutting out most things you can find in a manual, and instead focus on giving attendees a better understanding of APC and creating a truly high performance web site.
If you’ve attended any of my past talks, or you have any suggestions on what you think would be useful regarding content or anything else, please send me suggestions via comments or email and I’ll do my best!
I’m very excited to be contributing a case study for a book on “Quality Assurance in PHP Projects” by Sebastian and Stefan. My particular section will focus on performance testing, something that I feel engineers often don’t think about from a quality assurance perspective or often measure incorrectly, leading to poor results and wasted time and effort. My hope is to share some of the techniques I have used when testing scalability and performance, what has been useful, and what has not:
Incorrect application functionality is a detriment to any project, but poor performance and scalability can often lead to end-user dissatisfaction and exorbitant hardware expenses.
In the case of modern web application, expectations have made it necessary to provide responses within as little as 100 to 500 milliseconds. This puts a tremendous burden on not only achieving excellent performance, but maintaining consistent performance as code changes and …. (read more at the Quality Assurance in PHP Projects site)
We’ll be posting more case studies and news as time progresses, feel free to subscribe to our RSS feeds to learn more. Now, if you’ll excuse me I have some more writing to do…