l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2006 Jun 22 23:18

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Reference books (Was: Re: a comment on Pete'sfast-loop question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Reference books (Was: Re: a comment on Pete'sfast-loop question



On Mon, 19 Jun 2006 02:55:37 -0700
"Mark K. Kim" <lugod2@cbreak.org> wrote:

> On Sun, Jun 18, 2006 at 08:13:30PM -0700, Micah J. Cowan wrote:
> [snip]
> > Given your explanation above, you might also find Hacker's Delight
> > to be enjoyable reading (if you haven't read it already).
> 
> Oh I love that book.  I ran into it browsing through the school
> bookstore and *had* to buy it.  I think of the book more of a bag of
> tricks for embedded systems programmers but I have yet to go through
> much of the book yet.  The first trick operation in chapter 2
> (figuring out the rightmost set bit, I think) was one of the IBM
> pre-interview questions a semester or two ago, I heard.
> 
> Another book I refer to for embedded systems programming tricks is
> "Math Toolkit for Real Time Programming" by Jack W. Crenshaw.  Covers
> things like integer square roots and integer logorithms.  It's more
> of an integer operations book for systems with no floating point
> math.  Not really related to what Peter's doing but still cool
> nonetheless.

I'm definitely going to have to look these two books up, especially now
that I have an income. (Part of the reason I haven't been keeping up
with this list, among other things. Not much free time. :)

I'm an embedded systems software developer (once again gainfully
employed as such) and will be interested in some of this stuff, I'm
sure.

As for the trick that started this discussion, I have two things to say.

1) As a number of people pointed out, get it working first, then
optimize. I'll throw another book title at you, "Code Complete 2" by
Steve McConnell. Fascinating book. Making the code work and making it
maintainable is far more important virtually all the time than making
it faster. He's big on maintainability.

2) Since I'm writing assembly on 8-bit machines that need to do a lot
with few resources, I'm afraid that a lot of optimization is done right
along with the development. On the other hand, some tricks are obvious
-- such as, for example, counting backwards from n-1 and checking for
zero, which does actually save doing a separate comparison. On the other
hand, doing it the other way 'round will NOT make assembly language
code a lot more readable. :)

But even there I've done a lot of "make it work first, then optimize
it." There are a lot of little tricks you learn to optimize as you go,
but those become automatic. Such as the reverse counter trick.

But you guys living in the world of desktop computing won't find them
very useful. Better to do a good overall design, get it to work, then
profile, like the man said.

Have fun!

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.