man,,, the answer is that you're basically testing PHP and not a database.
don't bother iterating the results, whether commenting out the print or not. there's a chunk of time.
foreach ($cursor as $obj)
{
//echo $obj["thread_title"] . "<br><Br>";
}
while the other chunk is spend yacking up a bunch of rand numbers.
function get_15_random_numbers()
{
$numbers = array();
for($i=1;$i<=15;$i++)
{
$numbers[] = mt_rand(1, 20000000) ;
}
return $numbers;
}
then theres a major difference b/w implode and in.
and finally what is going on here. looks like creating a connection each time, thus its testing the connection time plus the query time.
$m = new Mongo();
vs
$db = new AQLDatabase();
so your 101% faster might turn out to be 1000% faster for the underlying query stripped of jazz.
urghhh.