Prev: Best way to learn ... need some help
Next: A tool that suggests optimized logic for a piece of code/module/function
From: Nick Keighley on 26 Jan 2010 03:03 On 26 Jan, 05:20, karthikbalaguru <karthikbalagur...(a)gmail.com> wrote: > On Jan 25, 5:31 am, toby <t...(a)telegraphics.com.au> wrote: > > On Jan 11, 3:07 pm, karthikbalaguru <karthikbalagur...(a)gmail.com> <snip> > > > Is there a tool for C language that > > > could suggest an optimized/alternate > > > programming logic for the function that > > > is written ? > > > IMHO the most effective output it could make is: "Are you really sure > > the best tool for this task is C?" > > My query is 'A tool that suggests > optimized logic for a piece of > code/module/function' . we can read > I am > looking for a tool that suggests > optimized logic for various > modules/functions written in > C language. and I am doubtful that such a tool can exist > The tool can be made of any > language. or none BTW: are your lines so short so your posts look like poetry? -- "By 1985, machines will be capable of doing any work that a man can do" Herbert Simon 1965
From: karthikbalaguru on 26 Jan 2010 12:22 On Jan 26, 3:51 pm, Josef Moellers <josef.moell...(a)ts.fujitsu.com> wrote: > karthikbalaguru wrote: > > My query is 'A tool that suggests > > optimized logic for a piece of > > code/module/function' . I am > > Define "optimized"! > > Optimized for speed, optimized for memory requirement, optimized to > handle extreme situations, optimized to handle easy situations? > Exactly ! The tool should support for memory based optimization that greatly helps in memory/ cost constraint systems, speed based optimization that greatly decides the performance in certain projects, perfect algorithm/logic required for a particular scenario, and other optimization techniques applicable. It should probably have an option that could decide the type of optimization required for the user for the particular module. May be there can be an option called 'general optimization' that would apply all optimization techniques to a certain level only in a balanced manner. If the user is particular about certain particular optimization, Once the type of optimization is got as input from the user, even the level of optimization can be got from the user by having some flags/options for defining different levels of optimization . It could also tell the bottlenecks in the code and that would greatly help in optimizing the right piece of code. Maybe a profiler should also be part of it. The tool can also display graphs that could give comparitive analysis of speed improvement vs memory usage vs various levels of various kinds of optimization techniques. It can also suggest the best possible number of threads required, message queues required for a particular logic and define that logic. It can remove off redundant threads, interrupts or timers etc and add if required for an efficient logic that it could suggest to the user. Maybe, it can also suggest various processors and the relative performance w.r.t memory, speed and cost for those . It could also suggest if we need to go in for a multicore and if so , it can suggest the number of cores and the kind of processor ! Karthik Balaguru
From: santosh on 26 Jan 2010 14:33 Nick wrote: > karthikbalaguru <karthikbalaguru79(a)gmail.com> writes: > > > On Jan 26, 3:51 pm, Josef Moellers <josef.moell...(a)ts.fujitsu.com> > > wrote: > >> karthikbalaguru wrote: > >> > My query is 'A tool that suggests > >> > optimized logic for a piece of > >> > code/module/function' . I am > >> > >> Define "optimized"! > >> > >> Optimized for speed, optimized for memory requirement, optimized to > >> handle extreme situations, optimized to handle easy situations? > >> > > > > Exactly ! > > The tool should support > > for memory based optimization > > Optimised for line width, apparently. A case of over-optimisation, if there ever was one. ;-)
From: bigbrownbeastie on 27 Jan 2010 03:53 On Jan 15, 12:04 pm, Walter Banks <wal...(a)bytecraft.com> wrote: > Hans-Bernhard Bröker wrote: > > David Brown wrote: > > > > Nothing stops the compiler from doing this sort of thing in /theory/. > > > But /practice/ is a different matter. > > > The same thing applies to the original question. If a compiler's > > full-blown optimizer, given practically infinite time to ponder the > > problem, can't get that analysis job done, then no other tool can, and > > certainly not while just looking over the programmers' shoulders as they > > type. > > The compilers optimizer primarily goal is to map an application > on a target processor. Most good optimizers have a lot of > information on the application code and the resources required to > implement a specific instance. A possible implementation might > involve trying alternative approaches and using compiler metrics > This could be automated. > > Regards, > > -- > Walter Banks > Byte Craft Limitedhttp://www.bytecraft.com I have not read all this thread becuase it seems a bit long. Modern compiler optomise for code speed or code size. When you select these not only are transformations tried and checked but also diffrent compression algorithms for initialisers. After this the compiler will select the best methods. Kind of Monte Carlo. Which cannot be done by hand unless you have too much time on your hands. Would not be long till you also see 'power use' optomisation or something along these lines.
From: Jonathan de Boyne Pollard on 27 Jan 2010 11:40
> > >> My query is 'A tool that suggests >> optimized logic for a piece of >> code/module/function' . >> > BTW: are your lines so short so your posts look like poetry? > Poetry? Xe is aiming for poetry here? All right. I choose ... erm ... English haiku. Making programs good involves human programmers. You pay them money. I tried for a limerick, but I became stuck after "A poster to Usenet named Karthik ...". |