タグ

2016年2月8日のブックマーク (2件)

  • Node.jsのClusterをセットアップして、処理を並列化・高速化する | POSTD

    Node.jsが多数のイベントの非同期な処理に長けていることはよく知られていますが、それが単一のスレッドで行われていることを多くの人は知りません。Node.jsは実際にはマルチスレッドではないので、リクエストは全て単一スレッドのイベントループで処理されているだけなのです。 そこで、Node.jsクラスタを使って、クワッドコアプロセッサの能力を最大限に引き出しましょう。コードの複数のインスタンスで起動し、さらに多くのリクエストを処理します。少し難しく思えるかも知れませんが、Node.js v0.8で導入された cluster モジュールを使えば、実はとても簡単です。 もちろん、これは、作業を別々のプロセスに分割することのできるアプリならどんなアプリにでも役立ちますが、webサイトのような多くのIOリクエストを処理するアプリには特に重要です。 残念ながら、並行処理は複雑なので、サーバ上でのアプ

    Node.jsのClusterをセットアップして、処理を並列化・高速化する | POSTD
    yosuke_furukawa
    yosuke_furukawa 2016/02/08
    なんかだいぶ前のなのかな...
  • imperative imports · Issue #368 · tc39/ecma262

    ES2015 specifies a sequentialized evaluation order of modules, where the particular syntactic location of an import statement in a module body has no effect on the order of evaluation. Instead, the semantics simply determines a module's list of direct dependencies and recursively calls ModuleEvaluation() on each of them in order before evaluating the body. I'll refer to this semantics as declarati

    imperative imports · Issue #368 · tc39/ecma262
    yosuke_furukawa
    yosuke_furukawa 2016/02/08
    ES2015 modules の中で imperative imports つまり、「必ずこのタイミングでは必須のmodule」を決められるための提案。CJSみたいな方式も見込んでの提案なのでNodeとcompatを取るためにもあったほうが良さそう。