This has always been on my mind while programming, so I thought I'd spit it out before it actually gets to me.
What should i be more worried about? The memory the application consumes, or the performance it takes. By this I mean should I be focused upon using less memory for of the application and using more performance (eg. loading via database, and dumping it after use), or using less performance and using more memory (eg. caching)
My conditions for the application: - It's a server application, so it's not meant to be ran on desktops, etc, I have 6GB of ram, and I have a quad-core.
Generally, the faster the RAM, the faster the processing speed. With faster RAM, you increase the speed at which memory transfers information to other components. Meaning, your fast processor now has an equally fast way of talking to the other components, making your computer much more efficient.
In a nutshell, installing more RAM may improve computer speed if you frequently use many programs or browsing tabs at once, or if you do memory-intensive tasks like gaming or Photoshop. Under regular use, however, a CPU upgrade will probably have a greater immediate effect on performance.
A more powerful processor will help with tasks such as streaming or running multiple programs. At the same time, large amounts of RAM will help with multitasking but will primarily improve performance in complex programs and operations.
The most important parameter characterizing the memory performance is the access time, that is, the time elapsed between a read request and the availability of the requested word. The cycle time is, instead, the minimum time between successive read requests; its inverse is the memory throughput.
Your question has drawn a lot of Zen Buddhism-like responses. I hope to do better.
Your memory limit is hard: If you exceed it, even if there's virtual memory, your app will crawl and you'll be the laughing stock of all.
Your CPU time is unlimited: Your app will take whatever time it needs; hopefully it will be sufficiently parallel that all 4 CPUs will be, for the most part, cooking with full steam until your app is finished.
Many Computer Science problems have a variety of solutions with various tradeoffs of memory against time. So: Be generous with memory until you use at least about half of it (if that helps; don't waste memory for the heck of it!) but stop while there's enough memory left that you don't need to worry about exceeding the limit, even in exceptional cases or accidentally.
Now that you've allocated your memory resources, you can try to tweak some more small performance gains out of your code. But don't bother overdoing it.
Done.
P.S. If it doesn't work correctly and reliably, all the preceding effort is worthless. Keep that in mind all the time!
Good luck.
Consider the amount of data you will be dealing with and the responsiveness you require. Put some thought into the design. Build it to be maintainable, and get it working.
Then profile, and address your actual bottlenecks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With