Need some power for a computation

Hello, I am working on a program and its complete. However, it takes hours to calculate the results. I have 4gb ram and i3 processor. How can I get more power? thanks.
First determine your bottle neck, a code profiling software like Valgrind would help if you're good at that type of thing. Otherwise use something like perfmon if you're on Windows.

EDIT: I should clarify, it's useless for me to recommend that you buy more 'A' if it turns out that that your 'B' is inadequate for the task. So finding out what is causing the slow performance is step 1.
Last edited on
Are you able to split the calculation into separate parts and do those parts on separate threads and then combine the results? That will probably speed it up somewhat.
@Computergeek01,
I couldn't understand what should I do with PerfMon, can you explain it please?

@ajh32,
unfortunately, I can't split the things up
Last edited on
As others have hinted at, your question is kind of vague and hard to give a solid answer to other then recommending some common things. Without knowing more about your program itself it would be hard to offer any solutions as to how to speed up the results.

Though the two posts above give some good starting points. Using a profiling software will tell you exactly where the bottleneck (Slowdown) in your code is happening which you can then use to come up with a solution to fix that bottleneck. Though learning to use a profiling tool isn't just a 5 minute process it, it will take time to learn and get good at using one. But trust me it will save your hours and hours of headaches in the future and is a very valuable skill to know.

That solution might be offloading work onto different worker threads, though personally I would recommend you stay away from threading your program unless you know for sure that threading would be well suited for the task and that benefits would outweigh the negatives (Nasty unseen bugs, much harder to maintain your codebase, etc. etc.).

There are way to many possible solutions to increase the speed of a program to list without knowing exactly what the program is doing. So if you could give us a brief description of you software (What is it doing, what type of data it is processing, etc.) we could probably give you more direct solution(s).

But until then the best thing that can be suggested is to run a profiling software on your program and see what is making it so slow and go from there.

Hopefully this helps a bit, would be glad to help more after I know some more about your program.
Last edited on
If you're on Windows then perfmon is a tool that gathers and displays performance counters from your system. So to start it you go to run and type "perfmon" or you go to Control Panel -> Administrative Tools -> Perfmon Performance Monitor. Then under 'Monitoring Tools' select the 'Performance Monitor'. Click the green plus sign near the top to bring up the list of performance counters on your system. Expand the 'Process' section and find your process while it is running in memory then attach the counters for the attributes you want to monitor. The 'Show Description' check box near the bottom will help you decide which ones to use but if after looking at them you are still unsure then start with 'IO Data Bytes/sec', 'Page Faults/sec' and '% Processor Time'. If your University has a help desk then they could help you with this part too.
Last edited on
Topic archived. No new replies allowed.