Any good short reads on optimisation of code? (math-specific)

Click For Summary
SUMMARY

This discussion centers on optimizing code performance, particularly in mathematical computations. Key resources mentioned include "Code Complete" by Steve McConnell and "The Zen of Code Optimization" by Michael Abrash, both of which provide foundational principles for software construction and optimization techniques. The conversation highlights the importance of understanding compiler optimizations and memory management to enhance execution speed. Practical strategies include minimizing hard-drive calls and efficiently managing data retrieval for analysis.

PREREQUISITES
  • Understanding of software construction principles
  • Familiarity with optimization techniques in programming
  • Basic knowledge of x86 assembly language
  • Experience with data retrieval and memory management
NEXT STEPS
  • Read "Code Complete" by Steve McConnell for software construction insights
  • Study "The Zen of Code Optimization" by Michael Abrash for advanced optimization techniques
  • Learn about compiler optimizations specific to Intel architecture
  • Research effective memory management strategies for data-intensive applications
USEFUL FOR

Software developers, particularly those working with mathematical computations, performance engineers, and anyone interested in optimizing code execution speed.

mikeph
Messages
1,229
Reaction score
18
Hello

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 realize 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.

Regards,
Mike
 
Physics news on Phys.org
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.
 
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

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
15
Views
11K
  • · Replies 10 ·
Replies
10
Views
1K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K