0
$\begingroup$

Rosanswers logo

When you start robag play with huge bag files or a lot of bag files for the first call usually is takes some time until rosbag actually starts publishing. For repeative calls then it starts publishing quite fast, until something I don't know (reboot?, unmount bag storage device? timeout?) happens. I guess rosbag caches an index file somewhere to make repeative plays faster. What causes it to discard this index file? Is there a way to store this index file and point rosbag play to it in other for speeding up play e. g. first time after system boot?


Originally posted by Wolf on ROS Answers with karma: 7555 on 2015-06-22

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Rosbag isn't doing any caching to make repeated plays faster.

The operating system has an in-memory disk cache, and repeated plays are faster because some part of the file is already in the cache. This cache is shared across the whole system, so reading or writing another file could cause your bag to be evicted from cache, and of course a reboot will completely clear the cache because it's in memory.


Originally posted by ahendrix with karma: 47576 on 2015-06-22

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by Wolf on 2015-06-22:
Ok, then there is probably no way to speed the first launches... Thank you anyway!

Comment by ahendrix on 2015-06-22:
This question and this question both suggest that you can manipulate the disk cache with a utility called vmtouch.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.