Zephir vs raw PHP - performence

Hi,

Thx all society for Zephir. It's great.

I'm developing web game and I rewrite some modules to Zephir. In most cases my performece is much better (20-30%). Unfortunatenlly I have one module where raw php is quicker two times that Zephir extension. How is it possible? The code is real the same:

$data is a array with 100000 data:

array(
    array(
        'x' => 20,
        'y' => 123,
        'val' => 1,
    ),
    ...
)
namespace Game;

class Map {

    public data = [];

    public map ;

    public mask = [];

    public min = 0;

    public max = 0;

    public width = 0;

    public height = 0;

    public scale = 2;

    public brush = 5;



    public function __construct(int width, int height, int brush = null, int scale = null) {        
        if(!is_null(brush)){
            let this->brush = (int)brush;    
        }

        if(!is_null(scale)){
            let this->scale = (int)scale;    
        }

        let this->width = (int)floor(width / this->scale);
        let this->height = (int)floor(height / this->scale);                        
    }   

    public function setData(array data){
        let this->data = data;

        return this;
    }

    public function generate(){    
        int x,y,center;
        var row;
        let center = (int)floor(this->width >> 1);    


        for row in this->data {

            let x = center + floor(row["x"] / this->scale);
            let y = (int)floor(row["y"] / this->scale);            


            if(!isset(this->map[x][y])){
                let this->map[x][y] = 0;
            }

            let this->map[x][y] += row["val"];  

        }     

        return this->map;   
    }


}

for the same data method 'generate' is generated:

for PHP: in 0.46284625384953sek for Zephir: in 0.94714307785034sek

edited Apr '15

Using the following data:

$f = array();
for ($i = 0; $i < 100000; $i++) {
    $f[] = ['x' => mt_rand(0, 100), 'y' => mt_rand(0, 100), 'val' => mt_rand(0, 1000)];
}

$t = microtime(true);
$a = new Map(0, 1, 0, 1.0);
$a->setData($f);
$a->generate();
echo microtime(true) - $t, PHP_EOL;

$t = microtime(true);
$e = new Zafiro\Map(0, 1, 0, 1.0);
$e->setData($f);
$e->generate();

I'm getting almost the same performance:

$ php test.php 
0.22315907478333
0.25990984916687

$ php test.php 
0.22962021827698
0.26558588981628