stevengj/PyCall.jl — pull request #30 by simonster (2013-07-19 06:24:34+00:00)
Title: Alternative approach to improving pywrap performance

This is an alternative to #28 that also improves the performance of pywrap/pyimport, although it's not quite as fast. It still creates a type, but it avoids calling the type's constructor and leaves the fields untyped. Both of these changes seem to be necessary to achieve good performance. I'm not sure why this makes such a big difference, but profiling suggests that otherwise a lot of time is spent in type inference. For comparison with #28:

```
julia> @time for i = 1:10; pywrap(pyimport("numpy")); end
elapsed time: 1.22223664 seconds (20595984 bytes allocated)
```