0

I am working on a block with gnuradio. I have come across a strange performance improvement when i was printing out some huge data on to terminal and the performance degrades without giving a print statement on to terminal.

I infer that while printing out to terminal i am giving gnuradio block an extra processing time for the block to process. This is just my hunch and might not be the exact reason. Kindly correct if this is not correct.

So, is there a way to add a specific amount of processing delay within a block(as what i got during printing out data to terminal) in gnuradio.

Thanks in advance

1 Answers1

0

First of all, the obvious: don't print large amounts of data to a terminal. Terminals aren't meant for that, and your CPU will pretty quickly be the limiting factor, as it tries to render all the text.

I infer that while printing out to terminal i am giving gnuradio block an extra processing time for the block to process. This is just my hunch and might not be the exact reason. Kindly correct if this is not correct.

Printing to terminal is an IO thing to do. That means that the program handling the data (typically, the linux kernel might be handling the PTY data, or it might be directly handed off to the process of your terminal emulator) will set a limit on how it accepts data from the program printing.

Your GNU Radio block's work function is simply blocked, because the resources you're trying to use are limited.

So, can i add a specific amount of processing delay within a block(as what i got during printing out data to terminal) in gnuradio.

Yes, but it doesn't help in any way here.

You're IO bound. Do something that is not printing to terminal – makes a lot of sense, because you can't read that fast, anyway.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Thanks for the suggestion. I need to spent more time in the work function so the scheduling of the blocks changes. The block might, for example, be called with more samples in the input queue as more samples pile up between calls. Can you please guide how this can be done? I have tried increasing buffer sizes but did not find use. Kindly suggest any work around – user11557452 Jun 03 '19 at 04:38
  • It's perfectly normal for your block's input buffer to run full. That's the only thing stopping flow graphs from running infinitely fast, unless there's a rate-limiting input! – Marcus Müller Jun 04 '19 at 18:46