RLI related save issue

Hello,

We were working with RevenueLineItems module logic hook.
And we are facing issue with the save process being very slow.
So to test we created a logic_hook with the following code


Class RLILogicTest{
public function testFunction($bean, $event, $args){
echo "<br>'{$bean->id}' → update FLI record - {$event} - isUpdate:'{$bean->isUpdate()}'";
}
}

On execution it returned 398 lines.
Indicating the logic hook was somehow triggered for all the RevenueLineItems related to the parent Opportunity

We tried to disable all the logic hooks and test, but got same result.

Kindly let us know why, logic hook was triggered for all the RevenueLineItems related to the parent Opportunity.
And how to avoid it, to achieve better performance

Thanks