Skip to content

Instantly share code, notes, and snippets.

@x7c1
Created July 17, 2012 16:56
Show Gist options
  • Select an option

  • Save x7c1/3130580 to your computer and use it in GitHub Desktop.

Select an option

Save x7c1/3130580 to your computer and use it in GitHub Desktop.
Memory use of a Range class in Plater Library
<?
use x7c1\plater\collection\immutable\Range;
class SampleRangeTest extends \PHPUnit_Framework_TestCase{
public function test_memory(){
foreach(new range(1, 700000) as $i){
//Memory: 2.50Mb
}
}
}
// see also
// https://github.com/x7c1/Plater/blob/master/src/main/collection/immutable/Range.php
<?
class SampleRangeTest extends \PHPUnit_Framework_TestCase{
public function test_memory(){
foreach(range(1, 700000) as $i){
//Memory: 101.50Mb
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment