discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] gnuradio block for boolean operations


From: Ed Criscuolo
Subject: Re: [Discuss-gnuradio] gnuradio block for boolean operations
Date: Mon, 18 Feb 2008 13:46:26 -0500
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

Tim Meehan wrote:
[tim] I think the auto code generators in gengen is a good compromise

Agreed.


[tim] One note on your nrzi_to_nrz code below.  I don't know much about
compiler optimization but I suspect
nrz_bit = ! nrzi_bit ^ d_prev_nrzi_bit

might give you better performance than the if else.

I long ago learned the mantra "Get it right first, then make
fast. Its always easier to make correct code perform faster than
it is to make fast code perform correctly."

The code was written for easy comprehension. You must admit
that the binary operators, while more elegant, are a bit more
cryptic to a reader.  Once the code was tested, it ran
fast enough for my needs, so I didn't pursue optimizing it.


...................................... Then again I have been wrong more than I have been right
on this sort of thing :-)

Me too. I find that FAR more often than not (70-80% of the time),
profiling shows that the bottleneck is NOT where you would have
first thought.  And today's optimizing compilers are very VERY
good.  That's why we can do so much of GnuRadio in C++ instead
of assembler.

As for this case, I just don't know.  An inequality comparison,
a jump, and an assignment vs a complement, an xor, and
an assignment.  My gut feel is that in either case, the total
time taken is probably insignificant compared to the
overhead/buffer processing done for any gr_sync_block.
But the only way to really know is to profile.

@(^.^)@  Ed




reply via email to

[Prev in Thread] Current Thread [Next in Thread]