Wednesday, February 25, 2009

3,500 collectors on Colnect

Yesterday Colnect has passed the mark of 3,500 registered collectors. This is an increase of over 17% during the last 2 months. Just before starting this year, Colnect had passed the 3,000 collectors mark. Considering the fact that ridiculously little marketing work has been done (~$50 spent on ads...), I see this as a very respectable achievement that continues the growth that started when Colnect V2 was released.

How do collectors learn about Colnect?

As Colnect allows collectors to manage their personal collection and semi-automatically manage swaps with other collectors from around the world, it's the collectors' own interest to have their collector friends join the site. Why would a collector go through the swap and wish lists of another collector manually when a match to his own lists can be done using a single click?

So what's next?

Colnect will expand to more collectible fields as requests come from existing members of the community. Some requested premium services are also planned.

Thursday, February 19, 2009

BE CAREFUL when using both AdSense + AdWords by Google

Do you have a website and using both AdSense and AdWords? If so, this post will interest you. You may start by looking at the attached picture.

AdWords and AdSense are the different sides of the same coin and Google is in the middle, biting on the metal. AdSense allows website owners to show different ads from different advertisers on their website and receive revenues for it. AdWords allow you to advertise your website on many other websites running AdSense. Google takes its commission for providing both these services. Though many other competing programs exist on the web, Google's generally have good reputation.

Advertising my site on my site?!?!?!

This morning, I was amazed to see an ad to my website for collectors on the same site! Had I clicked this ad, my AdWords account would have been billed for the click while my AdSense account would have received some revenue. Obviously the latter would be lesser since Google get their cut. This is, of course, ridiculous and should be automatically prevented by Google. Apparently, it isn't. Just to ensure you that I'm not an idiot, the ad is for and the website is on the same domain -

I usually view my own site with ads disabled so I don't accidentally click an ad and violate the terms of service. This time I was at a friend's house and am quite happy to have stumbled upon the aforementioned bug/feature.

Quick Remedy

Both accounts allow you to use filters and I've now added "competition filters" for my AdSense account that will prevent showing ads for any of my domain. It's also possible to filter out sites on AdWords but this can seemingly be done only on the campaign level so if you're running many different campaigns, it'll become tedious. See the attached pictures.

Saturday, February 14, 2009

Upto 80% Speed Increase on Colnect with Symfony

I have managed to cut up to 80% in loading times for Colnect's pages. This is going to be a technical post that would hopefully help others using Symfony framework on their websites. Please mind that for many sites, caching can and should be enabled. On Colnect, however, a lot of pages (especially the heavy ones) cannot be cached since they need be calculated on every request from the same user. If your site is not very dynamic, using APC (if you have a single server) or memcached (when you have many) is the best thing you can do for performance.

Partials are evil

Maybe not that evil but they take their toll on your loading time. The worst is when using them inside a loop as the price increases linearly. Use helpers whenever possible but make sure you load only the necessary helpers on each call and don't try to re-load helpers when inside a loop.

Re-use function results

Symfony encourages you to use methods and functions repeatedly, for example sfContext::getInstance()->getModuleName();. Obviously, the more calculations, the longer things take so whenever you need to re-use results, save the variable content.

A good PHP structure for re-using results is:

