-
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.
-
Can you post your code?
We can't really help if we don't know what you've done.
Similar Threads
-
By divagoddess in forum C++
Replies: 5
Last Post: 08-14-2009, 03:12 PM
-
By sedricbenson@ho in forum C++
Replies: 2
Last Post: 11-07-2006, 08:18 AM
-
By divagoddess in forum C++
Replies: 12
Last Post: 05-07-2006, 10:55 PM
-
By Gordon Reichhardt in forum VB Classic
Replies: 2
Last Post: 01-08-2002, 10:06 AM
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks