Yey! Yet another stable release of FUDforum is out.
A bit more of e-mail fine tuning, this time aimed at making sure all mail clients can properly parsed encoded e-mails. Updated Chinese & French translations and the English translation undergone major grammatical revisions. The poll can now be position anywhere inside the message via the use of the {POLL} tag. Stricter URL session checks etc... All users are encourages to upgrade.
A friend of mine gave me a good idea of making a wrapper around the sendfile() syscall that can be used for very quick data transfers between socket and file descriptors. This syscall in some instances can replace 3 other syscalls (seek, read, write) when you need to write a portion of 1 file into another file. Another words a very neat functionality that I could see myself using in my own applications, such as the message file compactor for FUDforum who's entire job is to seek and write data from one file to another. Further tests have shown that this syscall can also be used to create a much faster copy() that compared to PHP's current copy mechanism is about 2x faster, not a bad improvement if I do say so myself.
However, when it came to testing the code in my primary development box it just would not work, neither would any sendfile example I could find on the net that dealt with transferring data across two files. After much searching on Google, IRC and reviewing the relevant kernel sources I've discover...
There are a number of tricks that you can use to squeeze the last bit of performance from your scripts. These tricks won't make your applications much faster, but can give you that little edge in performance you may be looking for. More importantly it may give you insight into how PHP internals works allowing you to write code that can be executed in more optimal fashion by the Zend Engine. Please keep in mind that these are not the 1st optimization you should perform. There are some far easier and more performance advantageous tricks, however once those are exhausted and you don't feel like turning to C, these maybe tricks you would want to consider. So, without further ado...
1) When working with strings and you need to check that the string is either of a certain length you'd understandably would want to use the strlen() function. This function is pretty quick since it's operation does not perform any calculation but merely return the already known length of a string available in the zval structure (in...
Sitting at the airport enjoying the "cheap" Dutchie wifi at a mere $10 per day waiting for my flight that is about 3 hours off. The conference was quite a bit of fun. I got to meet a number of PHP guys who I have not seen before as well as meet old friends and acquaintances. The city itself is quite interesting ;-) and nearly everyone speaks English so communication with the locals is quite simple. One surprise was the fact that Dutchies don't seem to wear the traditional wooden shoes (perhaps it makes riding bicycles too hard?), the only time I've seen them was in the various tourist shops. The other was the fact that I have only seen about a dozen tulips in the country, which supposedly world renowned for this particular flower, oh well.
P.S. The two talks I gave will be put online as soon as I return to Toronto.
I am an avid user of Joe, a console text based editor whose roots can be traced to WordStar. It was the editor I've started my *NIX experience with and it never gave me a reason to consider more popular alternatives such as VI or Emacs. One of the things Joe lacked was syntax highlighting that the developer had been promising to add for what seems like years. Well, the wait is over! This morning while doing a the morning news crawl I've discovered that Joe 3.0 has been released with UTF8 support and the long awaited syntax highlighting support.
While the syntax highlight support is at very early stages and is nowhere near the capabilities offered by VI, it's is certainly a move in the right direction and it does not look like it would be terribly difficult to make it do a better job at highlighting C and PHP.
One nice thing about it, is that the colors are much less 'bright' then the ones used in VI that does confuse you with the rainbow of colors.