{"id":230712,"date":"2024-02-26T08:19:56","date_gmt":"2024-02-26T16:19:56","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=230712"},"modified":"2024-02-26T15:22:35","modified_gmt":"2024-02-26T23:22:35","slug":"speed-up-your-java-development-on-windows-with-microsoft-dev-drive","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/speed-up-your-java-development-on-windows-with-microsoft-dev-drive\/","title":{"rendered":"Speed up your Java Development on Windows with Dev Drive"},"content":{"rendered":"<p>An overwhelming majority of Java developers work on Windows devices. Developers, IDE and cloud service providers are constantly looking for ways to enhance efficiency and reduce build times. Dev Drive is a tool specifically designed to optimize the development environment on Windows, including significant performance improvements for Java development.<\/p>\n<h5><strong>What is Dev Drive?<\/strong><\/h5>\n<p>Dev Drive is a novel storage solution, built upon <strong>Resilient File System<\/strong> (ReFS).\u00a0 ReFS is a Microsoft file system format designed to maximize data availability, scale efficiently to large data sets across diverse workloads, and provide data integrity.\u00a0 It&#8217;s engineered to optimize file system performance, providing Java developers with increased control over storage volume settings and security. You can read more about ReFs here: <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-server\/storage\/refs\/refs-overview\">Resilient File System (ReFS) overview | Microsoft Learn<\/a><\/p>\n<h5><strong>Benefits of Using Dev Drive for Java Development<\/strong><\/h5>\n<p>Dev Drive has been rigorously tested by Microsoft\u2019s internal teams, yielding impressive results. It has demonstrated up to 14%-28% faster full builds, numbers that are hard to ignore for any Java developer looking to speed up their workflow\u200b\u200b.<\/p>\n<p>Additionally, Microsoft has continued to invest in Dev Drive, and now has a preview of Block Cloning (aka Copy-On-Write) built into the Windows copy engine. This feature results in near instantaneous copies for very large files on a Dev Drive. The Copy-on-write (CoW) feature significantly reduces disk space usage and speeds up file writing processes, a critical aspect in large-scale Java projects\u200b\u200b\u200b\u200b.<\/p>\n<h5><strong>Setting up Dev Drive<\/strong><\/h5>\n<p>Setting up Dev Drive is straightforward. It involves navigating through the Windows Settings to the Disks &amp; Volumes section and creating a new Dev Drive, after ensuring that your system meets the necessary prerequisites. For those preferring a more hands-on approach, Dev Drive can also be configured via command line, offering flexibility for different user preferences\u200b\u200b\u200b\u200b.\u00a0 Check out the overview of how to <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/dev-drive\/\">Set up a Dev Drive on Windows 11 on Microsoft Learn<\/a>, which provides an introduction to Dev Drive and Copy-on-Write for Developer Performance, including details on Maven and Gradle setup.<\/p>\n<h5><strong>Dev Drive Features in the<\/strong> <strong>Dev Home machine configuration tool<\/strong><\/h5>\n<p>The Dev Home machine configuration tool is a notable feature that simplifies setting up your development environment. It allows for streamlined installation of applications, cloning of repositories, and addition of a Dev Drive to your system, making the process less tedious and more efficient\u200b\u200b. \u00a0\u00a0Here are more details on using Dev Home, including cloning a GitHub repo and storing it on a Dev Drive: <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/dev-home\/setup\">Set up your Windows development environment with Dev Home | Microsoft Learn<\/a><\/p>\n<h5><strong>Example \u2013 Building the Spring Pet Clinic with Maven<\/strong><\/h5>\n<p>Here\u2019s an example using the <a href=\"https:\/\/github.com\/spring-projects\/spring-petclinic\">Spring Pet Clinic sample application<\/a> to test build times.\u00a0 I forked and cloned the repo locally, then ran the mvnw package command to build the sample application. The time for the initial build using Maven is almost 7 minutes, but this is not a perfect baseline, because retrieving the dependencies depends on bandwith, and is subject to network latency.\u00a0 A second run of the mvnw package command builds with without downloading the dependencies, and takes just over 2 minutes and is better for comparing Dev Drive performance:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-1a-Dev-Drive-Maven-Build.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230725\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-1a-Dev-Drive-Maven-Build.png\" alt=\"Image Fig 1a 8211 Dev Drive Maven Build\" width=\"624\" height=\"335\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-1a-Dev-Drive-Maven-Build.png 624w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-1a-Dev-Drive-Maven-Build-300x161.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Once I had the initial baseline, I set up my dev drive, and named it <code>briansdevdrive<\/code>:<\/p>\n<p><figure id=\"attachment_230727\" aria-labelledby=\"figcaption_attachment_230727\" class=\"wp-caption alignnone\" ><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-2-Dev-Drive-Setup-1.png\"><img decoding=\"async\" class=\"size-full wp-image-230727\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-2-Dev-Drive-Setup-1.png\" alt=\"Image Fig 2 8211 Dev Drive Setup\" width=\"496\" height=\"413\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-2-Dev-Drive-Setup-1.png 496w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-2-Dev-Drive-Setup-1-300x250.png 300w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/a><figcaption id=\"figcaption_attachment_230727\" class=\"wp-caption-text\">Fig 2 &#8211; Dev Drive Setup<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<p>Next I create a new Maven cache directory in <code>briansdevdrive<\/code> called maven and set the global environment variable <code>MAVEN_OPTS<\/code> to add a configuration setting to that path.\u00a0 In this case, the value is:<\/p>\n<p style=\"padding-left: 40px;\"><code>setx \/M MAVEN_OPTS -Dmaven.repo.local=D:\\briansdevdrive\\maven<\/code><\/p>\n<p>This returns a message:<\/p>\n<p style=\"padding-left: 40px;\"><code>SUCCESS: Specified value was saved.\u00a0<\/code><\/p>\n<p><div class=\"alert alert-success\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Lightbulb\"><\/i><strong>TIP: If you get this message:<\/strong><\/p>\n<code>ERROR: Access to the registry path is denied.<\/code><\/p>\n<p>Open the command prompt and\/or terminal as administrator before running the command:<\/p>\n<p><figure id=\"attachment_230718\" aria-labelledby=\"figcaption_attachment_230718\" class=\"wp-caption alignnone\" ><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-3-Run-as-Administrator-Menu-Option.png\"><img decoding=\"async\" class=\"size-medium wp-image-230718\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-3-Run-as-Administrator-Menu-Option-300x166.png\" alt=\"Image Fig 3 8211 Run as Administrator Menu Option\" width=\"300\" height=\"166\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-3-Run-as-Administrator-Menu-Option-300x166.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-3-Run-as-Administrator-Menu-Option.png 574w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"figcaption_attachment_230718\" class=\"wp-caption-text\"><span style=\"font-size: 10pt;\"><em>Fig 3 &#8211; Run as Administrator Menu Option<\/em><\/span><\/figcaption><\/figure><\/p>\n<p><\/div><\/p>\n<p>Next, I cloned a second local repo and ran the same commands.\u00a0 The time for the build is now 45 seconds, less than half the build time without the Dev drive!<\/p>\n<p><figure id=\"attachment_230728\" aria-labelledby=\"figcaption_attachment_230728\" class=\"wp-caption alignnone\" ><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-4-Dev-Drive-Maven-Build-results.png\"><img decoding=\"async\" class=\"size-full wp-image-230728\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-4-Dev-Drive-Maven-Build-results.png\" alt=\"Image Fig 4 8211 Dev Drive Maven Build results\" width=\"639\" height=\"292\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-4-Dev-Drive-Maven-Build-results.png 639w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/02\/Fig-4-Dev-Drive-Maven-Build-results-300x137.png 300w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/a><figcaption id=\"figcaption_attachment_230728\" class=\"wp-caption-text\">Fig 4 &#8211; Dev Drive Maven Build results<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<p>Results may vary based on several hardware and software factors, but in an iterative environment, and\/or a much larger project with a longer build time with either Maven or Gradle, you can see every tangible benefits using a Dev Drive.<\/p>\n<h5><strong>Conclusion:<\/strong><\/h5>\n<p>Dev Drive presents a significant leap forward in optimizing Java development on Windows. Its integration of cutting-edge file system technologies and developer-centric features makes it an indispensable tool for modern Java developers. Looking ahead, Dev Drive\u2019s integration into Windows Server, Microsoft <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/dev-box\/\">Dev Box<\/a>, and its anticipated role in <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/devops\/pipelines\/\">Azure Pipelines<\/a> and <a href=\"https:\/\/docs.github.com\/en\/actions\">GitHub Actions<\/a> promise a more efficient development ecosystem for Java and other languages\u200b\u200b\u200b\u200b. We invite you to explore its capabilities and share your experiences to help us build a community of efficient and empowered developers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An overwhelming majority of Java developers work on Windows devices. Developers, IDE and cloud service providers are constantly looking for ways to enhance efficiency and reduce build times. Dev Drive is a tool specifically designed to optimize the development environment on Windows, including significant performance improvements for Java development. What is Dev Drive? Dev Drive [&hellip;]<\/p>\n","protected":false},"author":110052,"featured_media":230727,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-230712","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"acf":[],"blog_post_summary":"<p>An overwhelming majority of Java developers work on Windows devices. Developers, IDE and cloud service providers are constantly looking for ways to enhance efficiency and reduce build times. Dev Drive is a tool specifically designed to optimize the development environment on Windows, including significant performance improvements for Java development. What is Dev Drive? Dev Drive [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/110052"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=230712"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230712\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/230727"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=230712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=230712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=230712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}