[BUG #8522] add stat method
[BUG #8522] add caching and speed up algorithm
[BUG #8522] add caching for 'source' task