Cython improved efficiency of spikegenerator template to O(1)