22 ms·
Kill dwm.exe on Windows for less input lag and better performance
- smileybarry 3y agoThis is really unnecessary and more placebo than helpful, not to mention old: > 2 years ago > It [sic] tested it on Windows 10 LTSB (1607) If you want to reduce input lag for exclusive fullscreen, turn off “fullscreen optimizations”. But that specific bug, introduced in build 1903, was fixed a few years ago. (But if you still somehow get it — you can just turn this off per-game instead of this wide hack!) Modern DXGI flip presentation model doesn’t add input lag anymore and properly detects when the exclusive fullscreen app is the only one showing, and gives it direct render control. (E.g. you can frame tear again!) I think some UIs will also just not work nowadays if you kill DWM, even more likely in Windows 11 since more UI got moved to WinUI.
- babypuncher 3y agoNot to mention most of these now fixed problems likely weren't even problems if you had a G-Sync/Freesync display and a compatible GPU. As an extra note, Windows 11 ships with a feature to force the DXGI flip presentation model in older games. "Gamers" can be like audiophiles in the way the spread half-truths and even outright misinformation. The number of people I still see thinking you should turn G-Sync off is downright silly.
- Hikikomori 3y agoSo much bad or useless optimization information out there. Unfortunately it's hard to test so everyone goes on what it feels like.
- TillE 3y agoTop-level speedrunners of action games are definitely able to feel input lag changes on the order of 10-20ms. For everyone else, you'd really want to prove it with a high-speed camera or something.
- eyegor 3y agoPlaying rhythm games, I can easily feel ~3ms of input lag. However it's pretty easy to adapt even to 100-200ms of lag, so I'd say most people are in the audiophile placebo territory. I can hit a 5-8ms window reliably even with a ton of lag if I spend 20 mins getting used to how it feels (running a game at 10fps under wine on a 10 year old chromebook with bad wireless gear). Network lag is far more significant than any input lag due to input processing or display pipelines.
- httpsterio 3y agoas long as the lag is consistent, then I can concur :) nothing is worse though than a rhythm game that can't keep proper rhythm itself.
- forrestthewoods 3y ago> Playing rhythm games, I can easily feel ~3ms of input lag. Hrmmm. I’m not sure this sentence even makes sense. I’m not sure what the definition of 0ms input lag even is. And I say this as someone who has deeply profiled true end-to-end input/output systems. 0ms relative to what exactly? If you spend 20 minutes getting used to something you could maybe tell the difference if 3ms of input lag was artificially injected. Maybe. But that’s an exceedingly small value and if I had a toggle switch that turned it on/off I’d bet against you being able to tell when it’s on. It does depend on the context. In a game like Guitar Hero 3ms is going to be exceedingly difficult to distinguish imho.
- Filligree 3y agoHumans are incredibly sensitive to audio rhythms/lag, and we’re talking about a rhythm game. Visual processing isn’t likely to notice, but this is probably between hearing/feeling the keystroke and hearing the reaction. 3ms is entirely believable; detection is based on a frequency domain transformation of the overlaid waveforms, not tuning as such. At the same time, sure, we easily compensate.
- 3y ago
- Dalewyn 3y ago>a G-Sync/Freesync display Going on sort of a tangent, but since it was mentioned: I hate variable refresh rate. I suppose my eyes are just sensitive to changes in rendering speed, because I tried it and I couldn't stand the variable ghosting. For me it's worse than screen tearing, which for me is perfectly resolved with vertical syncing or just capping the frame rate to something less than my monitor's refresh rate.
- helf 3y agoYou arent alone. I despise variable refresh. I cant even stand VFR videos on top of VRR displays. But my eyes are extremely sensitive to various things that almost everyone I know either cant perceive or have to focus really hard to notice. It can be a bit of a curse. LED headlights and taillights give me headaches. A lot of LED street lighting and business lighting hurts me. Etc. I used to be basically unable to stand a CRT under ~85hz. :(
- babypuncher 3y agoThat sounds like more of a problem with your display than with VRR itself. You could probably fix it by capping your game's framerate to whatever it can maintain consistently within your monitor's VRR window. This would give you a smooth consistent experience, without screen tearing or vsync-induced lag. Since it's not working in a fixed refresh rate container, you can do more unconventional numbers too. I like to run a lot of games at 90 FPS.
- deafpolygon 3y agoI do this and cap to 60 (my max refresh on my monitor).
- Dalewyn 3y agoYou're misunderstanding me. First off, I almost never get screen tearing. The only times I get screen tearing is if a program renders faster than my monitor can refresh, and my monitor (a Dell S2522HG) refreshes at 240Hz; screen tearing simply isn't happening. As for input lag, if there is any it's insignificant enough that I don't care. Second of all, my problem is with the the way variable refresh rate works and not with anything on the software side or the monitor itself. Variable refresh rate is exactly what it says on the tin, the refresh rate varies. My problem is because the refresh rate varies, the difference in refresh rate becomes very distracting. One moment my monitor is at 240Hz, the next at 135Hz, then 170Hz, then 70Hz, then 200Hz, and so on for an exaggerated example. Anything that's moving (eg: my mouse cursor) leaves more ghosts the lower the refresh rate becomes, and vice versa. This is very distracting because it's not consistent. Imagine you're listening to music, and the pitch goes up and down arbitrarily. You will probably agree that it's distracting, and that's basically what I find variable refresh rate to be. It is distracting to a fault, and I would rather deal with my monitor going at full speed and limiting my software as appropriate to prevent tearing for a consistent experience that isn't distracting.
- dblohm7 3y ago> "Gamers" can be like audiophiles in the way the spread half-truths and even outright misinformation If I had a dime for every time people were being told to manually manage their Windows page file "for performance"...
- nirav72 3y agoSomehow managing the page file and turning other services off in windows has turned into the Autoexec.bat and Config.sys of the modern age. Although, tweaking both autoexec.bat and config.sys was a worthwhile thing to do back in the day.
- babypuncher 3y agoEvery time a game comes out with performance issues caused by shader compilation or poorly optimized loading of assets, reddit threads and game forums are flooded with people claiming these nonsense fixes magically made their games perfectly smooth. It's asinine.
- Dalewyn 3y agoThere is, or at least was, tangible benefit if you understand how it works. A page file is, as it says, a file that's located in the root of whichever partitions that they are configured on. By default it's only configured on the C: partition and the size of the page file is variable, managed by Windows according to system demands. The page file is equivalent to a swap partition, for the Linux and BSD users out there. Manually configuring the page file has a number of benefits, if you know what you're after (and you're using HDDs): * You can specify a size, fixed or variable, for your page files. By default Windows allocates a fairly small page file, and if your page file use exceeds that allocation Windows has to allocate more space on the fly. This takes time, especially if the page file resides on a HDD. If you configure a fixed size, or a variable size with a large minimum size, you don't need to worry about that dynamic allocation which translates to more performance. Another benefit to a fixed page file is that you can have the page file occupy one continuous area on a HDD platter, for better access times and thus better performance; a dynamic allocation more often than not leads to a fragmented page file and thus worse performance. * You can specify which partitions you want to use for your swap space. It wasn't unusual to just dedicate a partition to a page file, effectively the same thing as a swap partition, especially if your C: partition wasn't that big. This is important for the next bullet point. * Back when we still ran our programs off of HDDs, making a partition earlier in the drive meant locating that partition on the outer areas of the platter. The outer areas of the platter travel faster than the inner areas, because physics, and faster platter speed means faster access times. By placing the page file on such a partition, the page file has better access times and thus you get better performance. A lot of these benefits have gone away thanks to RAM becoming both cheaper and more plentiful, and the storage medium where the page file resides changing from HDDs to SSDs in general. So most people usually don't need to mess with their page files anymore. But for people with specific needs or just a desire to really fine tune their systems, tweaking the page file by hand is still a worthwhile endeavour if you understand what you can get out of it.
- RajT88 3y ago> "Gamers" can be like audiophiles in the way the spread half-truths and even outright misinformation. It's about ethics in game journalism!
- badsectoracula 3y ago> Not to mention most of these now fixed problems likely weren't even problems if you had a G-Sync/Freesync display and a compatible GPU. I have a Freesync display and a compatible GPU and i can feel the difference between no vsync and freesync. There is a slight lag there, if you cannot feel it do not assume that others cannot too (some people even seem to not be able to feel a difference between having vsync on and off or having a compositor or not enable - nowadays really only possible on Linux but in the past you could also do it with WinVista/Win7 and in Win8 with hacks like the one linked - which is mind boggling to me). Of course the input lag depends on the game and how you play it. First person games with raw input, 1:1 mapping of the input (i.e. no filtering whatsoever) and little to no frame queuing (some engines run 1-2 frames "behind" the game state and if you add things like triple buffering you end up with extra lag) are the best to notice this whereas third person games played with a gamepad (where you have only indirect control of the camera - you control the camera's rotation speed, not the camera directly) are way harder to notice, as are games where you mainly use the mouse to click where to go (especially if the game uses a hardware cursor instead of rendering the cursor itself as part of the game UI). Also high refresh rate monitors make it slightly easier to overlook the lag (though it still is possible to tell - mine is a 165Hz monitor after all and i can still notice, it just doesn't annoy me as much as on a 60Hz monitor).
- babypuncher 3y agoOne of the big things to remember with VRR is that you will incur a latency penalty of a couple of frames if your game is running right at the maximum refresh rate of your display. This is why it is usually recommended to set a system wide framerate cap a few frames below the maximum supported value. For most modern gaming monitors, this isn't a huge deal. Cap your game at 140 FPS on a 144hz display and it will feel as snappy as it probably would have uncapped. Though if you have a lower end (or ultra high resolution) display that caps out at something much lower, like 60, then I can definitely see how leaving it uncapped with VRR disabled would feel a lot snappier. Early Freesync-branded displays could also be a bit of a crapshoot for a variety of reasons, but this has gotten much better in the last 5-6 years.
- 3y ago
- modeless 3y ago> DXGI flip presentation model doesn’t add input lag anymore This is only true in certain situations. For non-fullscreen windows it requires that your GPU driver support a feature called "Multiplane Overlay" which is not supported on Nvidia cards before RTX 20 series (probably not older AMD cards either though I'm not sure). A lot of people have disabled it because they've experienced bugs like flickering or stability issues. And a lot of random features will also disable it without notice, like monitor rotation or 10-bit color.
- flohofwoe 3y agoI even have weird (most likely) overlay-related issues on my RTX2070, like trying to scroll in Chrome with a YouTube video playing stutters like hell, and the video even occasionally blacking out, or when moving/sizing the browser window, it takes the video a noticeable amount of time to adjust. It's extremely annoying.
- smileybarry 3y agoThat’s an NVIDIA driver bug recently introduced, it’s super annoying. Videos increase the chance of that flicker appearing if you’re on YouTube in their “ambient light” mode thing, since it just blacks out the whole back canvas when it happens.
- ack_complete 3y agoI've also seen Intel GPUs that will only enable this with a single display. Turn on two displays and no windows will ever enter Independent Flip mode according to PresentMon.
- smileybarry 3y agoRight, but DXGI flip in windowed mode is a relatively recent addition and one that’s a net improvement. (Windowed always had an extra delay added due to composition)
- modeless 3y agoDXGI Flip is a decade old.
- pxc 3y agoOn the Windows machine I spent the past year using for work, I absolutely massive (many seconds, and I could induce it to as many seconds as desired, even for minutes) input lag when moving windows around that required me to kill DWM.exe every single day, sometimes multiple times a day. I didn't permanently kill it like in the article, though. Just killed the process and let it restart. I don't know for sure that dwm.exe itself was the cause. It could have been an issue with some of the endpoint management crap my employer forces on users, somehow, or maybe MS PowerToys (though I think I eventually ruled that out at some point). But killing dwm.exe fixes it.
- formerly_proven 3y agoOffice 2019 did this for me on my work laptop. Just grab any MS Office window with the mouse, describe a full circle or two, then sit back and watch as the laptop's CPU melts through the floor while the Office window slowly crawls over the screen for the next minute or two.
- pxc 3y agoThat's the one! The bug seems to be several years old now. I gotta say coming back to Windows for a while was a real shock for me. I can't believe how much basic stuff was more or less broken.
- smileybarry 3y agoIIRC that’s not composition’s fault but some application window delaying message posting with a poorly-done global hook. That’s also the cause for your mouse freezing for half a second then appearing where it should’ve been. Maybe DWM restarting also kills and reinitializes the window messages mechanism?
- sp0rk 3y ago> not to mention old >> 2 years ago How often do you expect a single purpose program that's less than 200 LoC needs to be updated?
- tomsmeding 3y agoOften, if its purpose is to work around a performance issue in a continually updated program (i.e. Windows, here).
- _cenw 3y agoWindows 10 1607 was released 7 years ago.
- mort96 3y agoThe program probably works exactly as it did back 2 years ago, that's not the point. It's the advice of killing dwm.exe to reduce input lag that might be outdated.
- flohofwoe 3y ago> Modern DXGI flip presentation model doesn’t add input lag anymore There's also this weirdness that DXGI always adds 3 frames of latency, because that's the default value unless explicitly changed by the application (https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgidevice1-setmaximumframelatency https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nf-...) - don't be confused by the "maximum" in the name, it's just consistently adding 3 frames of latency (at least on my Win10 machine). Don't know if this has changed in more recent DXGI versions, but if you want to be backward compatible as much as possible, those are not an option. The DXGI APIs are such a completely random collection of functionality that I really wonder if there's any forward thinking at all. If anything, at least the defaults are all wrong.
- novacrazy 3y agoNo, I still encounter massive lag spikes with dwm.exe after a few weeks of uptime, and restarting the process fixes it. However, I get lag in the Windows UI itself, not games. I think it has something to do with one of my monitors always disconnecting from the computer when it goes to sleep, so Windows acts like I'm constantly plugging and unplugging the monitor multiple times a day, for weeks. Leaks like 200-500MB+ each time, and dwm.exe is often using close to 3-4GB when I kill it.
- paule89 3y agofew weeks of uptime? If you are not running any servers on windows, that shouldn't be an issue. Just shutdown your pc like a normal person.
- novacrazy 3y agoI do run a few VMs and servers on it. Plus opening back up all my work after a restart is a pain.
- gsich 3y agoStandby/Hibernate counts to your uptime. It's a "normal" feature "normal" people use.
- moogly 3y agoPeople actually do this?
- gorlilla 3y agoUmmm, apparently 'normal' people do. I wouldn't know as I'm quitr abnormal myself.
- smileybarry 3y agoThat’s extremely odd, and you’re not on some older Windows 10 build or LTSC? I definitely have long uptime bugs on my work computer but they’re more to do with Explorer than DWM/UI.
- Cold_Miserable 3y agoTurning off "fullscreen optimizations" doesn't always work. It may not even be possible for DirectX 12. If you press Start and the taskbar appears, its not fullscreen. I wrote a simple Direct3D test program and entering fullscreen using alt-enter prevents start from appearing so DirectX 11.0 at least still supports fullscreen, for now.
- kakwa_ 3y agoSo, not killing dwm suckless? (sorry, dwm (X11) having served me well for years, I had to make that joke).
- asveikau 3y agoIn Windows 7, you could switch to classic mode, which kills dwm.exe, and in my experience seemed to mean a snappier, more responsive desktop. I thought they removed this ability in Windows 8.
- Koiwai 3y agoIt's actually the opposite, modern mode uses gpu for compositing, classic modes uses cpu, and any gpu would beat cpu handily in that task including integrated ones. Unless, you didn't install the correct driver and used standard vga driver, or like in a vm which doesn't provide gpu acceleration.
- incrudible 3y agoClassic mode does not use compositing at all, but the drawing routines of GDI etc were hardware accelerated already. Keeping a buffer around for every window for compositing could become a big performance problem and was part of the reason why Vista was considered slow. Mac OS X had this problem too.
- rootw0rm 3y agoI was curious myself, this link is a bit of an introduction to the mess: https://learn.microsoft.com/en-us/windows/win32/direct2d/comparing-direct2d-and-gdi https://learn.microsoft.com/en-us/windows/win32/direct2d/com... "GDI is hardware accelerated on Windows XP, and accelerated on Windows 7 when the Desktop Window Manager is running and a WDDM 1.1 driver is in use. Direct2D is hardware accelerated on almost any WDDM driver and whether or not DWM is in use. On Vista, GDI will always render on the CPU."
- kasabali 3y agoHere's a more honest and direct introduction than Microsoft itself could wrote: https://forums.cockos.com/showthread.php?t=55358 https://forums.cockos.com/showthread.php?t=55358 Especially follow the YouTube links demonstrating the problem: https://www.youtube.com/watch?v=ay-gqx18UTM https://www.youtube.com/watch?v=ay-gqx18UTM https://www.youtube.com/watch?v=ToFgYylqP_U https://www.youtube.com/watch?v=ToFgYylqP_U
- navjack27 3y ago[flagged]
- nyanpasu64 3y agoI tried the program on Windows 11 and just got a black screen.
- CppPro 3y agotry this: https://github.com/Ingan121/DWMKiller https://github.com/Ingan121/DWMKiller
- FirmwareBurner 3y agoThe article is about a 7 year old build of Windows 10. Windows 11 has made some improvements since then so using such apps could actually make it worse for you.
- CppPro 3y agoWhy exactly it may do worse?
- FirmwareBurner 3y agoBecause you're fucking with the OS in whys it's not designed to be fucked with anymore.
- uidops 3y ago[dead]
- andai 3y agoI have about a half second of lag every time I press alt-tab. Killing explorer.exe makes alt-tab instant.
- Semaphor 3y agoThat sounds like an issue with your system, alt-tab is instant for me even on the slow machine I’m on (16 GB RAM, Ryzen 5 PRO 3400GE).
- worez 3y agothat's considered a slow machine these days?
- Semaphor 3y agoCompared to my normal 64 GB Ryzen 3600 Desktop with a dedicated GPU, yeah ;) I do run MS SQL Server and several IntelliJ IDEs at once, so it feels slow.
- mdp2021 3y agoInteresting. On other systems, for lighter workflows, we can still stay on 4GB and processors part of almost 3 Watts hardware.
- rejectfinite 3y agoNot running Windows 10 or 11 I hope.
- jcelerier 3y agoThis is the most sold laptop on Amazon in France today: https://www.amazon.fr/Jumper-Ordinateur-Portable-1920x1080-Bluetooth4-2/dp/B0C8TMV1JQ/ref=zg_m_bs_g_429879031_sccl_1/261-0469820-5831134?psc=1 https://www.amazon.fr/Jumper-Ordinateur-Portable-1920x1080-B... 8gb of DD3 ram, 1.1ghz 4c/4t CPU from 2016. Many people who buy this will have it for at least five years. This is what the average computer experience looks like, just imagine how windows runs on this.
- issung 3y agoWould really appreciate an explanation in the README about how/why this works. WinAeroTweaker is a good example of a program that does things to your OS the OS probably doesn't want you to do, but has an explaination of how/why it works for every different option so you can feel slightly more comfortable.
- o1y32 3y agoI would add an "if" before "how" as well. I have not seen any evidence that this actually makes any difference or any noticeable difference.
- MrStonedOne 3y ago[dead]
- surlyville 3y agoTry CB Defense for 20 seconds of lag instead
- AnonHP 3y agoAlso (a little tongue in cheek) uninstall MS Teams. It doesn’t work well when there’s enough free memory and brings the system to a crawl if some other applications are using more RAM. Once you do that, get rid of Outlook.
- joshxyz 3y agoi use the browser version it is surprisingly better
- tgv 3y agoOne colleague uses Teams in the browser. We can only chat when he calls me. When I call him, it simply doesn't work. Is it a missing feature? Bug? Who can tell. I suppose those things, and the absence of features like avatars make the browser version leaner.
- atVelocet 3y agoHe needs to grant the page access to webcam and mic.
- hyperman1 3y agoWe got in a teams meeting with the school recently. Everyone had the same sound and could see the same slides, but the video went insane: windows teams users could see each other, linux teams users could see each other, and the chrome users could see each other(don't know if edge was mixed in this group). Each group could not receive video from the other 2 groups. I keep wondering what the hell goes on in Teams that it has these kind of bugs.
- vintagedave 3y agoIt’s lovely to see a short, simple WinAPI program written in C — often these days they use other frameworks. It’s old-school and bare metal. The source was simple enough: get debug privileges, kill and suspend some processes, resume and if still missing restart, but I was puzzled at this function: DWORD64 GetLPSTRHash(LPSTR s){ //more efficient string comparison DWORD64 h=0; BYTE c; while((c=*s++)) h=(h<<5)+h+c; return h; } This is used while iterating the list of running processes for string comparison. I wonder if others on HN can share any light, please? a) Why is an optimized string compare needed here? Even iterating a few hundred processes I would not have thought a simple (and likely already optimized) strcmp would be a hotspot b) Why does this work as a good hashing function? It seems very simple: to the existing value, add a bitshift of the existing value plus the character. Googling shows some people referring to it as the Wang hash, in the context of pseudorandom numbers on GPUs. The actual content I can find on Wang’s hashing shows much larger (and to me more expected) algorithms, eg http://burtleburtle.net/bob/hash/integer.html http://burtleburtle.net/bob/hash/integer.html
- orlp 3y agoI can't answer why the developer thought a faster hash was necessary. As to its quality as a hash function... It's pretty poor, and slow on modern systems. It's known as the djb2 hash. (h << 5) + h is a way of writing 33*h without needing multipliers. It fails pretty much every modern statistical test you can throw at it: https://gitlab.com/fwojcik/smhasher3/-/blob/main/results/perl-djb2.txt https://gitlab.com/fwojcik/smhasher3/-/blob/main/results/per... It's redeeming quality is that the code size is absolutely tiny, and that 33*h mod 2^64 is a reversible map, so if your input data is randomly distributed at least your output will be as well.
- vintagedave 3y agoThanks! Yeah, not being good was my expectation but I thought, if it was there, it had to have a good reason. I appreciate the input and confirmation, thankyou :) Random distribution of outputs does seem to minimise collisions on as a small an input set as a list of processes so I suppose the risk of killing the wrong process is minimal. I do think if I used the app I’d replace it though.
- londons_explore 3y agoWhat benefit is there to pausing winlogon? When in a game, it shouldn't be doing anything anyway right?
- sireat 3y agoI wonder what other tools are there to track Windows 10/11 performance and kill -unneeded services/ - I miss those lean Windows builds. Sometimes you get sluggish performance context switching app windows. Task Manager and Resource Monitor shows that everything looks okay - CPU - Memory - Disk - Network All running at less than 20% - yet computer feels sluggish switching apps. What is interesting is that two computers with seemingly similar hardware - same corporate issue manufacturer can have different performance. Surely there is something in SysInternals to help track down this issue.