Node.js现可作为本地应用在Windows上运行

fmms 12年前
     <a href="/misc/goto?guid=4958189735229147892" target="_blank">Node.js</a> 已可在不借助 Cygwin 的情况下,直接在 Windows 上运行,同时,在 Windows 和 UX 系统上的性能也有显著的提升。    <p> Ryan Dahl,Node.js 创始人,宣布了 <a href="/misc/goto?guid=4958198114249226733" target="_blank">Node.js 0.6</a>的发布,这是一个新的服务端 JavaScript 环境的稳定版本,其中一个重要的新特性是,通过使用 Socket 的<a href="/misc/goto?guid=4958199079264589473" target="_blank">I/O完成端口</a>提供在 Windows 本地运行的支持。上一个版本的 <a href="/misc/goto?guid=4958199080011287259" target="_blank">Node.js 必须借助 Cygwin 才可在 Windows 上运行</a>,但现在,已不再提供对 Cygwin 的支持。除 Windows 外,Node.js 还支持 Linux、Mac OS X、webOS 及一些 UX 型系统:Solaris、FreeBSD 和 OpenBSD。</p>    <p> Dahl 提到,向 Windows 平台的移植致使主要架构进行了调整,但大部分的 API 仍保持不变,而且在 Unix 系统上的性能也没有受到影响(这一直是大家所担心的)。他列举了具体的数据作为例证:</p>    <table style="width:430px;" border="1">     <tbody>      <tr>       <th width="170"> </th>       <th width="130">Linux v 0.4.12</th>       <th width="128">Linux v 0.6.0</th>      </tr>      <tr>       <td width="170">http_simple.js /bytes/1024</td>       <td width="130">5461 r/s</td>       <td width="128">6263 r/s</td>      </tr>      <tr>       <td width="170">io.js 读</td>       <td width="130">19. 75 MB/s</td>       <td width="128">26. 63 MB/s</td>      </tr>      <tr>       <td width="170">io.js 写</td>       <td width="130">21. 60 MB/s</td>       <td width="128">17. 40 MB/s</td>      </tr>      <tr>       <td width="170">startup.js</td>       <td width="130">74. 7 ms</td>       <td width="128">49. 6 ms</td>      </tr>     </tbody>    </table>    <p> 唯一的一个问题就是 Node.js 0.6 版本在 Linux 上写数据的性能稍逊一筹。但是,脱离了 Cygwin,Node.js 在 Windows 上的性能有了明显的改善,以下数据可作为参考:</p>    <table style="width:430px;" border="1">     <tbody>      <tr>       <th width="171"> </th>       <th width="129">Windows v 0.4.12</th>       <th width="128">Windows v 0.6.0</th>      </tr>      <tr>       <td width="171">http_simple.js /bytes/1024</td>       <td width="129">3858 r/s</td>       <td width="128">5823 r/s</td>      </tr>      <tr>       <td width="171">io.js 读</td>       <td width="129">12. 41 MB/s</td>       <td width="128">26. 51 MB/s</td>      </tr>      <tr>       <td width="171">io.js 写</td>       <td width="129">12. 61 MB/s</td>       <td width="128">33. 58 MB/s</td>      </tr>      <tr>       <td width="171">startup.js</td>       <td width="129">152. 81 ms</td>       <td width="128">52. 04 ms</td>      </tr>     </tbody>    </table>    <p> Node.js 0.6 在其他方面的改进主要体现在:在多进程之上集成了负载均衡、内置了用于压缩的 zlib 库。在 Node 实例之间更好地支持 IPC(进程间通信,Inter-process communication),改进了命令行调试器,此外,V8的版本也从3.1升级到了3.6。</p>    <p> 关于 API 变更的具体细节可在 <a href="/misc/goto?guid=4958198274023115627" target="_blank">GitHub 页面</a>查看。</p>    <p> 此外 Dahl 还提到,他们计划缩短发布周期,尝试赶在与 Google 发布 Chrome 新版本 V8(用于 Google Chrome 的 JavaScript 引擎)的同时,也将 Node.js 的新版本发布。</p>    <p> <strong>查看英文原文:</strong><a href="/misc/goto?guid=4958199081424064003" target="_blank">Node.js Now Runs Natively on Windows</a></p>    <div id="come_from">          来自:     <a id="link_source2" href="/misc/goto?guid=4958199082155388130" target="_blank">InfoQ</a>    </div>