cartesian-product
cartesian-product copied to clipboard
performance test
round(memory_get_usage() / 1024 / 1024),
round(memory_get_peak_usage() / 1024 / 1024)
memory_get_usage() capture before the cartesian function is called should be subtracted from these results to not pollute it with autoloading and what not which is done before that.
Also these functions are the best for getting a memory profile. Use xdebug profiler for good memory usage information. But don't do benchmarking and profiling at the same time because profiling slows down code.
0 MB / 1 MB could be more accurate, maybe use bigger test input