top of page

Stage 3 Optimization(Compiler Flags)

My first attempt to optimize the project will be to work with the compiler flag options.

By default the compiler is set to compile in this manner "gcc -E -g -o2"


The -E option represents preprocesses only; does not compile, assemble or link.

So I will opt to remove that flag

The -g option enables use of extra debugging information that only GDB can use

Because we are no longer debugging I will remove this as well

The -o2 option is set on by default and it turns on the following flags to increase speed without sacrificing space.

-fdefer-pop

-fmerge-constants

-fthread-jumps

-floop-optimize

-fif-conversion

-fif-conversion2

-fdelayed-branch

-fguess-branch-probability

-fcprop-registers

-fforce-mem

-foptimize-sibling-calls

-fstrength-reduce

-fcse-follow-jumps -fcse-skip-blocks

-frerun-cse-after-loop -frerun-loop-opt

-fgcse -fgcse-lm -fgcse-sm -fgcse-las

-fdelete-null-pointer-checks

-fexpensive-optimizations

-fregmove

-fschedule-insns -fschedule-insns2

-fsched-interblock -fsched-spec

-fcaller-saves

-fpeephole2

-freorder-blocks -freorder-functions

-fstrict-aliasing

-funit-at-a-time

-falign-functions -falign-jumps

-falign-loops -falign-labels

-fcrossjumping

To try and optimize the performance the first thing I will do is change the -o2 to -o3 which will SACRIFICE space for faster execution time. The additional flags will be turned on as well in addition to all the flags listed in -o2

-finline

-functions

-fweb

-frename-registers

RESULTS:


After changing the compilation flags from "gcc -E -g -o2" to "gcc -o3" we have had NO speed up with the program.


charlie medium original -> real 7m10.935s

charlie medium new -> real 7m7.722s


Archie big original -> real 11m40.245s

aarchie big new -> real 11m42.165s

3 views0 comments

Recent Posts

See All

Closing Thoughts

For my final blog post I would like to discuss what I have learned and plan to utilize in the future from this course. So although I was not able to successfully improve my package to operate function

Stage 3 Optimization(COMPUTER ARCHITECTURE ENDIANESS)

Seeing as how the compiler flags did not provide any optimization I will on to my next attempt which is converting big endian to small endian. The aarch64 architecture uses the little endian byte orde

Stage 3 Optimization: Hot Function(closer look part2)

The main function I will be working on is processBuffer static void processBuffer(struct NESSIEstruct * const structpointer) This function looks to be doing 2 main things to cipher the hash inside the

bottom of page