Friday Aug 29 2008 3:32 pm by Smokinn

PHP arrays have pretty huge size overhead so I ported this ruby class to PHP and use it as my vector of bits.

I threw up all the code on google code so you can check it out if you're interested.

http://code.google.com/p/phpbloom/

Comments
Saturday 30 2008 9:57 am by Rob

How difficult is it to make a PHP class that is coded in C/C++? That would reduce the overhead bigtime.

Saturday 30 2008 10:05 am by Smokinn

I don't think it can be done... As far as I know, if you want to write something in C and access it in PHP you have to write a PECL extension and recompile PHP to include it.

Maybe I should try writing a PECL extension.

Saturday 30 2008 10:41 am by Rob

It tells you how to install them here:

http://ca3.php.net/manual/en/install.pecl.php

You don't need to recompile PHP to do it, that's just one of the options.

I could whip up a pretty good C bitfield system for you if you want ;) You can make them pretty fast with pointer magic and bit operations.

Saturday 30 2008 10:51 am by Smokinn

Thanks for the offer.

I should probably do it myself since I haven't written any C in years but if yours turns out to be faster I'll put it up on google code.

Post a comment
Name:
Email (optional):
URL (optional):
(Allowed tags: <a> <p> <strong> <em>)

Sorry, but due to spambots, to post I'll need you to prove you're human.

Of the six following animals, just select the two that are not fluffy

About the Site:

I might update. Don't hold your breath though.

About Me:

Name: Guillaume Theoret

Age: 804670233 seconds

Job: Mostly web dev

Some Friends:
Search:

RSS Feeds:

RSS