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
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
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
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
(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
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
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
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
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
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
LEARN ABOUT SUSE
generate_optimized_palette
generate_optimized_palette(3alleg4) Allegro manual generate_optimized_palette(3alleg4)
NAME
generate_optimized_palette - Generates an optimized palette for a bitmap. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int generate_optimized_palette(BITMAP *bmp, PALETTE pal, const char rsvd[PAL_SIZE]);
DESCRIPTION
Generates a 256-color palette suitable for making a reduced color version of the specified truecolor image. The rsvd parameter points to a
table indicating which colors it is allowed to modify: zero for free colors which may be set to whatever the optimiser likes, negative val-
ues for reserved colors which cannot be used, and positive values for fixed palette entries that must not be changed, but can be used in
the optimisation.
RETURN VALUE
Returns the number of different colors recognised in the provided bitmap, zero if the bitmap is not a truecolor image or there wasn't
enough memory to perform the operation, and negative if there was any internal error in the color reduction code.
SEE ALSO
generate_332_palette(3alleg4), set_color_depth(3alleg4)
Allegro version 4.4.2 generate_optimized_palette(3alleg4)