{"id":80911,"date":"2020-05-09T13:42:38","date_gmt":"2020-05-09T11:42:38","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview"},"modified":"2020-05-09T13:42:38","modified_gmt":"2020-05-09T11:42:38","slug":"pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview","title":{"rendered":"Why WSL 2 is 13 Times Faster than WSL: Insights from Insider Preview","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Microsoft is preparing to release the Windows May 2020 Update (20H1). This update will include several nice user interface improvements, but for developers and others in the know, what's more important is that the new version of Windows will introduce <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.microsoft.com\/ru-ru\/windows\/wsl\/wsl2-index\">WSL 2<\/a><\/noindex> (Windows Subsystem for Linux). This is relevant information for those who wanted to switch to the Windows OS but couldn't make the decision. <\/p>\n<p>Dave Rupert installed WSL 2 on his 13-inch Surface laptop, and the initial results <br \/>\nwere pleasantly surprising:<\/p>\n<p><img decoding=\"async\" alt=\"Why WSL 2 is 13 Times Faster than WSL: Insights from Insider Preview\" src=\"\/wp-content\/uploads\/2020\/05\/c7169f67b475a2311c101af1f4cfa372.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<p>The second version of WSL is 13 times faster than the first! It\u2019s not every day that you get a 13-fold performance boost for free. I felt a shiver and shed a bitter male tear when I first saw these results. Why? Well, mostly I was mourning the lost time accumulated over 5 years of working with the first version of WSL.<\/p>\n<p>And it's not just numbers. In WSL 2, installing npm, building, packaging, browsing files, hot module reloading, starting servers \u2014 almost everything I use daily as a web developer became significantly faster. It feels like sitting back at a Mac again (or maybe even better, as Apple has been radically throttling its processors in favor of increased battery life over the last few years).<\/p>\n<h2>What\u2019s behind this speed?<\/h2>\n<p>\nHow did they achieve a 13-fold performance increase? Earlier, when I considered transitioning to a Mac, I also threw out some ideas, purely on a speculative level. The issue was that disk writes and system calls in Linux were quite costly (in terms of time) due to the architecture of the first version of WSL. And now, guess what modern web development largely relies on? Yes. When you\u2019re piecing together a bunch of dependencies and code snippets with each file save, you\u2019re really performing a lot of disk writes and system calls for tens of thousands of files.<\/p>\n<p>Once you learn about this from your bitter experience, it\u2019s hard to forget. You gradually start to fall into despair when picturing how slowly and sadly everything works. And you realize that your world will never be the same, and the tool you once liked no longer seems useful and efficient.<\/p>\n<p>Fortunately, the WSL team took a risk and completely rewrote the subsystem. In WSL 2, these issues have been resolved: developers integrated a native Linux virtual machine into Windows and assigned file operations to a VHD (Virtual Hardware Disk). The compromise is that during the first launch, you need to spend some time spinning up the virtual machine. This time is measured in milliseconds and, personally, I barely notice it. For example, I wait with pleasure, knowing what it\u2019s all for.<\/p>\n<h2>Where will the files live now?<\/h2>\n<p>\nTo fully benefit from WSL 2, you will want to move your project files from <b>\/mnt\/c\/Users\/&lt;\u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&gt;\/<\/b> to the new home directory <b>~\\\/Linux<\/b> on the new VHD. You can see the contents of this disk in the network by going to <b>\\\\ wsl $ \\ &lt;distribution name&gt; \\ &lt;username&gt; \\ home<\/b> or by typing the command <b>explorer.exe<\/b> from your Bash shell.<\/p>\n<p>This is a real Linux file system, and it acts and behaves just as you would expect. I created a folder <b>~\\\/projects<\/b>, where all my project repositories reside, and then I open projects in Visual Studio Code using the command code.<\/p>\n<h2>What about VS Code?<\/h2>\n<p>\nInstalling WSL-<noindex><a rel=\"nofollow\" href=\"https:\/\/code.visualstudio.com\/docs\/remote\/wsl\">extension<\/a><\/noindex> for remote development in VS Code (VS Code Remote - WSL) is the final step that ensures a comfortable developer experience. The extension allows VS Code to perform all its operations (git commands, console, installation of extensions, etc.) directly interacting with the Linux virtual machine. This makes the whole process very autonomous.<\/p>\n<p>Initially, I was a bit frustrated by the need to install this extension because I had to reinstall what I had set up before. But now I appreciate it because there is a dedicated visualization layer that shows what environment I'm working in and where my files live. This has made the web development process on Windows more transparent and greatly simplified the user interface for version control in VS Code.<\/p>\n<h2>Tears of joy and hope for a bright future<\/h2>\n<p>\nI can't shake the feeling of joy thinking about the upcoming Windows May 2020 Update and the optimized Linux subsystem that just flies on my powerful gaming PC. There may still be some issues I am unaware of, but after <noindex><a rel=\"nofollow\" href=\"https:\/\/insider.windows.com\/ru-ru\/\">Insider Preview<\/a><\/noindex> I have concluded that the WSL team has resolved most issues.<\/p>\n<p>Moreover, it's worth remembering that <noindex><a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/en-us\/p\/windows-terminal-preview\/9n0dx20hk701\">Windows Terminal<\/a><\/noindex> it's great too! It's as if they heard my complaints about the lack of tabs, JSON Settings, and the need to 'feel cool' on Windows. It still sounds strange, but Windows Terminal is probably the best terminal for Windows.<\/p>\n<p>Having worked on Windows for 5 years, I've experienced a lot: the inability to install Rails, struggles with artificial shells like Cygwin. I was in the front row at that very Build 2016 conference when Microsoft announced the first version of WSL. That gave me hope that web development on Windows would finally reach a new level. Without a doubt, WSL 2 is the biggest improvement I've seen since then, and it seems we are on the brink of a new era.<\/p>\n<p><\/p>\n<h4>Advertising<\/h4>\n<p>\nIf you need <b>Windows servers<\/b>, then you definitely <noindex><a rel=\"nofollow\" href=\"https:\/\/vdsina.ru\/pricing?partner=habr10\">should come to us<\/a><\/noindex> \u2014 automatic installation of Windows Server 2012, 2016, or 2019 on plans with 2 GB RAM or more, the license is already included in the price. Starting at <b>21 rubles per day<\/b>! And we also have perpetual servers \ud83d\ude09<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/vdsina.ru\/eternal-server?partner=habr10\"><img decoding=\"async\" alt=\"Why WSL 2 is 13 Times Faster than WSL: Insights from Insider Preview\" src=\"\/wp-content\/uploads\/2020\/05\/38a3f41bf33fe29b511d8a2413e9bb88.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/vdsina\/blog\/500958\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>Microsoft \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0440\u0435\u043b\u0438\u0437 Windows May 2020 Update (20H1). \u042d\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0436\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Windows \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f WSL 2 (Windows Subsystem for Linux). \u042d\u0442\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u041e\u0421 Windows, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0448\u0430\u043b\u0441\u044f. Dave Rupert \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":80912,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-80911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"Microsoft \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0440\u0435\u043b\u0438\u0437 Windows May 2020 Update (20H1).\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041f\u043e\u0447\u0435\u043c\u0443 WSL 2 \u0432 13 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c WSL: \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f \u043e\u0442 Insider Preview | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"Microsoft \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0440\u0435\u043b\u0438\u0437 Windows May 2020 Update (20H1).\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-05-09T11:42:38+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-05-09T11:42:38+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Why WSL 2 is 13 times faster than WSL: impressions from Insider Preview | ProHoster","description":"Microsoft is preparing to release the Windows May 2020 Update (20H1).","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041f\u043e\u0447\u0435\u043c\u0443 WSL 2 \u0432 13 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c WSL: \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f \u043e\u0442 Insider Preview | ProHoster","og:description":"Microsoft \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0440\u0435\u043b\u0438\u0437 Windows May 2020 Update (20H1).","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/pochemu-wsl-2-v-13-raz-bystree-chem-wsl-vpechatleniya-ot-insider-preview","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-05-09T11:42:38+00:00","article:modified_time":"2020-05-09T11:42:38+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"80911","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 16:08:23","updated":"2022-09-28 05:59:54","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/80911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=80911"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/80911\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/80912"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=80911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=80911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=80911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}