# Sheduler: do not consume all "input items" and return 0 "output items"

**URL:** <https://www.ruby-forum.com/t/sheduler-do-not-consume-all-input-items-and-return-0-output-items/240242>\
**Category:** GNU Radio\
**Created:** [April 3, 2014, 6:11pm UTC](https://www.ruby-forum.com/t/sheduler-do-not-consume-all-input-items-and-return-0-output-items/240242 "2014-04-03T18:11:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [April 3, 2014, 6:11pm UTC](https://www.ruby-forum.com/t/sheduler-do-not-consume-all-input-items-and-return-0-output-items/240242/1 "2014-04-03T18:11:40Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [April 4, 2014, 12:11am UTC](https://www.ruby-forum.com/t/sheduler-do-not-consume-all-input-items-and-return-0-output-items/240242/2 "2014-04-04T00:11:25Z")

</div>

On Thu, Apr 3, 2014 at 12:10 PM, Alex W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1. Does it deteroarate the performance of my flowgraph when I do not  
> consume and return as much items as possible? (The fixed numbers are 500 to  
> 1000). If yes, how much?

Hi Alex,

Yes, this will negatively affect the performance of your application.  
Every  
time you return from work, the scheduler has to set everything up again  
for  
the next entry to work, which means more overhead. How much this affects  
you is determined by a number of factors and we (right now) don’t have  
the  
ability to compute it. Instead, we have the Performance Counters and  
Performance Monitor system in place to allow you to see how your blocks  
are  
behaving. It might not be affecting you too badly in the end, depending  
on  
what you’re doing and what you need to be doing.

For something like this, you might have to think to yourself what’s the  
tradeoff in efficiency between the block and your time in writing the  
block  
to make the most use of the number of items you’ve received. If the  
block’s  
performance is a bottleneck for your system, this is definitely  
something  
to look in to.

> Alex

Again, yes, because you’re causing the scheduler to go through a lot of  
extra work. This might help you out:

> **[Explaining the GNU Radio Scheduler — Rondeau Research](http://www.trondeau.com/blog/2013/9/15/explaining-the-gnu-radio-scheduler.html)**
>
> The most important and distinguishing piece of GNU Radio is the underlying scheduler and framework for implementing and connecting the signal processing blocks. While there are many other libraries of DSP blocks available, it's GNU Radio's scheduler...

Also, for something like this, you can use forecast to tell the  
scheduler  
how many input items you require given a set of output items. Or, maybe  
more helpfully for something like this, you can receive a vector of  
items  
that’s the size of the correlation you are performing, so one item is  
actually N samples for the correlation. Your IO signature would be  
something like gr::io\_signature(1, 1, corr\_size\*sizeof(gr\_complex)).

Tom

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [April 4, 2014, 3:12am UTC](https://www.ruby-forum.com/t/sheduler-do-not-consume-all-input-items-and-return-0-output-items/240242/3 "2014-04-04T03:12:29Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [April 7, 2014, 8:39pm UTC](https://www.ruby-forum.com/t/sheduler-do-not-consume-all-input-items-and-return-0-output-items/240242/4 "2014-04-07T20:39:32Z")

</div>

On Thu, Apr 3, 2014 at 9:11 PM, Alex W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Why am I getting worse performance with those few passed elements?
> 
> Alex

Hard to say, but that’s one thing that our new Performance Monitor tool  
is  
supposed to help you find out.

The big thing in these cases is the scheduler. You might be calling into  
things far more often than you both want and expect, causing overhead in  
the scheduler to set up the blocks. If you’re looking at performance  
issues, looking into your interaction with the scheduler is key.

Tom
