Meet our team in San Diego, United States, from Tuesday 23 until Thursday 25 of April at XPONENTIAL, booth 4700

Update (20/04/2024): We have plenty of stock of all our products, find us also in and    Shop now

Meet our team in San Diego, United States, from Tuesday 23 until Thursday 25 of April at XPONENTIAL, booth 4700

Measuring SBC application performance

SBC performance

During application design, you need to know what to expect from the SBC in terms of computation speed to design an application that can process all coming data.

In this tutorial we present a method to measure SBC performance in different tasks and how to extrapolate it to size your application.

Measuring the code

To measure the code we use simple functions that compute the required time to send or receive a bunch of bytes. With that info we have enough to compute CPU usage and size an application.

Below we give you an example to benchmark GPS write operations. It simply sends dummy data to the GPS and measures its time. The return value has units of [bytes/second]

def benchmark_gps_write( chunk=64, N=128, baudrate=921600 ):
    gps = sbc.Gps( 1, baudrate )
    buf = bytearray( chunk )

    t0 = time.ticks_us()
    for i in range( N ): # send len(buf) bytes N times
        gps.write( buf )
    t1 = time.ticks_us()
    
    dt_s = time.ticks_diff( t1, t0 )*1e-6 # Compute time
    size_bytes = chunk*N
    
    return size_bytes/dt_s

Results

TaskResultUnits
ubx_parser3.25e+04[B/s]
ubx_builder1.09e+05[B/s]
nmea_parser1.47e+04[B/s]
flash_write1.82e+04[B/s]
flash_read4.93e+05[B/s]
sd_write4.46e+04[B/s]
sd_read4.26e+05[B/s]
gps_write8.85e+04[B/s]
imu_read4.68e+02[Samples/s]
ahrs_update1.01e+05[Calls/s]
gc_collect4.89e+02[Calls/s]
printf7.67e+05[B/s]

CPU usage computation

As shown in the table the SBC can send 88[KB/s] to the GPS, using the 100% of CPU. It also means that if your application sends 8.8[KB/s] to the GPS, it uses the 10% of CPU.

The same idea can be applied to any application to get an approximation of the CPU usage and size your application correctly.

If you liked this content, you can follow us on Twitter, YouTube, Facebook or LinkedIn to stay updated of content like this.

Got any questions or requests?
Contact us! We'll answer <24 hours!

Icon
Contact ArduSimple
Close

Want to learn more about GPS/RTK?

1. Our engineering team will contact you to solve any questions
2. We will keep you updated about promotions and new product releases
3.You will only hear from us when we have important news, we won’t spam your email