Paloş::Code.Blog()

Thoughts about high architecture and sheer speed.

Rest in peace “psstream”

Alright folks, I have been missing for a while but here I am again!

I have to say I’m impressed by the feedback I got from you on the psstream PHP extension. However, it has been a while now since I reached the conclusion that the whole idea of psstream is essentially flawed. Don’t get me wrong, the software does its job but it leaves a lot to be desired from it once you want high-volume streaming on your website (maybe on a youtube clone or something). Here are the big issues:

1. Basically, the PHP virtual machine eats a lot of memory, it starts quite slow and has a relatively low limit on how many PHP processes can run in parallel. Streaming from PHP engages all that machinery without justice and consumes a ridiculous amount of resources for something that shouldn’t!

2. Usually we run PHP on a web-server (Apache, Nginx, Lighttpd etc.). This means that all the data that PHP delivers to the clients actually goes through the web-server, therefore increasing to the problem.

3. Psstream uses a moov-seek code that was taken from the great guys at code-shop.com and it did the job. However, (without disrespect) that code has grossly fallen behind (even the guys at code-shop have re-written it from scratch in newer versions of their modules). It is not optimized, uses quite a bit of memory (to load the atoms) and is simply not optimized at all.

These would be just a few (but the implications are much deeper). As a consequence I have written a brand new streamer called Loomiere/Streamer that yields far higher performance than psstream. Therefore I regret to announce that as of today, the psstream PHP extension is officially discontinued.

On the bright side, you can now use (and contribute to) the new streamer that promises a lot. I have written a more detailed article about Loomiere/Stream on my new blog valeriu.palos.ro.

So you’re invited to check it out.

“psstream” is dead, long live “Loomiere/Stream”!

Enjoy!

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

New releases and repository for D packages

Hello people. I know some of you waited quite a bit for this (Intrepid) release but honestly, I HAD NO TIME!!!

Edit: These packages should be considered obsolete for Intrepid and future Ubuntu releases, since the repo at the tango website is now hosting (hopefully soon-to-be-)official packages.

First off, I have created a new repository since I had trouble maintaining the one at the tango website (dsource) and also it seemd that people in the community have started experimenting with it in the attempt to create some official debian packages. This new repo is hosted on my own company’s webservers so everything should be much easier. I will continue upgrading these packages for as long as it will be neccessary (basically until the official Ubuntu/Debian repos will have their own official packages).

Read the rest of this entry »

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Pseudo-streaming MP4/H264 video from PHP

After struggling for a while I managed to put together a PHP extension for (pseudo-)streaming video files encoded with the all-new H264 codec, based on the wonderful work of these guys , thus giving people the ability to seek into MP4 files by using PHP and any webserver they like (like Apache, NGINX etc.). Anyone who knows anything about this will know what a pain it can be. [Sorry, the demo server is no longer available since I’m currently using it in a separate context to develop an improved version of this package]. Read the rest of this entry »

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Google TH 2008 Reloaded

Following my first attempt, I optimized the scripts and improved on my times considerably. I’m really happy with the outcome considering it was all done with PHP. My faith in this platform is increasing :). Note that I also used a slower computer (a laptop) this timeand I decided to to my own time measuring to exclude the loading of the prime numbers (if you think this is cheating then you can simply run the scripts using the time command).

Results:

php -f google_th_4b.php 

Loading primes... done.
Solving for inputs 25, 129, 139, 1087, 1199…
Found prime number 9256873 in 0.32996106147766 seconds.
php -f google_th_4b.php 

Loading primes... done.
Solving for inputs 7, 17, 41, 541…
Found prime number 7830239 in 0.75763010978699 seconds.

Sources:

google_th_4b_prepare.phps

google_th_4b.phps

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Google Treasure Hunt 2008 (#4)

Hey there people! After viewing (and being enticed by) Leonardo’s post (and also Peteris’) I decided to take a shot at this problem… using PHP. That’s right, I wanted to see how fast I can make a PHP script solve this darn thing. Because I (also) wanted to make use of the pregenerated list of primes, I made a preparation script first that downloads a specified amount of 1 million prime numbers chunks and inserts them into an SQLite database for easier (and faster) access from PHP (this script is called google_th_4_prepare.php). I only called this script for just 1 million primes since all numbers I tried fit within that, but you can do more if you want (see the defined constants)! Read the rest of this entry »

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Ubuntu Tangobos-GDC package for x86_64

Big news here ladies and gentlemen, Tangobos now compiles successfully (with minor patch) on 64bit architectures. As a result you will find the tangobos-gdc SVN Release 58 for x86_64 in the repo as well as at http://download.palos.ro/Debian D Packages/.

So now, we have a complete set of packages (the GDC set) for x86_64. How awesome is that?!

ATTENTION: I am *not* saying this is stable. In fact it is very possible that this will generate quite a lot of segfaults but it is a good start. I am *very* curious to see how well it works (if at all) !?…

Enjoy!

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Ubuntu packages for DMD 1.028 and Tango 0.99.6 Jeff

Ok so here’s a short update: We now have a new set of packages issued for DMD 1.028, Tango 0.99.6 (Jeff) as well as Tangobos SVN release 58.

A major change is that DMD no longer comes bundled with Phobos; if you want Phobos functionality then install Tangobos (or use the GDC+Phobos packages in the Ubuntu repos - but I don’t recommend that).

Just for convenience here is the article with information about our repository at the Tango website.

Enjoy (and tell me is something is wrong please)!

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Ubuntu packages for latest PHP snapshots

It was my great pleasure to find (some time ago) that, starting with version 5.3.0, PHP supports namespaces (among many other things). Even more exciting is that starting with version 6 it also supports Unicode natively. How awesome is that!!!

However there is a slight problem: these versions are only snapshots at the present time so there are no binary packages provided for them by our beloved Linux distributions and since I really don’t like messing up my beautiful Ubuntu Hardy installation with (uninstallable) source compilations I couldn’t make use of PHP’s new features. This is where CheckInstall comes in to the rescue…

Edit: There now exists a set of pre-built .deb packages for Debian and Ubuntu here, thanks to Void. Read the rest of this entry »

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

FINALLY! Ubuntu Repository for D Packages

ATTENTION!!!
This article is obsolete. New repo is available at repository.palos.ro.
More info in the new article.

And here I am, finally triumphant in my quest to implement a package repository in the Tango sub-section at DSource.org (with the help of Lars Ivar Igesund).

[Edited] The previous link I used to archive the packages is, however, not obsolete and I will update it further with both source scripts and binary packages (this is because some of you might still want to use “dpkg -i …” to install and not the repo - such as Debian users). Here’s the address: http://download.palos.ro/Debian D Packages/

The repository is at the following address (though you should follow the instructions below to add it to your apt configuration):
http://downloads.dsource.org/projects/tango/ubuntu/

Read the rest of this entry »

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Ubuntu/Debian D Packages

This article is now obsolete! A repository is now available! See here for instructions.

I decided to make a browsable directory at my website to put all new releases of the D packages for Ubuntu/Debian. You just have to download the newest versions and install them over the old ones (upgrade).

Here’s the address: http://download.palos.ro/Debian D Packages/

I really hope I will be able to set up a repo soon (I don’t have SSH access yet on the webserver that hosts my website). Until then, the http://download.palos.ro address will have to do. See the notes in this post for a description of how to use the DSSS wrapper scripts provided in the DSSS package.

Cheers!…

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!