speed test for pure python implementation