November 14th, 2012, 02:13 AM
Will LD_PRELOAD reduces the speed of execution???? help needed
i am writing a memcpy wrapper. and i am doing a LD_PRELOAD of the library on which memcpy wrapper is written. Now if i run a application which calls strcpy it is not doing it fast. if i am runing the same application without LD_PRELOAD, it is running faster. but if i am running it with a preloaded library it is slow. even if it not defined in the library. Will LD_PRELOAD will decrease the speed of execution??
November 14th, 2012, 04:53 AM
I suspect there is something else going on. LD_PRELOAD is just about when libs are made available to the app and dynamic bindings are made and shouldn't have any impact on run-time behavior (to my knowledge). Performance testing depends a great deal on the state of the machine (my sig has a writeup on performance programming) so you would need to ensure that you are really testing apples to apples and not confounding the test somehow. Also, as far as I know, strcpy is a function that gets mapped directly into the memory space of the application so its origin shouldn't make a particle of difference.