Message boards :
Number crunching :
Question for the Code Cutters
Message board moderation
Author | Message |
---|---|
Terror Australis Send message Joined: 14 Feb 04 Posts: 1817 Credit: 262,693,308 RAC: 44 |
What is involved in "optimizing" an app ? I continue to be amazed at the difference between AK-V8 and the stock app. It got me thinking, How many ways are there to tell a computer to add 2+2 and why are some ways more efficient than others ? Brodo |
Mr. Majestic Send message Joined: 26 Nov 07 Posts: 4752 Credit: 258,845 RAC: 0 |
|
JDWhale Send message Joined: 6 Apr 99 Posts: 921 Credit: 21,935,817 RAC: 3 |
What is involved in "optimizing" an app ? It's the use of SIMD (Single Instruction Multiple Data) instructions performing 4 additions or multiplications in the same time it takes a single addition or multiplication. It's harder to code, but can make programs much faster by using more of the CPU capabilities. HTH, JDWhale |
PhonAcq Send message Joined: 14 Apr 01 Posts: 1656 Credit: 30,658,217 RAC: 1 |
try this It has it for Windows and Linux on this page. Hope that helps! That link is unfortunately useless; i.e. it is hardly a step-by-step set of instructions and is 2 years old. Does anybody have an updated roadmap for compiling our own client? |
1mp0£173 Send message Joined: 3 Apr 99 Posts: 8423 Credit: 356,897 RAC: 0 |
What is involved in "optimizing" an app ? This thread got into the flavor of optimizing code. There are a couple of things that are commonly done: The most common optimizations take the existing code, without changes, and tries to find the optimal set of compiler switches for a given CPU. You can change the execution speed by telling the code generator in the compiler about the specific CPU instruction set. Less common is taking routines that use a lot of time and re-coding them in more efficient ways. Another less common change is recognizing how a CPU feature like branch prediction works, and adjusting all of the branches so they tend to follow the favored method. The least common (and most brilliant) is looking at the code, and recognizing that some time consuming function (like trig. functions) can be "cached" in a table, and the table lookup takes less time than recalculating. |
Terror Australis Send message Joined: 14 Feb 04 Posts: 1817 Credit: 262,693,308 RAC: 44 |
Well, I understood the first post :-) I'm still not sure whether those blokes were for real or just typing random symbols to impress the masses (but I'm impressed anyway), I love it when people who know their stuff start sparring, it's like watching Roger Fedora and Rafael Nadal having a "social" game of tennis :-) Brodo P.S. Anyone want to discuss the finer points on how a change of Eg2 effects the zd and ib of a 4VL100000 operating in class C2, when Fc=2525000Hz Fm=315Hz and mi=0.47 ("Blah" :-P ) |
jason_gee Send message Joined: 24 Nov 06 Posts: 7489 Credit: 91,093,184 RAC: 0 |
try this It has it for Windows and Linux on this page. Hope that helps! Actually, for the windows one at least, As far as building & compiler optimising goes , that process is near identical to the one I used for all the AK_V8 releases, with obvious adjustments and addition of further steps due to newer tools and techniques. Using those steps with a little help and the Ported Windows AK_V8 code should obtain, if not the very fastest app, at least a reasonably functional one. I learned how to build apps using that guide, and starting with an older build, to 'get a feel' for it, is what I would recommend, [as more advanced builds like AK tend to migrate from standard looking code to hieroglyphics ;D] Of course that's just the compiler tweaking part of optimisation, the hard optimisation work typically occurs at both the algorithmic and microarchitectural levels. That was Alex's work, with contribution from all previous notes and experience at Lunatic's to obtain the knowledge to build it, and get it going & validated. Jason "Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions. |
kittyman Send message Joined: 9 Jul 00 Posts: 51468 Credit: 1,018,363,574 RAC: 1,004 |
If you really wanna get into it......... Please talk to Jason and the other optimizers over at Lunatics........ and if you need a pass into the pre-release section for coders, I am sure I can arrange that, if you are for true...... They will have ya for lunch, I think.........they are WAAAYYYY over this lil' kitty cruncher's head........ If not, I apologize and push you even harder.......LOL. "Freedom is just Chaos, with better lighting." Alan Dean Foster |
Terror Australis Send message Joined: 14 Feb 04 Posts: 1817 Credit: 262,693,308 RAC: 44 |
[/quote]They will have ya for lunch, I think............LOL.[/quote] Lunch ? I wouldn't even be a biscuit during their coffee break :-) Brodo |
kittyman Send message Joined: 9 Jul 00 Posts: 51468 Credit: 1,018,363,574 RAC: 1,004 |
LOL........I'll be a kitty biscuit too...........their lunch is my toaste.......... Coders Rule......... "Freedom is just Chaos, with better lighting." Alan Dean Foster |
1mp0£173 Send message Joined: 3 Apr 99 Posts: 8423 Credit: 356,897 RAC: 0 |
I can't speak for ML1, but I think he has a good grasp of things. I've been writing code for nearly four decades, and I'm pretty good at taking an algorithm and moving code around to get something reasonably fast. I've never practiced optimization at the level JDWhale, Jason, and many others do. ... but I know what it is, and the examples in the thread are both artificial, and incredibly entry-level. I took your original question from this thread to be "what is the general techniques used, and why does it make things faster" while most of the other posters seem to have gone toward "here are the tools so that you can try your hand..." The best optimizations take a deep understanding of the algorithm (so you know what parts you can shuffle around without changing the result) and a deep understanding of the CPU internals (so you can imagine ways to feed the CPU in the most optimal ways). ... and then it takes lots of experimentation, testing, and validation. -- Ned |
kittyman Send message Joined: 9 Jul 00 Posts: 51468 Credit: 1,018,363,574 RAC: 1,004 |
The expert on the math here would be Joe Segur..... He has his fingers in all the algorithms...... This is very technical stuff......waaaaaaaaaaaay more than I can put my hands around..... You not only have to be doing the math right, you have to be doing the right math....... And then code it to run as fast as possible........not easy stuff....... Give much respect to those who can make it work at all!!! "Freedom is just Chaos, with better lighting." Alan Dean Foster |
1mp0£173 Send message Joined: 3 Apr 99 Posts: 8423 Credit: 356,897 RAC: 0 |
The expert on the math here would be Joe Segur..... There are lots of different kinds of algorithms, they aren't all math. I do a fair amount with sorting and searching, and less with things like Fast Fourier Transforms. If you wanted to be able to find a data item in a list of 100,000 I can discuss search strategies that will take 25 comparisons or less. So, I can appreciate their work, and I can talk about what they're doing in a general way, and you are absolutely correct -- this is not just hard work, but requires a certain amount of actual genius. |
kittyman Send message Joined: 9 Jul 00 Posts: 51468 Credit: 1,018,363,574 RAC: 1,004 |
The expert on the math here would be Joe Segur..... I'll grant ya that........ They would all rate the 'genius' tag in my book!!! "Freedom is just Chaos, with better lighting." Alan Dean Foster |
©2024 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.