function foo_calculate() {
static $result = null;
if (is_null($result)) {
# perform calculations
$result = calculation results...
return $result;

Escaping PHP and going back to PHP takes its toll

is more costly than
echo 'xxx';
See code on the next paragraph.

Using many echo calls slows things down

It's better to accumulate output in a variable and call a single echo.
The following code performs simple tests so you can get a feeling of the differences in execution times. Run it a few times (when all other applications are closed) since results alter a bit every time.

public function executeCompareOutput(sfWebRequest $request) {
$times = 100000;
echo 'Looping for '.$times.' times - results in msec';
echo '<-div style="display:none">';
$start = microtime(true);
for ($x = 0; $x++ < $times;) {
echo ' '.$x;
echo '<-/div><-br/>'.round(1000 * (microtime(true) - $start));

$start = microtime(true);
echo '<-div style="display:none">';
for ($x = 0; $x++ < $times;) {
?> echo $x;
echo '<-br/>'.round(1000 * (microtime(true) - $start));

$start = microtime(true);
echo '<-div style="display:none">';
$sBuf = '';
for ($x = 0; $x++ < $times;) {
$sBuf .= ' '.$x;
echo $sBuf;
echo '<-br/>'.round(1000 * (microtime(true) - $start));

$start = microtime(true);
echo '<-div style="display:none">';
$sBuf = '';
for ($x = 0; $x++ < $times;) {
$sBuf .= ' ';
$sBuf .= $x;
echo $sBuf;
echo '<-br/>'.round(1000 * (microtime(true) - $start));

$start = microtime(true);
echo '<-div style="display:none">';
$GLOBALS['bufbuf'] = '';
for ($x = 0; $x++ < $times;) {
$GLOBALS['bufbuf'] .= ' '.$x;
echo $sBuf;
echo '<-br/>'.round(1000 * (microtime(true) - $start));


Here is a sample output:

Looping for 10000 times - results in msec

On this run using multiple echo calls + PHP escaping took 55 TIMES MORE than buffering the output in a variable. This clearly proves that the style suggested by Symfony templates, using many PHP echo blocks, is HIGHLY inefficient. If you have a few dozens of it in your templates and your content is cached, this is negligible. If your content is very dynamic, as is the case with Colnect, we're talking about something very worth noting.

Wednesday, February 11, 2009

Colnect's Alexa Ranking Keeps Going Up

Colnect's ranking on Alexa has risen again, now standing at 184,627 whereas ~3 months ago it was at ~360,000 and ~5 months ago ~500,000. I don't even know if it's linear or logarithmic although I guess the latter.

To those who may not know, Alexa ranks many (most?) websites out there of the big WWW. It does that by analyzing the traffic of (mostly unsuspecting?) users who install the Alexa toolbar on their browsers. This nice toolbar delivers the information back to their big servers, they crunch it whichever way they like and then rank the sites according to this information.

Why would anyone care about Alexa's ranking? Well, it has come to be relatively important in the WWW world. It allows you to have some (allegedly non-biased) objective information about how your website fairs on the Internet.

Are the results reliable? The short answer IMHO: no. The longer answer: perhaps, to some length. Since some website owners/operators/SEO personnel think of it as important, they are making an effort to get their ranking up. This isn't that hard, considering the fact the grand majority of users don't have the Alexa toolbar. There are many methods but they're basically about making people who use your site have the Alexa toolbar thus your site will have an improved ranking.

Another important disadvantage of Alexa is that ranking is on a per-domain basis. As such, this blog (which a few read) ranks the same as Colnect (which many frequently use). Personal websites on some free hosting all rank the same so you cannot tell them apart and so on.

Does Colnect try to improve its ranking? No. I did think about it for some time, since after all it may look better to some people, but have decided not to. The main two reasons would be not to spend my time on metrics that don't really matter and the second that since I wouldn't install it on my machine, I wouldn't ask others to do so.

Okay, let's hope this post won't cause Colnect's Alexa ranking to crash :)

Sunday, February 8, 2009

Numbers, Numbers, Numbers...

Many collectors (and non-collectors) really enjoy statistics and so finally the long awaited counters have now been added to Colnect. So when a collectors sees all coins in Colnect by country, there's now a small number indicating how many coins of that country are available on the database. The same goes for stamps and phonecards.

The big benefit becomes clearer when looking at a collector's collection, swap list or wish list. It's then very easy to know how many items the collector has of each country, company or even series.

Here's for example the information for an expert collector on Colnect, Czech RepublicDravec


Collection: 7,546 Phonecards
Swap list: 1,290 Phonecards (Match with my wish list)
Wish list: 6,199 Phonecards (Match with my swap list)


Collection: 1,137 Stamps
Swap list: 3 Stamps (Match with my wish list)
Wish list: 5,678 Stamps (Match with my swap list)


Collection: 2,155 Coins
Swap list: 301 Coins (Match with my wish list)
Wish list: 10,938 Coins (Match with my swap list)

On the back end side of Colnect, the system is very flexible in supplying the given information so the real challenge was to try and create an as-intuitive-as-possible user interface. I've recently made a post about usability and the addition of counters and simplification of the user interface that followed is a big step forward.

Link and Search

Did you like reading it? Stay in the loop via RSS. Thanks :)

There was an error in this gadget