Prev: Elaboration query
Next: Dhrystone
From: Ada novice on 23 Jul 2010 05:52 Hi, I'm using the AdaGIDE editor (version 7.45.2) together with the GNAT AdaCore libre compiler (release 2010) on a Win XP machine. I would like my codes to run as fast as possible and here is the content of a typical gnat.ago file that I use. Please let me know what improvements I can make in order for an Ada program to run in the minimum amount of time. I understand that setting the release mode makes a program bypass some checks and make it run faster. -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato WINDOWS_TARGET -- Begin compiler switches RELEASE <- active (current) build mode TRUE <- are gcc/gnatmake/main/target-dir of Release := these from Debug mode ? debug o2 false debug inlining false debug unroll_loops false debug suppress_all_checks false debug debug_info true debug integer_overflow_check true debug stack_check false debug trace_back false debug all_validity_checks false debug strip_all_symbols false debug profiling false debug verbose_details false debug all_warnings true debug build_in_place false release o2 true release inlining true release unroll_loops true release suppress_all_checks true release debug_info false release integer_overflow_check false release stack_check false release trace_back false release all_validity_checks false release strip_all_symbols true release profiling false release verbose_details true release all_warnings true release build_in_place false -- End compiler switches -- Begin Release mode commands -- End Release mode commands -- Begin run options prompt_arguments false ad_trace_back false -- End run options Thanks. YC
From: Gautier write-only on 23 Jul 2010 07:56 In the "Compiler Options" box, you can add combinations of the following: -fpeel-loops -ftracer -funswitch-loops -fweb -frename-registers and look what happens. Also -O3 instead of -O2 is worth a look. For floating-point maths, you can try -mfpmath=sse -msse2 (or -msse3) If you look on the web for those switches, there are often ideas of other ones... In your sources, you can check (one at a time) the effects of the Inline pragma. HTH G.
From: Ada novice on 23 Jul 2010 10:17 Hi, Thanks for your kind help. As I mentioned earlier, I use -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato and so the -O3 is already there though the .ago file doesn't state it. I have tried to put all of your options at once so as to have: -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato -fpeel-loops -ftracer - funswitch-loops -fweb -frename-registers -mfpmath=sse -msse3 but I didn't see improvements in the execution time. For the sample program that I'm testing, the options that I used previously run the a code in 1538 s and with the new options (combination of yours and mine), it took 1546 s. The problem is that there's not much information available on the compiler options on the web. But I shall investigate each of the option that you supplied and also it can be a good idea to not put all these options at the same time. Thanks again. YC
From: Ada novice on 23 Jul 2010 10:20 Hi, Thanks for your kind help. As I mentioned earlier, I use -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato and so the -O3 is already there though the .ago file doesn't state it. I have tried to put all of your options at once so as to have: -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato -fpeel-loops -ftracer - funswitch-loops -fweb -frename-registers -mfpmath=sse -msse3 but I didn't see improvements in the execution time. For the sample program that I'm testing, the options that I used previously run the code in 1538 s and with the new options (combination of yours and mine), it took 1546 s. The problem is that there's not much information available on the compiler options on the web. But I shall investigate each of the option that you supplied and also it can be a good idea to not put all these options at the same time. For now I read that -mfpmath=sse - msse3 should be very suitable to increase the execution speed. Thanks again. YC
From: Ada novice on 23 Jul 2010 10:23
Hi, Thanks for your kind help. As I mentioned earlier, I use -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato and so the -O3 is already there though the .ago file doesn't state it. But perhaps in AdaGIDE, the option -O3 is equivalent to: release o2 true release inlining true as written in the .ago file in my earlier message. I have tried to put all of your options at once so as to have: -gnatVa -O3 -gnatn -funroll-loops -gnatf -gnato -fpeel-loops -ftracer - funswitch-loops -fweb -frename-registers -mfpmath=sse -msse3 but I didn't see improvements in the execution time. For the sample program that I'm testing, the options that I used previously run the code in 1538 s and with the new options (combination of yours and mine), it took 1546 s. The problem is that there's not much information available on the compiler options on the web. But I shall investigate each of the option that you supplied and also it can be a good idea to not put all these options at the same time. For now I read that -mfpmath=sse - msse3 should be very suitable to increase the execution speed. Thanks again. YC |