My blog
My LinkedIn Profile

BOOKS i'm reading

Napoleon Hill Keys to Success: The 17 Principles of Personal Achievement, Napoleon Hill, ISBN: 978-0452272811
The 4-Hour Workweek: Escape 9-5, Live Anywhere, and Join the New Rich (Expanded and Updated), Timothy Ferriss, ISBN: 978-0307465351
The Fountainhead, Ayn Rand, ISBN: 0452273331
Web Hosting Canada


Category: Code Optimization


Permalink 10:25:39 pm, by lano1106, 296 words, 2080 views   English (CA)
Categories: Code Optimization, Code Optimization, C++, C++

Efficient C++: Performance Programming Techniques

Efficient C++: Performance Programming Techniques, Dov Bulka, David Mayhew, ISBN: 0201379503

The book title suggested to me that the book would follow the Effective C++ series format where advices are given in small items. This is not the case. This book has a more conservative format where topics are presented in chapters. This is not a problem per se but I just wanted to say it to potential readers that could have the same impression that I had by seeing the title. That being said, the topics covered are the usual areas where you can usually gain some performance such as temporaries, memory allocation and inlines. I cannot say that I have learned a lot of things because writing performant C++ code has been a topic of interest to me for a very long time.

The chapter about inlines is mixed bag of very good information and useless information. What I did appreciate less is that several pages are dedicated for describing what could be possible to do with inlines if very smart compilers were available. It was interesting to read but nothing applicable immediatly. Maybe this section is a wish list intended to be read by compiler implementers. However at the same time, it is the chapter that gave me the most new tricks that I did not already knew. This is the book that presents how to efficiently use inlines in the best way that I have seen in books.

Finally, if I abstract the fact that I did not learn a lot of new things, I must say that it is very well written. It is interesting to read. The authors give reference to actual cases from their work experience and this book would probably be very beneficial to read for someone that has never yet spent a lot of time doing code optimization.


Permalink 11:51:07 am, by lano1106, 226 words, 3365 views   English (CA)
Categories: Code Optimization

Michael Abrash's Graphics programming Black book

Michael Abrash's Graphics Programming Black Book (Special Edition), Michael Abrash, ISBN: 1576101746

This book is a monster brick of over 1300 pages with 70 chapters! Do not be misled by the book title because the 22 first chapters, which represents about the third of the 1300 pages, discuss assembly optimization. This book is getting a little bit old and a little bit outdated. For instance, this author covers optimization techniques for processors ranging from the 8088 to the Pentium and the Inner loops book covers the 486 to the Pentium Pro.

The second part covers low level graphics programming in assembly. The type of graphics programming that people were doing before Windows and DirectX.

Because assembly programming is not very popular anymore, for most people, it is not a good book to get but if assembly optimization is your thing, then you should consider this one as even if there are more recent books on x86 assembly programming, this one is the best that I have seen to lay out the basic concepts such as branch prediction, register contention, how to shuffle assembly instructions to optimize the processor pipelines usage and how to optimize the flag register usage. Armed with this knowledge in the back of your head, even when you write C or C++, you will be able to subtly change the way you formulate if/else blocks and for/while loops that will enhance your program performance without affecting the code readability.


Permalink 09:24:47 pm, by lano1106, 415 words, 2507 views   English (CA)
Categories: Code Optimization

Inner Loops: A sourcebook for fast 32-bit software development

Inner Loops: A Sourcebook for Fast 32-bit Software Development, Rick Booth, ISBN: 0201479605

It has historical value more than anything else...

This book is divided in 2. The first part describes the theory of assembler optimization for processors from the 486 to the Pentium Pro. 10 years ago, this information was useful but now it is pretty much deprecated as I highly doubt that Pentium optimization techniques do anything good on Athlons or Pentium IV processors. The only chapter that still contains applicable information today is the one providing general advices on optimization such as loop unrolling.

Then the second part named 'Practice' provides concrete examples of assembly optimizations for various problems such as sorting, list and tree traversals. I do not like this section neither because I feel that the presented assembly procedures are thrown at you in the face without showing you the process that the author used to derive them from the original C code. Michael Abrash's Graphics Programming Black Book does a much better job in that area by presenting you 5 versions or more of the same procedure starting from the C version that gets optimized further at each iteration. Also, someone might expect to be able to get the source from the CD-ROM coming with the book and start directly using it. Alas, it is not possible because what the presented code is sorting or searching in binary trees are integers that are directly manipulated in the registers (that is part of the presented optimizations) which has not much reuse value in a world of STL containers holding usually much more complex objects or structures than plain integers. The only value that these examples might have is that they might give you some ideas on where assembly optimization might be applied.

A much better book to learn the process of optimizing in assembly is Michael Abrash's Graphics Programming Black Book because it walks you through the optimization process step by step with more than 5 versions of the same procedure that is getting more optimized at each iteration. You will learn how to do it yourself with this book even if it suffers of the same weakness than this book. That is: it presents optimization techniques from the 8088 (that is very very old up!!!) to the Pentium Pro. Another benefit from Abrash book is that, in my opinion, there is a greater chance that you might find its code reusable.

Finally, a very good optimization book that covers optimization techniques for recent processors such as the Athlon and the Pentium IV is: Code Optimization: Effective Memory Usage.


Permalink 08:00:39 pm, by lano1106, 127 words, 3078 views   English (CA)
Categories: Code Optimization, Code Optimization

Code Optimization: Effective Memory Usage

Code Optimization: Effective Memory Usage, Kris Kaspersky, ISBN: 1931769249

This book has been a revelation to me. Prior to read this book, all I knew was that memory access was expensive. This book will teach you how to organize your data in memory and how to access it to improve your program performance and most of the time without having to use assembly programming. It covers x86 memory organization and the interface between the processor and the memory and there is a whole chapter covering x86 processor cache memory. To me, the most shocking information contained in this book is a C implementation of memcpy() that outbeats VC++ implementation by 25%-30%!!!

This book is not for novices but if you are ready to change your perception forever of the x86 programming, this book is highly recommended!

Olivier Langlois's blog

I want you to find in this blog informations about C++ programming that I had a hard time to find in the first place on the web.

June 2024
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29


Custom Search


XML Feeds

What is RSS?

Who's Online?

  • Guest Users: 4

powered by