discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Performance diff between Null Sink & Copy Block


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Performance diff between Null Sink & Copy Block
Date: Mon, 16 Feb 2015 21:43:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/16/2015 09:17 PM, Luke Berndt wrote:
> Hi - I am trying to create optional paths in my Gnuradio Flowgraph. I
> have found 2 ways of doing this in C++: - Doing a lock() / unlock()
> inside my heir_block2 and either connecting the items inside the
> block to the source of the block or connecting the source of the
> block to a null_sink. - Putting a gr::blocks::copy inside my
> heir_block2 and either enabling or disabling when I want samples to
> go through the block.
> 
> With the null_sink I get almost no CPU load when the source is
> connect to the Null Sink. However with the Copy block I get a decent
> amount of CPU load when the block is set to disable.
> 
> I looked at the code and looks like a Copy Block set to disable is
> about the same as a Null Sink. they both just do nothing with the
> incoming samples.
> 
> Why is the Copy Block using so much more CPU? Is it possible for it
> to have the same CPU load as a null sink?

In the case of the copy block, the scheduler has no way of knowing that
you're treating it like a sink. That might explain the difference.

> Is there are better way of doing this? Should I write a custom
> block?

Are you using GRC? If so, there's the 'Selector', but I'm not sure if
that does a better job than what you have. Depending on your signal
setup, you might be able to use a matrix_multiply, but that might make
things worse CPU-wise.

M



reply via email to

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