speed test refactored & mem_streams optimized