Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I boost NTVDM CPU usage past 50% to gain speed? 2

Status
Not open for further replies.

dbMark

Programmer
Apr 10, 2003
1,515
US
This question is for the opposite of what most users want. I've got some dBase 5 for DOS programs that need to run as fast as possible to get the job done in the least amount of time. The computer doesn't need to do much else meantime. I just checked how much CPU usage dBase 5 for DOS grabs in Cmd.exe (up to 50%) and the more limited but older Command.com (Idle sensitivity set to medium=50%; set to right, 20%) so neither one uses over half the CPU cycles according to SysInternals' Process Explorer. By the way, that's great freeware!

Is there a setting that allows a "DOS window" aka NTVDM grab more CPU cycles? I just wondered if I could shave 20-40% off the current time it takes to run these long processes...

(Yes I know that rewriting this code in newer 32-bit languages will speed it up enormously, several times faster, but conversion is proceeding in stages and this legacy code is still needed.)

dbMark
 
Hi,
Maybe buy some older PCs ( should be cheap) and run DOS on them...
Give one to those users who need to run these programs..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Start the appliation. Bring up Task Manager (Ctrl-Alot-Delete), and right click on the application, Set Priority, and increase the processor priority.
 
If you want windows to set high priority every time you start the app, you can right click on the program icon, and add /HIGH at the end of the "cmd line" field.
 
Thanks Bill, Duh! I should have thought of that myself, but I generally don't mess around with the Task Manager settings much so I didn't realize it was there. I can change it in Process Explorer too.

ilya56, I tried to add /HIGH or /high to the shortcut but it never changed the Priority level from Normal (8) to High (13). I also tried running it from the Start/Run line, but in every case it started in Normal priority on my XP Pro. How do you get it to work?

dbMark
 
Apparently I can't speed up this dBase 5 DOS application in XP Pro. From Process Explorer I raised the priority of NTVDM.EXE but no change, it still topped out at 50%, no higher. Since it was nested under CMD.EXE, I tried that one too. No change. Finally, I tried adjusting EXPLORER.EXE above it, but still no effect.

Oh well, I'm not supposed to run legacy DOS programs anyway.
 
If you have a HyperThreading processor, the display is simply wrong.

50% for NTVDM would be what is shown, but does not accurately reflect the behind the scenes actual processing.
 
I have a new 3.4 GHz P4. I timed a series of repeated creating tables, importing from TXT files, replacing records and indexing. I compared a series of them over an hour. Each table of about 600 total took the same 7 seconds before and after the priority changes. If there were any speed improvements, they were too small to notice or display a substantial improvement. Of course, there may have been other limiting factors such as the speed files could be sent from the 2-year-old server's SCSI drives over gigabit connections, etc.

Is it possible that "DOS" (or this DOS application) and hyperthreading don't work together to get any advantages?
 
Is it possible that "DOS" (or this DOS application) and hyperthreading don't work together to get any advantages?

Here is a more elaborate explanation of bcastner's very correct reply:

To fully understand hyperthreading (HT), please be aware that HT is "Multi-processor, el-cheapo". There is only 1 CPU-core that is executing the code, it was designed to report 2 virtual (= fake) processors to Windows (Win NT, Win2K pro, XP pro, Win2003) so Windows divides threads (tasks) among 2 processors. The quirck is that these 2 (fake) processors just get to run "1 at a time". This results in all performance tools, even knowing about HT, to report CPU utilisation of 50%, as it's fully consuming 1 of 2 possible threads, resulting in a (1 task / 2 processors) * 100% = 50% utilisation.

Actually it is running at max of that systems possible speed, so there isn't much to worry about, except the 50% report is off a 'bit'.

OTOH: I'm running Boinc (Seti@home etc.) having several tasks on a HT system, and it is constantly running 2 processes, as it gets 2 processors reported. It previously only ran 1 process on my previous P3 system. It doesn't get the work processed much faster than a non-HT system of the same speed, but HT-context switching is a bit quicker then Boinc's Windows Thread-swapping, so there is a small gain.

More detailed HT explanations & discussions can be found on google. This is an often debated issue.

HTH
TonHu
 
I also own an AMD Athlon 64 system, that doesn't have HT (or that fancy new feature 'dual-core') that correctly reports 100% utilisation for NTVDM when running similar a task as described above.

On a total different path:

Recompile the dBase 5 code using xHarbour (OpenSource, from and with commercial support at and see what speedgains can be had.
xHarbour is a 32-bit Clipper/xBase compatible compiler, and can be run on several platforms, ranging from MS-DOS, through Windows, Linux, 64 bit Linux, HP-UX to Apple OS-X, so I assume your platform is included.
Only 'problem' could be that the dBase code is not that xBase compatible, but those issues are at least solvable. A fine (free) news server is also available. (about 60-100 messages per day).

HTH
TonHu
 
TonHu,

Thank you for the explanation.

I noticed the results when I first installed an HT box, and used another Distributed Computer project Folding@Home dealing with genome folding.

I could assign two tasks by processor, but my better results were in standard use. Even though it was reporting a utilization of 50%, I was on average crunching away about 12% faster, all other factors being equal, prior to moving to an HT enabled processor.

Like you it seemed a curious result at first, but there is a ton of discussion to be found in Google.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top