Sujet : Re: xxd -i vs DIY Was: C23 thoughts and opinions
De : nospam (at) *nospam* needed.invalid (Paul)
Groupes : comp.lang.cDate : 03. Jun 2024, 19:41:43
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3l2p9$oo3$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Ratcatcher/2.0.0.25 (Windows/20130802)
On 6/3/2024 4:02 AM, Michael S wrote:
On Mon, 3 Jun 2024 03:15:27 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Thu, 30 May 2024 00:40:07 -0400, Paul wrote:
>
WSL uses containers, so of course it is slow.
>
WSL1 had a Linux “personality” on top of the NT kernel. So this was
emulation, not containers.
>
WSL2 uses Hyper-V to run Linux inside a VM. Again, not containers.
>
Linux has containers, which are based entirely on namespace isolation
(and cgroups for process management). These are all standard kernel
mechanisms, so there should be very little overhead in using them.
The word "container" has many meanings.
As far as host FS is concerned, guest FS is a one huge file. Despite
very different tech under the hood it equally applies both to WSL and
to WSL-2. Calling this file 'container' sounds like proper use of the
term.
I finally found a slightly older Win10 setup on an SSD.
It has WSL1.
It's uncontained. I put Ubuntu 18.04 in WSL1, because it had
no distro. This is an example of a file in the slash tree, in /usr/lib .
Permissions are restricted in the tree, and Everything.exe search
tool, I think it failed to index this tree of files.
C:\Users\Bullwinkle\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04LTS_79rhkp1fndgsc\
LocalState\rootfs\usr\lib\x86_64-linux-gnu\perl5\5.26\vars.pm
A process called "init" can be seen running in Task Manager.
This is a test of the / tree for speed.
bullwinkle@DRAX:/$ dd if=testfile.bin of=/dev/null bs=1048576
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.06495 s, 520 MB/s
bullwinkle@DRAX:/$ ls -al testfile.bin
-rw-rw-rw- 1 root root 1073741824 Jun 3 13:57 testfile.bin
bullwinkle@DRAX:/$
The /mnt/c speed is next. I didn't bother shutting off Windows Defender for this.
It's close enough to device speed (SATA SSD), it's basically the same speed
as the other test.
bullwinkle@DRAX:/mnt/c/users/bullwinkle/Downloads$ dd if=WIN10-WADK.7z of=/dev/null bs=1048576
3453+1 records in
3453+1 records out
3621128316 bytes (3.6 GB, 3.4 GiB) copied, 7.41205 s, 489 MB/s
bullwinkle@DRAX:/mnt/c/users/bullwinkle/Downloads$ ls -al WIN10-WADK.7z
-rwxrwxrwx 1 bullwinkle bullwinkle 3621128316 May 10 2021 WIN10-WADK.7z
[Picture]
https://i.postimg.cc/Y2RQd3LM/wsl1-with-ubuntu-1804-and-XMing.gif*******
WSL2 on the machine I'm typing on, uses "ext4.vhdx" currently (6,698,303,488 bytes).
And that is a container. Instead of "init", "vmmemWSL" can be seen running. It
does not use third-party XMing Xserver, and uses WSLg instead for graphics. Either
of the two setups can run Firefox browser.
Paul