Line Profiling in Python

For ages I tried to get Robert Kern’s line_profiler to install on my Windows 8.1, WinPython 3.3 system.

And I’ve had no luck at all.  All the instructions etc. are for ‘nix systems and so don’t make a lot of sense for Windows users.

So I downloaded and installed this profiler: https://pypi.python.org/pypi/pprofile  and I had it downloaded, installed and running inside of like 5 mins.

The only thing I’d like from now is to be able to run it from an IPython console, instead of a command window, which I’m sure you can do.  Still, I can get a command window inside Spyder2, the IDE I use, so I’m 99% happy.

So now I can see where time is spent on each line of any python program! Awesome.

I Love Julia

Nope, she’s not a woman, she’s a programming language!

I’ve been learning this language for a few weeks now and I’m quite enjoying it.  I’m using Windows 8.1.  Here is what I like and don’t like:

Likes:

  • It runs really fast.  Julia is an interpreted language, but it runs nearly as fast as C and Fortran for most things.
  • The syntax is pretty nice.  Much nicer than C/C++ and Java.  No curly braces, type casts everywhere etc.
  • It’s free.  Anyone can download it and play with it.
  • There are a huge amount of people/resources/packages etc. behind it.  Including optimisation packages, graphs, algorithms and so on which is what I’m really interested.
  • There is a free IDE for it called Julia Studio which is pretty good actually.  It has syntax highlighting, a packaging system (which I’m just learning about today) for adding in code, and many other features.  It’s still pretty new and pretty basic but hey for free, it’s pretty bloody good actually.
  • I feel I’m on the cusp of something, like getting in early, like part of a select few who are learning about this language, part of a club, do you know what I mean?  And that’s kinda cool.
  • It’s got a profiler, which is pretty easy to use.

Dislikes:

  • I’ve found the language quite tricky to learn.  Previous to this I’ve been programming in Python and previous to that things like C++, VB and so on.  Julia is quite different to all of these and I’ve needed a lot of help with syntax.  The online documentation is thorough except in one regard: examples – there aren’t many.
  • Julia is a new language, so the tools for it are pretty new too.  Julia Studio, by Forio is great for a free tool, but is nowhere near as flash as say Visual Studio – but then you pay thousands for that and it still has bugs.
  • Error descriptions.  Related to above, I’ll often get errors that are really cryptic, don’t give a valid line number (if using functions) and can take quite some time to work out what’s going wrong.  I often have to resort to println statements to work out where the program is going wrong.

Oh well, anyway, I’ll carry on with this and who knows where it will take me?