Process Lasso will allow you to do this by setting a default priority class of 'Below Normal' or 'Idle' for cl.exe. After this, EVERY TIME cl.exe is launched its priority class will be 'Below Normal'. The same can be done for other external build tools of Visual Studio. However, the best thing about Process Lasso is that you don't have to even configure this default priority to have it help system responsiveness during builds. In fact, it can even do this same thing automatically without you having to configure it! This is its ProBalance function. When a background process executable exceeds a CPU usage threshold, it will be automatically and temporarily lowered in priority to prevent system responsiveness problems. The algorithm has been carefully tweaked over years to ensure it functions well in all environments. Since Process Lasso is written in native C++ with a stand-alone core engine that does the real work, its very light on its feet too.. It works wonders, it really does. Again, Process Lasso is NOT a simple task manager, it is utility to help automate and persist process priority and affinity adjustments, amongst another thing
ReplyThis awesome hack still works in the 2005 version by hex editing the VcBuildHelper.exe in the 'Microsoft Visual Studio 8\VC\vcpackages' folder. Even with today's multi-core machines it's a very relevant trick since parallel builds in Visual Studio very easily eats up all CPU resources. On a developer machine I would recommend using priority BelowNormal (68 00 42) so it's still above background resources such as a screen saver etc (in my case BOINC).
For anyone else who's searching, the 68 00 02 sequence to be changed appears two places in the file: at 0x17e8 and 0x4871. I changed this to 68 00 42 both places, and it seems to work fine.
ReplyOriginally posted by: Hamilton Gross
That was exactly what I was looking for...remarkable!
H
ReplyOriginally posted by: matthew
Im interested to know how you new this and if so could you please tell me.
Originally posted by: santosh thankachan
Some times we may need to compile and link the libraries at the top most priority , my requirements actually ;-)
Please let me know if we can change the base priority of the Vcspawn.exe to high as we change it to low.
Santosh Thankachan
...why on earth would someone run a batch job at high priority? To make the CPU run it faster? It won't. Or just to make interactive jobs run slower?
ReplyOf course this is possible, just use 0x80 instead of 0x40. You can find the relevant definitions in WinBase.h.
ReplyOriginally posted by: Ian
This same trick can be used in Embedded Visual Tools (v3 at least).
vcspawn.exe is located in "%EmbeddedToolsInstallDirectory%\Common\EVC\Bin", where the default for %EmbeddedToolsInstallDirectory% is usually "c:\Program Files\Embedded Visual Tools"
Again backup, then open vcspawn.exe in a suitable hex editor, and move to offset 0x1aba, where you will find a 00 byte. (Like the other environments, the bytes either side are 68 [00] 20 00 00)
Change this byte to 40, save and close.
ReplyOriginally posted by: Mark Webb
However, I think I have isolated the byte to change in the new version. Making the following change has not caused any disruption on my system, and I am getting the same benefits as the VC6 modification in this article.
- First open vcspawn.exe in a binary editor (make a backup first)
The memory should appear like this:
- Modify that byte to be 40, e.g.
After moving to VC7, I tried the same tip and VcSpawn.exe seems to have been modified and rebuilt.
- Then goto offset 0x0000114b
3C 00 00 00 [00] 02 00 00
3C 00 00 00 [40] 02 00 00
There are actually two instances of the CreateProcess call in vcspawn.exe (at least in VS 2003 SP1). You should probably patch both, or just set the IDE priority instead.
ReplySo, instead of
vcspawn_org.exe vcspawn.exe
401D3F: 68 00 02 00 00 push 200h 401D3F: 68 40 02 00 00 push 240h
401D44: 6A 01 push 1 401D44: 6A 01 push 1
E:\vs2003\Common7\Tools>fc vcspawn_org.exe vcspawn.exe
Comparing files vcspawn_org.exe and VCSPAWN.EXE
00001140: 00 40
it's better to be
vcspawn_org.exe vcspawn.exe
401D3F: 68 00 02 00 00 push 200h 401D3F: 68 00 42 00 00 push 4200h
401D44: 6A 01 push 1 401D44: 6A 01 push 1
E:\vs2003\Common7\Tools>fc vcspawn_org.exe vcspawn.exe
Comparing files vcspawn_org.exe and VCSPAWN.EXE
00001141: 42 02
Go catch. Monkey-see-monkey-do is a good excuse for the first go.
Did you really see 50/50 between the idle process and the compile
in practice, or is it based in theory?
=?Utf-8? [Thu, 17 Mar 2005 13:17:02 -0800]:
> This makes the compiler and linker run at BELOW_NORMAL, which is perfect for
>this type of task
Thread:
http://groups-beta.google.com/group/microsoft.public.vc.ide_general/browse_frm/thread/3e5f956875f44ef8/db7258b19f5faba6?tvc=1&q=Lower+compiler+and+linker+priority%3F+group:microsoft.public.vc.ide_general&hl=en
Reply
YH [Mon, 05 Jul 2004 02:03:36 GMT]:
>However, you may run it at your own risk since it is somewhat hacky
That depends on how you define hacky.
>as you said and there is no such setting in VS.NET yet.
I've been doing it for a while.
2003-03-19 05:15 17,408 vcspawn_org.exe
2004-01-23 19:51 17,408 vcspawn.exe
vcspawn_org.exe vcspawn.exe
401D3F: 68 00 02 00 00 push 200h 401D3F: 68 40 02 00 00 push 240h
401D44: 6A 01 push 1 401D44: 6A 01 push 1
E:\vs2003\Common7\Tools>fc vcspawn_org.exe vcspawn.exe
Comparing files vcspawn_org.exe and VCSPAWN.EXE
00001140: 00 40
--
40th Floor - Software @ http://40th.com/
iPlay : the ultimate audio player for iPAQs
mp3, ogg, mp4, m4a, aac, wav, and then some
Reply
Originally posted by: Petri Simolin
Works like a dream. I used to manually decrease the priority from the task manager.
Originally posted by: abderrahim gamh
it's a great work which you have made , i hope to see more
developpements in this field, as i hope to have the possibility to have some cours about visual basic studio 0.6
professionel.
thank you for giving us the occasion of giving our comments.
Originally posted by: erkin karincaoglu
I can not build a simple mfc project if I start msdev.exe from start menu.But if I just wrote "start msdev.exe" from command prompt there is no problem,I can build any project.Anyone can explain this?
Reply