RAM驱动器进行编译 - 是否有这样的事情? [英] RAM drive for compiling - is there such a thing?

查看:171
本文介绍了RAM驱动器进行编译 - 是否有这样的事情?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

答案 < s> (见下文)到这里的一个问题Stack Overflow给了我一个想法,一个伟大的小软件,可以是无处不在的编码器。



我想象的RAM驱动器软件,但有一个关键的区别 - 它会镜像一个真正的文件夹在我的硬盘驱动器。更具体地说 - 包含我目前工作的项目的文件夹。这样任何构建将是几乎瞬时的(或至少几个数量级更快)。 RAM驱动器将使用闲置的资源在后台将其内容与硬盘驱动器同步。



一个快速的Google搜索没有发现任何东西,但也许我不知道如何去谷歌。也许有人知道这样的软件?



已添加:我们已经提出了一些解决方案,我在开始时就抛弃了这些解决方案。 购买更快的硬盘驱动器( SSD 或者10K RPM)。我不想要硬件解决方案。不仅软件有可能更便宜(免费软件,任何人吗?),但它也可以用于硬件修改不受欢迎,如果不是不可能的环境,例如在办公室。

  • 让OS / HDD进行缓存 - 它知道更好地使用您的空闲RAM。 OS / HDD有通用的缓存算法,缓存一切,并尝试预测未来最需要哪些数据。他们不知道我的优先级是我的项目文件夹。而且我们都知道很好 - 他们不真正缓存它。 ;)

  • 有大量的RAM驱动器;使用其中的一个。对不起,这将是鲁莽。我需要我的数据被同步回到硬盘每当有一点空闲时间。



  • b>添加了2:一个想法 - 使用一个正常的RAM驱动器加上一个后台文件夹同步器(但我的意思是背景)。有什么事吗?



    添加了3:有趣。我刚刚在工作中试用了一个简单的RAM驱动器。重建时间从〜14秒减少到7秒(不坏),但增量构建仍然在〜5秒,就像在硬盘上。任何想法为什么?它使用 aspnet_compiler aspnet_merge



    添加了4:哦,好的新的答案! :)好的,我有更多的信息,为所有你的naysayers。 :)



    这个想法的主要原因之一不是上述软件(14秒构建时间),而是另一个我没有访问权限的软件当时。此其他应用程序具有100 MB的代码库,其完整构建大约需要5分钟。是的,它在 Delphi 5 中,因此编译器不是太先进。 :)把源放在RAM驱动器上产生了巨大的差异。我下了一分钟,我想。我没有测量。



    相关问题:

    对于所有那些说操作系统可以缓存更好的东西,


    RAM磁盘以加快IDE


    第一个链接上的注意事项:
    其链接已被删除,因为它是一个重复。它询问:


    在编译代码时,你做了什么?


    我链接的 Dmitri Nesteruk 的答案是:


    我几乎立即编译。部分是因为我的项目很小,部分是由于使用了RAM磁盘。



    解决方案

    在Linux中(你从来没有提到你在使用哪个操作系统,所以这个可以是相关的),你可以从RAM创建块设备,并像任何其他块设备(即HDD)一样安装。 / p>

    然后,您可以创建在启动/关闭时以及定期复制到该驱动器的脚本。



    例如,您可以将其设置为〜/ code 〜/ code-real 。你的RAM块在启动时被安装在〜/ code ,然后从〜/ code-real 在您的标准硬盘驱动器)被复制。关闭时,所有内容都将从<$ c $中复制( rsync 更快) c>〜/ code 到〜/ code-real 。你也可能希望该脚本定期运行,所以你没有失去很多工作,在电源故障等情况下。



    我不这样做(我使用它 Opera 当9.5测试版缓慢,没有必要)



    这里是如何在Linux中创建RAM磁盘。


    An answer (see below) to one of the questions right here on Stack Overflow gave me an idea for a great little piece of software that could be invaluable to coders everywhere.

    I'm imagining RAM drive software, but with one crucial difference - it would mirror a real folder on my hard drive. More specifically - the folder which contains the project I'm currently working on. This way any builds would be nearly instantaneous (or at least a couple orders of magnitude faster). The RAM drive would synchronize its contents with the hard disk drive in background using only idle resources.

    A quick Google search revealed nothing, but perhaps I just don't know how to Google. Perhaps someone knows of such a software? Preferably free, but reasonable fees might be OK too.

    Added: Some solutions have been suggested which I discarded in the very beginning. They would be (in no particular order):

    • Buy a faster hard disk drive (SSD maybe or 10K RPM). I don't want a hardware solution. Not only software has the potential to be cheaper (freeware, anyone?), but it can also be used in environments where hardware modifications would be unwelcome if not impossible - say, at the office.
    • Let OS/HDD do the caching - it knows better how to use your free RAM. The OS/HDD have generic cache algorithms that cache everything and try to predict which data will be most needed in the future. They have no idea that for me the priority is my project folder. And as we all know quite well - they don't really cache it much anyway. ;)
    • There are plenty of RAM drives around; use one of those. Sorry, that would be reckless. I need my data to be synchronized back to the HDD whenever there is a bit of free time. In the case of a power failure I could bear losing the last five minutes of work, but not everything since my last checkin.

    Added 2: An idea that came up - use a normal RAM drive plus a background folder synchronizer (but I do mean background). Is there any such thing?

    Added 3: Interesting. I just tried out a simple RAM drive at work. The rebuild time drops from ~14 secs to ~7 secs (not bad), but incremental build is still at ~5 secs - just like on the HDD. Any ideas why? It uses aspnet_compiler and aspnet_merge. Perhaps they do something with other temp files elsewhere?

    Added 4: Oh, nice new set of answers! :) OK, I've got a bit more info for all you naysayers. :)

    One of the main reasons for this idea is not the above-mentioned software (14 secs build time), but another one that I didn't have access at the time. This other application has a 100 MB code base, and its full build takes about 5 minutes. Ah yes, it's in Delphi 5, so the compiler isn't too advanced. :) Putting the source on a RAM drive resulted in a BIG difference. I got it below a minute, I think. I haven't measured. So for all those who say that the OS can cache stuff better - I'd beg to differ.

    Related Question:

    RAM disk for speed up IDE

    Note on first link: The question to which it links has been deleted because it was a duplicate. It asked:

    What do you do while your code’s compiling?

    And the answer by Dmitri Nesteruk to which I linked was:

    I compile almost instantly. Partly due to my projects being small, partly due to the use of RAM disks.

    解决方案

    In Linux (you never mentioned which OS you're on, so this could be relevant) you can create block devices from RAM and mount them like any other block device (that is, a HDD).

    You can then create scripts that copy to and from that drive on start-up / shutdown, as well as periodically.

    For example, you could set it up so you had ~/code and ~/code-real. Your RAM block gets mounted at ~/code on startup, and then everything from ~/code-real (which is on your standard hard drive) gets copied over. On shutdown everything would be copied (rsync'd would be faster) back from ~/code to ~/code-real. You would also probably want that script to run periodically, so you didn't lose much work in the event of a power failure, etc.

    I don't do this anymore (I used it for Opera when the 9.5 beta was slow, no need anymore).

    Here is how to create a RAM disk in Linux.

    这篇关于RAM驱动器进行编译 - 是否有这样的事情?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