Unless someone has a better idea, it may make sense to capture execution profiles of runs both with and without Synology Drive active, both
Perl and
C sides of things. The latter might demonstrate whether Synology Drive is doing something unusual, like injecting its DLL into other processes.