Okay, I see.
The problem is the function that checks for new item requests, because to my knowledge they cannot be detected in any way other that just filtering all entities. Modding API just doesn't support catching the moment they are created.
The good news is that you can disable automatic rechecks in GUI -> Preferences -> uncheck "Automatically recheck for lost item request proxies", it will fix lag spikes.
The bad news is that with this option unchecked the mod will not realize if you, for example, use upgrade planner to add modules to already existing buildings and won't insert modules. You can manually make it recheck for that either via GUI -> Preferences -> "Find lost item request proxies" or by using a console command /qf_update_module_requests