kazeburo/GrowthForecast — pull request #50 by sonots (2014-01-09 14:12:24+00:00)
Title: --disable-subtract

Added `--disable-subtract` option.

By disabling `subtract` functionality, we can improve the performance of the GrowthForecast worker drastically because

1. We can avoid N+1 queries issued at https://github.com/kazeburo/GrowthForecast/blob/c3bc89dd2d2f3ab01dbfd5a181e931cd15364761/lib/GrowthForecast/Worker.pm#L94-L105
2. We can avoid to have `sub` DS in RRD files, which results in reducing disk size and disk access to half
https://github.com/kazeburo/GrowthForecast/blob/c3bc89dd2d2f3ab01dbfd5a181e931cd15364761/lib/GrowthForecast/RRD.pm#L33

In my environments, I achieved following performance improvement to update 60,000 graphs

```
Before: 50 sec
After: 10 sec
```

I also prepared --disable-subtract option for `eg/alter_for_float_number.pl` and `eg/benchmark_rrd.pl`.

Please note that I took care of that users can upgrade to use --disable-subtract without deleting RRD files and databases.