speed test for C implementation