News for hackers. Stuff that matters.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by alex_smart on Saturday September 09, 2023 @02:02AM (#37442676)
This reminds me of the first internship I did. It was at an AI based anamoly detection startup. Their pipeline for the biggest client used to run in just under 3 hours, most of which was apparently spent extracting meaningful information from sensor data from a proprietary binary format using a shared library provided by the client. Ran it under perf and found that most of the time was spent calculating a bunch of sines and cosines. Used the LD_PRELOAD trick to log the sine and cosine calls and turns out that we were just calculating the sines and cosines of the same set of angles over and over again literally thousands of times. Wrote a wrapper to cache the values of sines and cosines in a table and return the cached value if it is already calculated and brought the running time of the pipeline to under 15 minutes. Which meant that the data science team could run their experiments and iterate on their model much faster and cheaper. Fun times.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by ditsuke on Saturday September 09, 2023 @03:12AM (#37442973)
Wow, that sounds like a fun place to work at!
Re:Using LD_PRELOAD to cheat, inject features and investigat... by ahoka on Saturday September 09, 2023 @05:27AM (#37443586)
Almost any workplace is like that if you can, want and allowed to create value.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by rewmie on Saturday September 09, 2023 @06:18AM (#37443824)
> Almost any workplace is like that if (...)

Most people aren't that fortunate. There are good reasons why the word "job" is not synonymous with "fun".

Re:Using LD_PRELOAD to cheat, inject features and investigat... by ahoka on Saturday September 09, 2023 @10:21AM (#37445762)
I have assumed a software development workplace here.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by alex_smart on Saturday September 09, 2023 @07:32AM (#37444186)
It was, and great colleagues too! Although this wasn't "assigned" work. Just me being curious/bored.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by bdavbdav on Saturday September 09, 2023 @08:18AM (#37444468)
It always amazes me when people miss this stuff first time around. “Dynamic programming” was always one of the common optimisations throughout my CS degree.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by daymanstep on Saturday September 09, 2023 @07:47PM (#37451454)
That sounds more like memoization than dynamic programming.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by bdavbdav on Sunday September 10, 2023 @03:33AM (#37453670)
AIUI, DP is around memorising the results of static functions for a particular input.

“Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of subproblems, so that we do not have to re-compute them when needed later”