[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CPU usage by call of C++ code through system() on Linux
From: |
N |
Subject: |
Re: CPU usage by call of C++ code through system() on Linux |
Date: |
Thu, 25 Jun 2020 19:39:05 +0200 |
> Dear Octave Users
>
> Maybe one of you can give me a hint on how to make my Octave code run faster.
> Within a good size program (run time 40 sec) the command system() is used to
> call a C++ code.
> The C++ code uses pthreads.
Operations on vectors may be much faster than loops. I have function reading a
file, it executed slowly in Octave but as functions to read file are very
similar to C I reimplemented and then it became much faster.
> When running the same code in Matlab only the "normal"load shows and very
> little kernel load on the CPUs.
> The computation time by Matlab is also only 60% of the time consumed by
> Octave (5.2.0)
> The system is an Ubuntu 20.04 on a AMD Ryzen 3950X.
Matlab is more expensive so I guess you get something for the money but it does
not need to stay like this forever, you could figure out where the difference
is?
Nicklas Karlsson