discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed


From: al davis
Subject: Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed
Date: Fri, 12 May 2006 18:34:48 -0400
User-agent: KMail/1.9.1

On Friday 12 May 2006 17:56, Achilleas Anastasopoulos wrote:
> you can find the relevant code here:
>
> http://www.eecs.umich.edu/~anastas/gnuradio/
>
> looking forward to your comments.

You are returning a vector by value:
from fsm.h:
//========
  std::vector<int> NS () const { return d_NS; }
  std::vector<int> OS () const { return d_OS; }
  std::vector<int> PS () const { return d_PS; }
  std::vector<int> PI () const { return d_PI; }
//========

inside a loop, double nested:
from: howto_trellis_encoder_si.cc
===============
for (int m=0;m<nstreams;m++) {
  // stuff deleted
  for (int i = 0; i < noutput_items; i++){
    out[i] = (int) d_FSM.OS()[d_ST_tmp*d_FSM.I()+in[i]]; 
    d_ST_tmp = (int) d_FSM.NS()[d_ST_tmp*d_FSM.I()+in[i]];
  }
===============

I am amazed that you are only getting a 5-fold reduction!



A few years ago, I made some tests, in gnucap.  I found that in 
all tests there was no run time speed penalty for using STL, 
even in speed critical tight loops.  By using it, I was able to 
do things that would have been impractical without it, 
resulting in a net speed improvement.  Compiling is slower, but 
I can live with that.




reply via email to

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