Would it be possible to use the NAG toolbox for MATLAB (which hooks into NAG’s superfast Fortran library) to get her results faster she wondered? Between the two of us and the NAG technical support team we eventually discovered that the answer was a very definite yes. Recently I had an email from someone who had profiled her MATLAB code and had found that it was spending a lot of time in the interp1function. Often you can get very big speedups in return for only a modest amount of work and as a bonus you get to keep the use of both of your eyes. I have found that a MUCH better course of action is to profile the code, find out where the slow bit is and then do what you can with that. Telling such a person that they should throw their painstakingly put-together piece of code away and learn a considerably more difficult language in order to rewrite the whole thing is unhelpful at best and likely to result in the loss of an eye at worst. I have no doubt that some of you are thinking that the correct answer is something like ‘ completely rewrite it in Fortran or C‘ and if you are then I can only assume that you have never been face to face with a harassed, sleep-deprived researcher who has been sleeping in the lab for 7 days straight in order to get some results prepared for an upcoming conference. I often get sent a piece of code written in something like MATLAB or Mathematica and get asked ‘ how can I make this faster?‘.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |