4 ms·
I tested the performance of system calls on Windows 10 by repeatedly calling NtClose on an invalid handle. A system call took around 1200 CPU cycles.
by Dwedit 3y ago
I tested the performance of system calls on Windows 10 by repeatedly calling NtClose on an invalid handle. A system call took around 1200 CPU cycles.
- ComputerGuru 3y agoWhich timing mechanism did you use?
- Dwedit 3y agoThis was a while ago and I don't remember the exact details... I had two loops with a large number of operations. One called a trivial Win32 function (GetACP), the other made a System Call (NtClose) as well as the same trivial Win32 function. I used QueryPerformanceCounter to time the loops. From there, I estimated the number of machine cycles per iteration (using my clock speed of the time), and subtracted the "trivial" version which made no system calls.
- ComputerGuru 3y agoClever approach!
- Dwedit 3y agoPeeking at "ntoskrnl.exe" in Ghidra, it appears that "NtVdmControl" is a true "do-nothing" system call in Windows 10 x64, and Windows 11 removed the function entirely.