ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

what makes rosbag to start playing fast?

asked 2015-06-22 08:09:36 -0500

Wolf gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2015-06-22 08:34:35 -0500

ahendrix gravatar image

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.

edit flag offensive delete link more

Comments

Ok, then there is probably no way to speed the first launches... Thank you anyway!

Wolf gravatar image Wolf  ( 2015-06-22 09:19:41 -0500 )edit
1

This question and this question both suggest that you can manipulate the disk cache with a utility called vmtouch.

ahendrix gravatar image ahendrix  ( 2015-06-22 09:30:57 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-22 08:09:36 -0500

Seen: 1,045 times

Last updated: Jun 22 '15