robotology / robometry

Telemetry suite for logging data from your robot 🤖
https://robotology.github.io/robometry
Other
14 stars 9 forks source link

Try to enable compression in .mat file save #115

Closed traversaro closed 3 years ago

traversaro commented 3 years ago

As suggested by @S-Dafarra .

Nicogene commented 3 years ago

Today I tried on my laptop the telemetryDeviceDumper after #118 then without the compression, attaching to the gazebo icub simulator running demoYoga.

Here is the data:

test_telemetry_preV0.1.0pt1.zip

test_telemetry_preV0.1.0pt2.zip

test_telemetry_preV0.1.0pt3.zip

It is divided for the limitations in the file size of GH.

This will be our term of comparison when we will enable the compression

Nicogene commented 3 years ago

Here https://github.com/robotology/yarp-telemetry/issues/116#issuecomment-822292398 and here https://github.com/robotology/yarp-telemetry/issues/116#issuecomment-822295725 we have the performances of saving buffers of integers without compression

Nicogene commented 3 years ago

This is the impact of the compression in the benchmarking (always in Release)

see #123

COMPRESSED

-------------------------------------------------------------------------------
Buffer Manager Test
  Benchmarching section scalar int
-------------------------------------------------------------------------------
/home/ngenesio/robotology/yarp-telemetry/test/BufferManagerTest.cpp:261
...............................................................................

benchmark name                       samples       iterations    estimated
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
BufferOfInt-1000Samples-
oneVariable-1x1                                100            24      2.196 ms
                                         23.289 us    22.0523 us    29.0057 us
                                        11.5012 us    1.30895 us    27.2576 us

BufferOfInt-10000Samples-
oneVariable-1x1                                100            25      2.205 ms
                                        189.423 us    188.531 us     190.38 us
                                        4.71909 us    4.00428 us    5.67096 us

BufferOfInt-100000Samples-
oneVariable-1x1                                100            14     2.2904 ms
                                        3.84534 ms    3.82939 ms    3.88533 ms
                                        121.131 us    59.8298 us    254.113 us

-------------------------------------------------------------------------------
Buffer Manager Test
  Benchmarching section vector int
-------------------------------------------------------------------------------
/home/ngenesio/robotology/yarp-telemetry/test/BufferManagerTest.cpp:303
...............................................................................

benchmark name                       samples       iterations    estimated
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
BufferOfInt-1000Samples-
oneVariable-3x1                                100            26      2.184 ms
                                        23.7464 us    23.5317 us    24.0815 us
                                        1.34468 us    939.276 ns    1.90603 us

BufferOfInt-10000Samples-
oneVariable-3x1                                100            25     2.1775 ms
                                        210.662 us    209.416 us    212.311 us
                                        7.22334 us    5.66413 us    11.2294 us

BufferOfInt-100000Samples-
oneVariable-3x1                                100            14     2.3044 ms
                                        3.78658 ms    3.77177 ms    3.80836 ms
                                        90.1273 us    66.2636 us     151.99 us

-------------------------------------------------------------------------------
Buffer Manager Test
  Benchmarching section matrix int
-------------------------------------------------------------------------------
/home/ngenesio/robotology/yarp-telemetry/test/BufferManagerTest.cpp:350
...............................................................................

benchmark name                       samples       iterations    estimated
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
BufferOfInt-1000Samples-
oneVariable-3x2                                100            25     2.1725 ms
                                        27.0848 us    26.6739 us    27.8695 us
                                          2.792 us    1.71097 us    4.27228 us

BufferOfInt-10000Samples-
oneVariable-3x2                                100            25       2.21 ms
                                        220.268 us    218.948 us    221.918 us
                                        7.52388 us    5.84708 us    10.4822 us

BufferOfInt-100000Samples-
oneVariable-3x2                                100            13      2.184 ms
                                        4.25831 ms     4.2465 ms    4.26993 ms
                                        59.8258 us    54.1948 us    66.3546 us

UNCOMPRESSED

-------------------------------------------------------------------------------
Buffer Manager Test
  Benchmarching section scalar int
-------------------------------------------------------------------------------
/home/ngenesio/robotology/yarp-telemetry/test/BufferManagerTest.cpp:261
...............................................................................

benchmark name                       samples       iterations    estimated
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
BufferOfInt-1000Samples-
oneVariable-1x1                                100            26      2.275 ms
                                        7.06808 us    6.04746 us    9.04823 us
                                        6.98648 us    4.12175 us    11.0471 us

BufferOfInt-10000Samples-
oneVariable-1x1                                100            27     2.3112 ms
                                        16.0549 us      15.14 us    19.5875 us
                                        8.14875 us    1.68754 us    19.0175 us

BufferOfInt-100000Samples-
oneVariable-1x1                                100            26     2.2828 ms
                                        127.115 us    126.024 us    128.614 us
                                        6.51239 us    5.06768 us    9.06838 us

-------------------------------------------------------------------------------
Buffer Manager Test
  Benchmarching section vector int
-------------------------------------------------------------------------------
/home/ngenesio/robotology/yarp-telemetry/test/BufferManagerTest.cpp:310
...............................................................................

benchmark name                       samples       iterations    estimated
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
BufferOfInt-1000Samples-
oneVariable-3x1                                100            26     2.3244 ms
                                        8.48223 us    7.87719 us    9.18527 us
                                        3.33351 us    2.91963 us     3.8745 us

BufferOfInt-10000Samples-
oneVariable-3x1                                100            27     2.2896 ms
                                        17.3417 us    17.2061 us    17.5309 us
                                        811.123 ns    628.317 ns    1.08676 us

BufferOfInt-100000Samples-
oneVariable-3x1                                100            26     2.2958 ms
                                        168.912 us    165.697 us    174.555 us
                                         21.257 us    14.0929 us    33.3633 us

-------------------------------------------------------------------------------
Buffer Manager Test
  Benchmarching section matrix int
-------------------------------------------------------------------------------
/home/ngenesio/robotology/yarp-telemetry/test/BufferManagerTest.cpp:364
...............................................................................

benchmark name                       samples       iterations    estimated
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
BufferOfInt-1000Samples-
oneVariable-3x2                                100            22     2.2704 ms
                                        7.54132 us    7.31777 us    8.07836 us
                                        1.66523 us    807.941 ns    3.28624 us

BufferOfInt-10000Samples-
oneVariable-3x2                                100            26     2.2932 ms
                                        22.2203 us    21.9476 us    22.6629 us
                                        1.74048 us    1.17876 us    2.40411 us

BufferOfInt-100000Samples-
oneVariable-3x2                                100            25      2.285 ms
                                        264.646 us    260.733 us    268.992 us
                                        20.9638 us    18.0406 us    26.2273 us
Nicogene commented 3 years ago

I tried the same experiment of https://github.com/robotology/yarp-telemetry/issues/115#issuecomment-812452312 after enabling the compression here is the data:

test_telemetry_compressed_pt1.zip test_telemetry_compressed_pt2.zip test_telemetry_compressed_pt3.zip

Here is the data, it is ok there are no artifacts: immagine

For 2 minutes of acquisition of encoders/accelerations/velocities of 32 joints we have:

~ 9.2 MB uncompressed ~ 5.7 MB compressed

The differences in computation seem more significant, we have to decide if we want to lose something in performances for saving some space.

cc @AlexAntn @traversaro @S-Dafarra @drdanz

S-Dafarra commented 3 years ago

Nice! Would it be possible to save in another thread without blocking the circular buffer?

drdanz commented 3 years ago

Since the impact is rather significant, I believe that it should be a user choice, we could have an option to select is compression should be enabled or not...