Thoughts On SOAP/PIPA And The Future Of The Net.

SOPA and PIPA are bills are designed to help guys like me (software company owners), and yet I find them pretty distasteful in many ways.

As other have pointed out, a rather large burden is placed on site owners, especially those who run aggregate sites like Reddit and YouTube. My understanding is content/copyright owners can request that sites be removed from the US Internet if they’re found to harbor, support, or link to unlicensed content.

Read More

Where Bing Has To Improve

I appreciate competition in the search engine space but Bing simply doesn’t compete at this point. I would like to it, but it simply doesn’t.

Read More

jQuery vs. Prototype – Part 2

In the first post of this series we looked at the common misconception of jQuery being the “lightweight” JavaScript library. In this post we’ll leave the sidelines and jump right into some real-world scenarios. I want to see what makes jQuery tick by comparing it to my beloved Prototype.

Read More

jQuery vs. Prototype – Part 1

One of the hottest JavaScript libraries on the planet is jQuery. It’s opened up a world of web developers to functionality and ease they would not otherwise know, and has done so without stepping on anyone toes. Their are hundreds of great extensions for it made by a first-rate community that’s almost always helpful and supportive. When it comes to getting a job I’d say jQuery knowledge is almost becoming requirement, if not right away then as part of your integration into that job.

Prototype JS is…well…it’s another JavaScript library. But it’s the library I know and love. It’s what drives FormBoss and while not as exciting or popular as jQuery, I swear its day will come (again). Their are many reasons for this belief, but the first is due to what I believe is a fundamental misconception about jQuery vs. other libraries — its payload size.

In this first of a multi-part series we’ll take a look at the physical delivery size of each library. In the next post well dive into practical programming. First though, a bit of background.

Read More

MySQL INSERT SELECT Statements

INSERT INTO tbl_temp2 (fld_id)
SELECT tbl_temp1.fld_order_id
FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;

That’s not a typo, it’s a real feature of MySQL, and one I just learned about. The basic idea is to SELECT rows from one or more tables to populate another. It does this with a temp table, and for the most part respects things like auto-increment fields and foreign key restraints.

It’s a neat little trick that should help with those times where we’ve been populating temp tables with incremental updates, and now need to create one final INSERT into a master table.

GCC Vs. LLVM – Simple Test Code Optimizations

As a companion piece to this test suite on Phoronix I took the following *very simple* code and ran it though GCC 4.6 (Fedora 15) and the Clang/LLVM 2.8 Suite to check performance and various optimizations being performed:

#include <stdio.h>
#include <stdlib.h>

int test_noRef(int value)
{
	return value + 1;
}

int test_ref(int &value){
	return value += 1;
}

int main(int argc, char *argv[]){

	int t = 1;

	for(int i = 0; i < 100000000; i++){
		//t = test_noRef(t);
		test_ref(t);
	}

	// final result = n loops + 1
	printf("%d\n", t);

}

Read More

PHP 5.4 Brings Performance Improvements

A line in the current release notes for the PHP 5.4 beta states:

Improved: Improved Zend Engine memory usage and performance

Sounds good to me, and after my previous post on references I thought I’d run the same test with this new build (all times are in seconds):

I’d say that’s a decent improvement, though one that follows the same trend from the first post of using references with objects is slower than not using them.

As one final test, here’s the result of loading the FormBoss.net homepage several times in succession:

So about the same when performing standard page interpreting, if not a touch slower.

Links

http://qa.php.net/

Understanding and Using References In PHP

References are a feature of the C family of languages, and while not all that common in PHP, can be used and are quite handy in some situations. In this post I want to cover what references are and how we can (and may not want to) use them in our PHP code.

Read More

Creating A PHP Extension

“Stock” PHP has a large number of extensions that cover just about every web-development task you can imagine. From file and FTP operations to database communication, chances are PHP already has you covered.

Their is one area where PHP falls flat however, and that’s intensive data processing. As PHP internally stores all user-space variables in a hash-table, algorithms that require heavy manipulation and lookups of these items will always be slow.

Of course PHP will also fall flat for us if we need some capabilities that no extension provides.

In this post we’ll learn about the solution to both of these issues: building custom PHP extensions. The reason why this post even exists is because of an excellent PHP tool called: ext_skel, as with it we can quickly create our own PHP extensions that would otherwise take many laborious hours of trial and error.

Read More

Benchmarks: JavaScript vs. PHP vs. HPHP vs C++

Just a quick spattering of some benchmarks I ran while testing a program I’m developing internally.

The first three are of the fannkuch benchmark found on the sunspider test site, only ported over to C++ and PHP in addition to the JS version. The browser used for all tests was Firefox 5.

The HPHP listing is a compiled Hip Hop PHP version, which is interesting as it shows the relative difference between it and vanilla PHP.

The last item, Benchmark.php, is the same benchmark file you’ll find in a PHP source download.

See the full benchmarks after the jump!

Read More