{"id":737,"date":"2015-07-21T11:25:30","date_gmt":"2015-07-21T17:25:30","guid":{"rendered":"http:\/\/islascruz.org\/blog\/?p=737"},"modified":"2015-07-21T11:25:30","modified_gmt":"2015-07-21T17:25:30","slug":"accelerate-your-macports-upgradeinstall-by-using-ramdisk","status":"publish","type":"post","link":"https:\/\/islascruz.org\/blog\/2015\/07\/21\/accelerate-your-macports-upgradeinstall-by-using-ramdisk\/","title":{"rendered":"Accelerate your macports upgrade\/install by using ramdisk"},"content":{"rendered":"<p><a href=\"http:\/\/islascruz.org\/blog\/wp-content\/uploads\/2015\/07\/Intel_Core_i7_high_speed.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-738 size-large\" src=\"http:\/\/islascruz.org\/blog\/wp-content\/uploads\/2015\/07\/Intel_Core_i7_high_speed-1024x640.jpg\" alt=\"Intel_Core_i7_high_speed\" width=\"800\" height=\"500\" srcset=\"https:\/\/islascruz.org\/blog\/wp-content\/uploads\/2015\/07\/Intel_Core_i7_high_speed-1024x640.jpg 1024w, https:\/\/islascruz.org\/blog\/wp-content\/uploads\/2015\/07\/Intel_Core_i7_high_speed-300x188.jpg 300w, https:\/\/islascruz.org\/blog\/wp-content\/uploads\/2015\/07\/Intel_Core_i7_high_speed.jpg 1680w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>The main problem when compiling is the tons of disk access that compile involves from compiling, linking, stripping etc&#8230; if you have a regular hard disk you know this may take a lot of time, most if the project is large. If you have an SSD the problem is not the speed, but still the lots of read\/write access even when SSDs are pretty much more reliable that they were years ago.<\/p>\n<p>A simple fix \u00a0is to use ram disk. I&#8217;m not going to tell you how to do it in linux, because in linux you basically mount tmpfs in a directory and you are done, but in OS X this may be a bit tricky. In particular if we talk about macports.<\/p>\n<p>Macports build directory is\u00a0\/opt\/local\/var\/macports\/build, so we need to mount a ramdisk here. But first we need to create it.<\/p>\n<pre>hdiutil attach -nomount ram:\/\/2097152\r\n\/dev\/disk10\r\n<\/pre>\n<p>That should create a ramdisk with about 1GB, if you want to use less or more ram you can of course tune the &#8220;ram&#8221; parameter to fit what&#8217;s best for you, it doesn&#8217;t means the size in bytes\/kbytes, it mean the number of 512 bytes sectors. Then format and mount in\u00a0\/opt\/local\/var\/macports\/build:<\/p>\n<pre>newfs_hfs \/dev\/disk10\r\nsudo mount -t hfs \/dev\/disk10 \/opt\/local\/var\/macports\/build\r\n<\/pre>\n<p>And you are done, just use macports as usual. Please note that there might be some ports that fails to build because some of them expect the build directory to be in the same\u00a0storage .<\/p>\n<p>After you are done compiling you probably want to delete that ramdisk, just use hdiutil detach $dev for that.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_737\" class=\"pvc_stats all  \" data-element-id=\"737\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/islascruz.org\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The main problem when compiling is the tons of disk access that compile involves from compiling, linking, stripping etc&#8230; if you have a regular hard disk you know this may take a lot of time, most if the project is large. If you have an SSD the problem is not the speed, but still the [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_737\" class=\"pvc_stats all  \" data-element-id=\"737\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/islascruz.org\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":738,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[151,152,7],"class_list":["post-737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-mac","tag-macports","tag-os-x"],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts\/737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/comments?post=737"}],"version-history":[{"count":2,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts\/737\/revisions"}],"predecessor-version":[{"id":740,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts\/737\/revisions\/740"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/media\/738"}],"wp:attachment":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/media?parent=737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/categories?post=737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/tags?post=737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}