Do you know if that's mainly due to the inefficient malloc, or if there are other important performance bottlenecks?