for example an easy arithmetic in PHP easy.php
Code: Select all
<?php
for($i=1;$i<=10;$i++)
{
echo $i."<br />";
}
Code: Select all
#include <iostream>
int main()
{
int i = 0;
for(i=1;i<=10;i++)
{
std::cout << i << std::endl;
}
return 0;
}
if we compile the "easy.cpp" to "easy.dll"(windows) or "easy.so"(linux) ,and than let php invoke the "dll" or "so" cover for "easy.php".
which code is faster ? invoke the "dll,so" or only use php ?