improve file implementation.

Signed-off-by: jack <jack.wgm@gmail.com>
improve rate calc.

Signed-off-by: jack <jack.wgm@gmail.com>