Hacker News new | ask | show | jobs
by higherpurpose 3983 days ago
> I type some query in the Cortana search bar and press Enter, it launches Edge extremely fast.

Probably something to do with the fact that Edge/Cortana is already loaded at Windows start? So in a way it's a "trick" to starter "faster".

1 comments

Cortana is, but the Edge process is not that I can find. but that's only part of the story. If the libraries utilized by Edge are already loaded by other processes, they benefit from being in memory already.

Still, I notice Edge launches faster than Chrome even when I have a separate "Chrome App" open (e.g.: Hangouts). But you have to remember that Chrome essentially re-implements the ChromeOS on top of Windows. Much like how iTunes performance degraded as Apple ported more and more of OS X to Windows just to get it to run, I think Chrome suffers from the same bloat on Windows.

I wanted to check though. How much of Chrome is already loaded when Windows starts? How much of Edge?

I used VMMap from Sysinternals. "DLLs" includes every library plus the executable. Non-system DLLs excludes anything I found loaded by another process on the system, which included all the standard Windows libraries. Unique DLLs excludes anything loaded by any other process, so at a minimum it's the process itself (see: Chrome.exe).

Chrome.exe run as a child and a parent share a handful of code.

EdgeCP.exe is the child to Edge.exe, and it shares about the same amount of stuff. The EdgeCP process is lean for Windows, the executable is only 300K.

Here's what I found.

    Process                    	DLLs (#)	DLL Size (MiB)	Non-System DLLs (#)	Non-System DLL Size (MiB)	Unique DLLs (#)	Unique DLL Size (MiB)
    Chrome.exe                 	179     	159           	3                  	31.3                     	1              	30.4
    Chrome.exe (child)         	54      	90.6          	4                  	41.3                     	2              	40.3
    MicrosoftEdge.exe          	131     	170           	5                  	15.2                     	3              	9.8
    MicrosoftEdgeCP.exe (child)	98      	154           	3                  	1.9                      	1              	0.3
The upshot: both Chrome and Edge use a huge list of system libraries. Chrome's application code is larger, but it's probably not just the fact that Edge has an advantage with much more of its code already loaded into memory.

The simple answer is probably that Edge starts faster because it doesn't have to run on top of a ported layer of ChromeOS, which adds many layers of abstraction. The Edge process seems to be a very lightweight shim over a rendering engine that works pretty well. I don't know how they'll make that work with extensions or sandboxing, but the size of the executable code and the way it looks reminds me of Servo. (Minimal UI code, stays out of the way of renderer and JS processes.)

Finally, I checked to see if Cortana loads many of the same DLLs as Edge. Yes it does. I don't think that's an optimization though, I think that's because Cortana might be using a WebView to display results. (That would help in porting it to iOS and Android, of course.) I haven't disassembled it or inspected its XAML, but I think I'm done messing with Windows 10 for the day.

Note that Servo proper isn't supposed to _have_ a UI (well, a browser chrome). It's an engine, Servo maps better to Trident or Gecko (rather than Firefox/Chrome/Edge). There are some experimental UIs for Servo though (which are also minimalistic, but that's because there hasn't been much work there yet)
Oops! You're right. I was thinking of servo-shell and the few other wrappers. They're very, thin shims around the renderer.
From what I understand, Cortana is built using a combination of Web technologies including Node.js, which makes it easily portable to iOS and Android.