DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Feb 2007

    help, dont know why program is too slow

    Okay, so I wrote my own program. ITs basically an algorithm that takes in input, does a bunch of mathematical calculations, and returns an output.

    Although, it takes my computer 10 minutes to calculate the solution! I dont understand why it is taking that long to do the calculations. I know it has nothing to do with my computer being slow. For example, Ive run a java chess playing program on my computer, which too implements a mathematical algorithm (if you know about computer chess) that calculates the best chess move. And the chess program (not writen by me) finishes the calculations fast. For 6 plies, it calculates the best chess move in 30 second stops.

    The complexity of my program's algorithm is comparable to that of a computer chess program. Yet the chess program can get its solution in 30 seconds, and mine takes 10 minutes!! So Im thinking its not that my algorithm is a very long one, but rather Im doing something wrong in wiriting my code or something.

    Again, I have no clue why my program is taking so long. Its not porforming rediculously long calculations (the algorithms calculations are comparable to that of a computer chess programs). Do you have to write your code a certain way to make it run faster? Am I supposed to thread my program (I dont use threading in my program)? how would using threads speed this up?
    is there something Im missing?

    please help.

  2. #2
    Join Date
    Jul 2005
    Can you post your code?

    We can't really help if we don't know what you've done.

Similar Threads

  1. soft drink Vending machine program
    By divagoddess in forum C++
    Replies: 5
    Last Post: 08-14-2009, 03:12 PM
  2. Help with Server program
    By sedricbenson@ho in forum C++
    Replies: 2
    Last Post: 11-07-2006, 08:18 AM
  3. Prime number program to make go faster
    By divagoddess in forum C++
    Replies: 12
    Last Post: 05-07-2006, 10:55 PM
  4. Please help with running executable vb program.
    By Gordon Reichhardt in forum VB Classic
    Replies: 2
    Last Post: 01-08-2002, 10:06 AM
  5. How can I build copy protection into my program
    By W.Pierce in forum VB Classic
    Replies: 1
    Last Post: 12-11-2001, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.