(Source)
There is a known issue here that we're planning to address for Rocket but haven't gotten to it yet. Basically, UE4 is designed for HUGE games that have hundreds of source files, so the out-of-the-box settings are configured to get the best possible full recompile times with huge game code bases.
What's happening with your one-file change is that Unreal Build Tool is globbing together that source file into a combined file with the other code files in your module, and also not bothering to generate (and cache!) a precompiled header for your game source since they all fit within a single combined source file.
As a workaround, to get the faster iterative times with small changes, please try the adding the following lines inside your game module's Build.cs (MyGame.Build.cs):
MinFilesUsingPrecompiledHeaderOverride = 1;
bFasterWithoutUnity = true;
This will turn off combining of source files, and also tells Unreal Build Tool to always create a precompiled header, which will yield very fast iteration times.