Sponsored Content
Top Forums Programming compilation parameters, code optimization Post 302225292 by spirtle on Friday 15th of August 2008 04:57:52 AM
Old 08-15-2008
1. The fact that the compiler was able to optimise your code well does not mean that it was badly written, just that the optimiser is doing its job. If code has been written in a way that helps the optimiser do its job, then that's good, but "hand-optimised" code tends to become unmaintainable gibberish. Concentrate more on finding better algorithms and writing clear code.

2. GCC, like any decent compiler, has dozens of individual optimisation flags; they are fully described in the manual. O3, O2 and so on are short-hand ways of turning a whole bunch of them on. You can experiment with fine-tuning the optimisation if you need to or are curious, but this can be time consuming, so you had better be sure it's worth the effort. Most people just switch on -O2 or O3 and leave it at that.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help on optimization of the script

Hi, I have prepared script which is taking more time to process. find below script and help me with fast optimized script:- cat name.txt | while read line do name=$(echo $line| awk '{print $8}') MatchRecord=$(grep $name abc.txt | grep -v grep ) echo "$line | $MatchRecord" | awk... (2 Replies)
Discussion started by: aju_kup
2 Replies

2. HP-UX

HP-UX 64 compilation causing some code to seg fault

Hello everyone, Today we are attempting to port some legacy C code to a 64 HP-UX machine at my company and there is kind of a strange error we ran into. there is a small function they have defined called zgetenv that accepts a char* and basically just does some null checking and returns ... (0 Replies)
Discussion started by: khadesh
0 Replies

3. Programming

Re : Pass parameters from Cron job to Java code

Hello All, Hope all is fine. I am newbie to Unix. I am using Bourne Shell (sh). One of the question I have is that I am trying to read XML file and based on reading that XML file I want to run same java programs at different hours. When I run the Java code, I wanted to pass parameters to my... (1 Reply)
Discussion started by: samshaw
1 Replies

4. Programming

Program exited with code 01: does it indicate unsuccessful compilation?

(gdb) r --------------------- enter Breakpoint 1, 0x0000000000409d40 in main () (gdb) n Single stepping until exit from function main, which has no line number information. Find_Cmd_Option: found option no. 2: seed (s) Find_Cmd_Option: found option no. 5: dfile (c) Initial no. div... (1 Reply)
Discussion started by: cdbug
1 Replies

5. Programming

Compilation error when compiling Pro*C code

I'm running a query similar to the one that I'm describing below -: _______________________________ EXEC SQL INSERT INTO TABLE1 ( C1 ,C2 ,C3 ,C4 ) (SELECT DISTINCT B.V1 ,B.V2 ,( SELECT D.V3 FROM TABLE2 D WHERE D.V3 = C.V4) ,B.V4 FROM TABLE2 B ,TABLE3 C WHERE B.V3 = C.V4) ;... (1 Reply)
Discussion started by: maheshp
1 Replies

6. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

7. Shell Programming and Scripting

Shell Script passing parameters to sqlplus code

Hello All, I am interested in finding out a way to pass parameters that are entered at the prompt from HP unix and passed to SQLPlus code with a Shell Script. Is this possible? Thanks (4 Replies)
Discussion started by: compprog11
4 Replies

8. Shell Programming and Scripting

Source code compilation

Need assistance in Source code compilation . When installing a software compiling a source code . Whatever the output that prints on the screen i want to log it into a file. How can i see output and store the output to file ./configure make make install Is there other way of seeing output... (5 Replies)
Discussion started by: ajayram_arya
5 Replies

9. Shell Programming and Scripting

Code optimization

Hi all I wrote below code: #!/bin/sh R='\033 do you have any idea how to optimize my code ? (to make it shorter eg.) (11 Replies)
Discussion started by: primo102
11 Replies
footprints(1)						      General Commands Manual						     footprints(1)

NAME
footprints - summarize information from compiler footprint records SYNOPSIS
filename... DESCRIPTION
The command scans the named object files, analyzes the compiler footprint records stored in those files, and generates a summary report. This report is intended for use by HP support and lab engineers to assist in problem diagnosis. The report contains the following information: o Total number of compilation units found. o Earliest and latest compiler timestamp, and the linker timestamp (if available). o Total size of text and data segments. o List of compiler versions used, with number of compilation units compiled with each version. o List of options used, with number of compilation units compiled with each option setting. This list is separated into two groups, with the most interesting options in the first group, followed by all remaining options alphabetized in the second group. The following file types are recognized: o Executable files and shared libraries. The command will attempt to find all dependent, non-system shared libraries and will print a separate report for each shared library. If the or environment variable is set, it will search for dependent libraries in the directories listed in the environ- ment variable (if is set, will be ignored). It will also use the embedded search path in the object file. If a shared library cannot be located, a diagnostic will be printed and execution will continue. o Archive libraries. The command will scan each object file member of the archive. o Relocatable object files. The command will scan the named object files. The command supports SOM and ELF object file formats, 32-bit and 64-bit code, and PA-RISC and Integrity systems. It supports compiler footprints produced by the HP C and C++ compilers. Compilation units produced by other compilers may not be reflected in the summary. Options The command recognizes the following options: Print the version number and quit. Verbose mode: prints detail information about each compilation unit found. Prints warnings for possible compatibility problems. Currently, it prints a warning for any compilation units built for Integrity systems with a C/C++ compiler earlier than Version A.05.50. Warnings are printed to stderr with three asterisks at the beginning of the line. EXAMPLES
The following example shows the beginning of a typical summary report: Scanning /usr/bin/ksh ... Compiler footprint summary Number of compilation units: 51 Earliest compiler timestamp: N/A Latest compiler timestamp: N/A Linker timestamp: 15-Jul-2006 13:07 UTC Total size: 425.8K (text) 24.8K (data) version [A.06.11/ANSI C 51] architecture [ipf32 51] -O [01 1] [02 50] PBO [off 51] -g [off 51] debugopt [off 51] +Ointeger_overflow [moderate 51] +Olit [const 51] +eh [off 51] -fpeval [float 51] -inline [1 1] [2 50] -link_type [dynamic 51] -mt [(off) 51] -rodata [cond 51] ... The line shows that all 51 compilation units were compiled with Version A.06.11 of the ANSI C compiler. The line shows that the applica- tion was compiled for Integrity systems (Itanium(R) Product Family) in the 32-bit data model. The line shows that one compilation unit was compiled at the default level of optimization (level 01), and the other 50 were compiled at level 02. According to the line, all 51 were compiled without profile-based optimization. The line shows that no compilation units were compiled with the symbolic debug option. Otherwise, the line would show the number of compi- lation units compiled with various combinations of symbolic debug and higher optimization levels. For on/off options like settings listed in parentheses represent a default setting not overridden by a compiler option. Many of the options in the footprint record do not correspond directly to a command-line compiler switch, or have a different spelling, and are included in this report for use by HP support and lab engineers. See cc(1) for a description of supported command-line switches. AUTHOR
was developed by HP. SEE ALSO
cc(1), elfdump(1), odump(1). footprints(1)
All times are GMT -4. The time now is 02:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy