Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Difference between ramdisk and hard disk compilation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
alphaomega325
n00b
n00b


Joined: 02 Jan 2017
Posts: 42

PostPosted: Tue Aug 06, 2019 10:55 pm    Post subject: Difference between ramdisk and hard disk compilation Reply with quote

After seeing a post on compilation speed when it comes to ramdisk and standard hard disk I decided to make my own test. To that end I used the command time sudo emerge chromium, both the tmp file being on a hard disk and when on a tmpfs ramdisk. I found that when using modern hardware, having a ramdisk doesn't really change that much when it comes to compilation times. You can see the results before.
Code:

Without ramdisk: sudo emerge chromium  107611.12s user 4386.16s system 1097% cpu 2:50:05.91 total

With ramdisk: sudo emerge chromium  107604.42s user 4606.26s system 1121% cpu 2:46:41.09 total

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.1.21-gentoo] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Toshiba 2.5" HDD MK..59GSXP (AF)
Device Model:     TOSHIBA MK3259GSXP
Serial Number:    22N5C8C7T
LU WWN Device Id: 5 000039 3d350c188
Firmware Version: GN003J
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      2.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Tue Aug  6 17:49:23 2019 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)   Offline data collection activity
               was never started.
               Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)   The previous self-test routine completed
               without error or no self-test has ever
               been run.
Total time to complete Offline
data collection:       (  120) seconds.
Offline data collection
capabilities:           (0x5b) SMART execute Offline immediate.
               Auto Offline data collection on/off support.
               Suspend Offline collection upon new
               command.
               Offline surface scan supported.
               Self-test supported.
               No Conveyance Self-test supported.
               Selective Self-test supported.
SMART capabilities:            (0x0003)   Saves SMART data before entering
               power-saving mode.
               Supports SMART auto save timer.
Error logging capability:        (0x01)   Error logging supported.
               General Purpose Logging supported.
Short self-test routine
recommended polling time:     (   2) minutes.
Extended self-test routine
recommended polling time:     ( 103) minutes.
SCT capabilities:           (0x003d)   SCT Status supported.
               SCT Error Recovery Control supported.
               SCT Feature Control supported.
               SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   050    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       1206
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       4496
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   050    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   050    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0032   053   053   000    Old_age   Always       -       18863
 10 Spin_Retry_Count        0x0033   189   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       2776
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       107
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       103
193 Load_Cycle_Count        0x0032   008   008   000    Old_age   Always       -       923449
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       29 (Min/Max 14/44)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       67
222 Loaded_Hours            0x0032   077   077   000    Old_age   Always       -       9244
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
224 Load_Friction           0x0022   100   100   000    Old_age   Always       -       0
226 Load-in_Time            0x0026   100   100   000    Old_age   Always       -       349
240 Head_Flying_Hours       0x0001   100   100   001    Pre-fail  Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


As you can see, even with a much older 5400 rpm hard drive there isn't any time difference between a ramdisk compilation and a ramdiskless compilation.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Tue Aug 06, 2019 11:32 pm    Post subject: Reply with quote

linux file cache and it probably also depends on the filesystem used for the tmp and the number of jobs in MAKEOPTS="-j4"

typically emerge will extract a tar containing sources in a tmp dir and start compiling if there is enough memory in the systems the files will be still in the file cache in memory and will not be read from disk during compilation.

I emerged with /var/tmp on a iscsi disk over the network to save flash cycles on the eMMC andit wasn't teribly slower.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Wed Aug 07, 2019 8:08 pm    Post subject: Reply with quote

alphaomega325,

Like erm67 says, if you have the RAM to compile in tmpfs, there are little or no speed gains.
However, it does save writes that will never be read.

That's a very good thing if you worry about your SSD failing before you were going to replace it anyway.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum