I was reading through the Zephir docs and it doesn't look like it has any support for typed arrays. This was a bit of a let-down for me because I feel like typed arrays provide an opportunity for MASSIVE performance gains in certain use cases. There are many times that I find myself dealing with an array of 300,000 integers and I want to average them all. With a hashmap or a linked list this means following 300,000 pointers and performing 300,000 lookups in memory. However with a typed array you can store all of these values consecutively in memory and rely on L1 cache to provide a performance boost of 100x

Although the documentation doesn't mention it, I realize it's possible Zephir detects such arrays and performs the optimization automatically. For example:

var myArray = [1, 2, 3, 4, 5];

May be compiled to:

int myArray[5] = {1, 2, 3, 4, 5};

This would be orders of magnitude faster to access (and instantiate) than:

ArrayClass myArray = new ArrayClass();

Or similar. The cost would be the loss of certain array metadata (the ArrayClass in my example may track its length independently and increment or decrement as .push() and .pop() are called) - but if you are willing to track this metadata yourself or don't need it then you can enjoy the benefit of consecutive memory access.