Libevent is a library that provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached.
Recently, an extension emerged in PECL (link) that provides bindings between libevent and PHP, and this if you ask me, is a very good thing.
Today, the only way to multiplex socket operations in PHP is by using a variation of the select() method. If you use the sockets extension, there is socket_select() and for the rest, stream_select(). These are good enough event interfaces for many applications, but they are not optimal when you must manage a large number of sockets. One of the reasons for this being the system select() call semantics, forcing you to regenerate huge bitfields every time you want to call it. Unfortunately, the PHP *_select() functions only wrap the select() syscall.
When software evolves, it often gain features and flexibility, but these also mean bloat. And bloat leads to bad performance.
Sometimes apps get so much bloated and slow that they just become less and less attractive, until the point users can't stand it anymore. I remember using and enjoying the first versions of ACDsee and Azureus years ago, but after they kept adding useless features and bloat, I got rid of both. I'm now happily using Irfanview and uTorrent instead, both very lightweight and fast.
Feature bloat is a trap many coders fall into, and I've tried to avoid it as much as I could when designing nanoserv, keeping it simple and fast ... Then it evolved slowly and steadily during 5 years, gaining a lot of features, and here it is at version 2.0.3, but what about performance ?
Hi and welcome to my new homepage !
I will be using this space to post informations and updates about my personal projects, which mostly deal with computer programming, networking, open source software and psytrance music.
This blog is still in construction, so please notify me if you see anything that's not in the right place :)