Running my program.....estimated to take 55 hrs...

This is a discussion on Running my program.....estimated to take 55 hrs... within the C Programming forums, part of the General Programming Boards category; I've finally completed my assignment of writing a statistical program to select features..... When I used small datasets of about ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    32

    Running my program.....estimated to take 55 hrs...

    I've finally completed my assignment of writing a statistical program to select features.....

    When I used small datasets of about 5 features...the program works perfect...but when I tried the program with a dataset of 150,000 features......the estimated time to complete the calculation is about 55 hours.......

    After 1 hr, only 1.3K of features are calculated...
    and the CPU seems to be unusually warm when the program is running.....I can feel hot air constantly blowing towards my hand when I'm using the mouse.....

    (I used debugger to estimate the time to load...)

    So can you people tell me your experience, what are the possible reasons which cause the program to run so slow...??

    _____

  2. #2
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    google "Big Oh notation".
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    494
    Optimize
    When no one helps you out. Call google();

  4. #4
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    What exactly are you trying to do? It sounds like you are brute forcing a problem when there might be a much more efficient algorithm.

  5. #5
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Heh, reminds me of the first mathematical model I made for my job. It was estimated to take 147 years to finish. I optimized it down to just over 8 years. It should be finished in 2012.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Quote Originally Posted by pianorain
    Heh, reminds me of the first mathematical model I made for my job. It was estimated to take 147 years to finish. I optimized it down to just over 8 years. It should be finished in 2012.
    haha I hope your not holding your breath.

  7. #7
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    After I went to my boss and showed him a proof that took all of three hours to write up, he accepted that instead of the program results.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  8. #8
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    With new machine speeds no program should ever take that long.

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    http://vision.eng.shu.ac.uk/bala/c/c...imization.html
    Consider the first two points VERY carefully.

    > what are the possible reasons which cause the program to run so slow...??
    Well using a bubble sort on such a large data sample rather than qsort will be a real killer.
    Like the link says, choose good algorithms is the biggest win you will ever make.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by Bubba
    With new machine speeds no program should ever take that long.
    I guess you've never heard of program that calculate huge prime numbers. Or of the SETI project. Or of... need I go on?

    Quzah.
    Hope is the first step on the road to disappointment.

  11. #11
    Registered User
    Join Date
    Feb 2005
    Posts
    32
    Quote Originally Posted by pianorain
    Heh, reminds me of the first mathematical model I made for my job. It was estimated to take 147 years to finish. I optimized it down to just over 8 years. It should be finished in 2012.

    Wow...that was really something man..!!! lol~ Btw, How do you optimize the codes...??

    _____

  12. #12
    Registered User
    Join Date
    Feb 2005
    Posts
    32
    Should I be using bubble sort...??

    _____

  13. #13
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    >Should I be using bubble sort...??

    No.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  14. #14
    Registered User
    Join Date
    Feb 2005
    Posts
    32
    All right..then does using qsort helps to optimize my codes to certain levels...??

    _____

  15. #15
    ---
    Join Date
    May 2004
    Posts
    1,379
    Nice link Salem. I can learn a few things here

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 09-05-2005, 08:57 AM
  2. Running program from windows program?
    By Brian in forum Windows Programming
    Replies: 3
    Last Post: 01-26-2002, 09:19 PM
  3. Running program on background?
    By Couhilin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2001, 06:50 AM
  4. Why is my program running away?
    By badkitty in forum C++ Programming
    Replies: 4
    Last Post: 09-19-2001, 04:27 PM
  5. Running program
    By muffin in forum C Programming
    Replies: 5
    Last Post: 08-30-2001, 10:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21