|Dec7-09, 01:43 PM||#1|
Any good short reads on optimisation of code? (math-specific)
I am trying to speed up a code which performs a number of tasks on a set of data. I am wondering if there are any resources on general rules and principles that can be used to speed up calculation times?
I am having a real problem when there appear to be more than one way to code something, I cannot prove to myself why one is faster than the other. I realise this is very non-specific, but I do remember a couple of computer science majors emphasising to me that there are certainly very 'good' and 'bad' ways of coding. If anyone knows any resources applied to maths coding, I would be INCREDIBLY grateful.
|Dec8-09, 12:09 AM||#2|
The best source I've found (and this is not a quick read) for software construction is Steve McConnell's "Code Complete," published by Microsoft Press. The first edition was published in 1993, but there is a newer edition.
The best book on optimization, IMO, is The Zen of Code Optimization, by Michael Abrash, published by Coriolis Group Books in 1994. This book is all x86 assembly, so if you don't know assembly it won't be much use to you. Inasmuch as this book is 15 years old, much of the optimization that it covers is probably done by compilers. Unless your CS friends are very sharp, it's probable that the tricks they know for optimizing code don't really result in faster-executing code. The compilers that are out there these days are pretty good at optimizing throughput for the multiple pipelines in the Intel architecture chips.
|Dec8-09, 12:14 AM||#3|
Blog Entries: 14
Making less calls to hard-drive and utilizing the memory can also speed up the things. I am also facing similar problem now where I need to get (historical and real time) data from four sources and perform analysis at every few intervals. I can get historical data during midnight and keep real time data in memory.. but that just one of the ways I have come up with to speed up the things. In my case, analysis is quick but making calls to other programs/data is very expensive.
|Similar Threads for: Any good short reads on optimisation of code? (math-specific)|
|How could I script A code to synchronise A Specific File On My Pen Drive?||Programming & Comp Sci||1|
|Good Short Story Books||General Discussion||0|
|C++ Code: Searching for a specific string||Engineering, Comp Sci, & Technology Homework||8|
|A good short intro to Perturbative QFT||Quantum Physics||2|
|neutron stars: good short article||General Astronomy||4|