|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Optimization Advice for beginer?I am in a second level college programing class, and we have to make a maze solving program, and we are graded on how much time out program uses to produce a optimal solution. I have done just about everything I can to optimize my code, my program takes 0.055 seconds to complete all of the test cases, but I need to run a little faster.
I was wondering if you know any good optimization flags that I can use that would increase perfomance. I am using stack and queue data strutures. Also, I do not know what type of machine, or "Autograder" will compile and grade my code, but I am allowed to submit my own makefile. Here is my current make file: " .SUFFIXES: .o .cpp OBJS = prog.o maize.o #CC = g++ -Wall #CC = g++ -g -Wall CC = g++ -O3 -Wall -O -funroll-loops AR = ar cr all : $(OBJS) UTIL/libutil.a $(CC) -o MortimerMaze $(OBJS) UTIL/libutil.a UTIL/libutil.a: cd $(PWD)/UTIL; make PWD=$(PWD)/UTIL clean: rm -rf *.o MortimerMaze cd $(PWD)/UTIL; make PWD=$(PWD)/UTIL clean .cpp.o: $(CC) -c $*.cpp " |
|
|
Re: Optimization Advice for beginer?Well... I find it interesting that you are relying on the compiler to
optimize. Usually the first place to look at is your code. But anyway... looking at your compiler options, I think you have pretty much done everything you can. Maybe optimizing for a particular processor is an option for you? -Barry On Sunday 05 February 2006 08:29 pm, wodderwing1 (sent by Nabble.com) wrote: > I am in a second level college programing class, and we have to make a maze > solving program, and we are graded on how much time out program uses to > produce a optimal solution. I have done just about everything I can to > optimize my code, my program takes 0.055 seconds to complete all of the > test cases, but I need to run a little faster. > > I was wondering if you know any good optimization flags that I can use > that would increase perfomance. I am using stack and queue data strutures. > Also, I do not know what type of machine, or "Autograder" will compile and > grade my code, but I am allowed to submit my own makefile. > > Here is my current make file: > > " > > > .SUFFIXES: .o .cpp > > OBJS = prog.o maize.o > #CC = g++ -Wall > #CC = g++ -g -Wall > CC = g++ -O3 -Wall -O -funroll-loops > AR = ar cr > > all : $(OBJS) UTIL/libutil.a > $(CC) -o MortimerMaze $(OBJS) UTIL/libutil.a > > UTIL/libutil.a: > cd $(PWD)/UTIL; make PWD=$(PWD)/UTIL > > clean: > rm -rf *.o MortimerMaze > cd $(PWD)/UTIL; make PWD=$(PWD)/UTIL clean > > .cpp.o: > $(CC) -c $*.cpp > > > " > > -- > View this message in context: > http://www.nabble.com/Optimization-Advice-for-beginer--t1066651.html#a27746 >84 Sent from the gcc - Help forum at Nabble.com. |
|
|
Re: Optimization Advice for beginer?The compiler flags helped, and I also made my data structure a little larger so that I would have to do less conditional tests. That change seemed to make the biggest difference.
|
| Free embeddable forum powered by Nabble | Forum Help |