Merge "Calculate batching param in a smarter way" into oc-dev