<p>I'm trying to optimize several bottlenecks on an application which is supposed to run on a really wide range of CPUs and architectures (some of them very close to embeded devices).</p>

<p>The results of my profiler, however, aren't really significant because of the speed of my CPU. Is there any way (preferably under Windows or Mac OS X) to limit the speed of my CPU for profiling purposes?</p>

<p>I've thought about using a virtual machine, but haven't found any with such functionality.</p>

[{'answer_id': 54813, 'author': 'Adam Lerman', 'author_id': 673, 'author_profile': 'https://Stackoverflow.com/users/673', 'pm_score': 0, 'selected': False, 'text': '<p>There was an app on Downloadsquad.com recently. I dont remember the name of it but it did some fun stiff woth processors and task manager. It may have only been to manage what apps are on what cpu but maybe it would give you this. I will try to look for it this afternoon, and respond back if I find it.</p>\n'}, {'answer_id': 55807, 'author': 'Tony BenBrahim', 'author_id': 80075, 'author_profile': 'https://Stackoverflow.com/users/80075', 'pm_score': 2, 'selected': False, 'text': '<p>This works well and supports multicore.  <a href="http://www.cpukiller.com/" rel="nofollow noreferrer">http://www.cpukiller.com/</a></p>\n'}, {'answer_id': 59046, 'author': 'Greg Rogers', 'author_id': 5963, 'author_profile': 'https://Stackoverflow.com/users/5963', 'pm_score': 0, 'selected': False, 'text': '<p>Many profilers (for example oprofile - but thats linux only) let you set the frequency that they collect data. See if your profiler supports this, and if not try a different one that does.</p>\n'}, {'answer_id': 59074, 'author': 'infinitetape', 'author_id': 4601, 'author_profile': 'https://Stackoverflow.com/users/4601', 'pm_score': 1, 'selected': False, 'text': "<p>I'm afraid I don't know any answer other than to start looking around in your area for old hardware. The CPU isn't the only variable that can (usually) affect things. L1/L2 cache size, memory bus speed, memory speed/latency, hard drive speed, etc. are all significant factors in many applications.</p>\n"}, {'answer_id': 1094862, 'author': 'Mike Dunlavey', 'author_id': 23771, 'author_profile': 'https://Stackoverflow.com/users/23771', 'pm_score': 2, 'selected': False, 'text': '<p>It\'s a common misconception that you need to know how fast your code is to know where your performance problems are. That confuses problem-finding with problem-measurement.</p>\n\n<p><a href="https://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux/378024#378024">This is the method I use.</a></p>\n\n<p>If there is some wasteful logic in the program, it will be wasteful no matter what CPU runs it.</p>\n\n<p>What you need to know is where it is. For measurement, you don\'t need to know how big it is; you only need to know that it is big enough to need to be fixed.</p>\n\n<p>Usually there are a number of problems, of different sizes. You will probably find the biggest ones first, but no matter what order you fix them in, each one you fix will make it easier to find the remaining ones, because they will take a larger percentage.</p>\n'}, {'answer_id': 4314451, 'author': 'sleske', 'author_id': 43681, 'author_profile': 'https://Stackoverflow.com/users/43681', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>I\'ve thought about using a virtual\n  machine, but haven\'t found any with\n  such functionality.</p>\n</blockquote>\n\n<p>Why do you need a VM that explicitly offers that functionality? Just limit the CPU usage of the VM in the host OS (where it is just a regular process). That should have exactly the same effect.</p>\n\n<p>You can do this e.g. using <a href="http://cpulimit.sourceforge.net/" rel="nofollow">cpulimit</a> on Linux; similar solutions exist for MS Windows.</p>\n'}]
['https://Stackoverflow.com/questions/54795', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4381/']