#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    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??
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    243
    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.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw

IMN logo majestic logo threadwatch logo seochat tools logo