Terminally Incoherent

Utterly random, incoherent and disjointed rants and ramblings...

Sunday, April 02, 2006

Matlab vs Java

This SUCKS balls! I was at school today, trying to run my NMF algorithm on a 4MB image file. I started running the test around 12pm - it was chugging along happily as I was working on my Programming Languages homework (which is crazy btw).

I left at 6, and my program was still running. That's 6 hours and counting. What's funny is that Dr. Robila implemented the same algo in Matlab and it processed the very same image in under 5 minutes. Aaaagh!

Of course you need to take into consideration that in Matlab matrix multiplication, or a transpose is accomplished with a single operator. This means that there are years of tweaking, and anal optimization behind each of these. I'm doing all of this using loops, and my data is stored in Java's DataBuffers. This means that every access is a function call.

I'm thinking about optimizing this using arrays. I will have to look into how much faster is it to access an element of a multidimensional array, as opposed to accessing an element of a DataBuffer. Perhaps it is not even worth bothering, as Java arrays are sort-of-objects anyway.

If that damn JDS machine freezes before finishing this 6+ hour run, I will take a fucking baseball bat to it or something :P I better see some results tomorrow!

0 Comments:

Post a Comment

<< Home