Nodeに関するbehironのブックマーク (3)

  • 時間計測をしてNode.jsアプリのパフォーマンス改善の手助けをする - 技術探し

    現在のNode.jsの安定性指標 Performance Timing API 目的 提供される変数・メソッド イメージ PerformanceEntry entryType node gc Performance timeOrigin now() nodeTiming mark() measure() timerify() getEntries() getEntriesByName() / getEntriesByType() PerformanceObserver ユーザーの手順 区間測定を行う 関数実行にかかる時間を測定する 使用例 Server Side Rendering まとめ 区間測定をしたい場合 イベントの測定をしたい場合 前回の記事とはまた別の話です。 blog.hiroppy.me 今回は、土曜日に京都で話したきたPerformance Timing APIについて話し

    時間計測をしてNode.jsアプリのパフォーマンス改善の手助けをする - 技術探し
    behiron
    behiron 2019/04/26
  • Node.jsでのイベントループの仕組みとタイマーについて - 技術探し

    イベントループ イベントループとは? イベントループとは、JavaScript がシングルスレッドなのにもかかわらず、効率よくノンブロッキング I/O を実行できるようにする仕組みです。 イベントループはメインスレッドで実行されます。 ブラウザのイベントループとは異なるので注意が必要です。 Node.js のイベントループは libuv に基づきます。 ブラウザのイベントループはhtml5に基づきます。 libuv Node.js の非同期はカーネルと会話するために libuv を使います。 もともと、Node.js のために作られたものですが、今は様々なところで使われています。 libuv とは、非同期 I/O に強く、クロスプラットフォーム対応の抽象化ライブラリです。 基的には、イベントループと非同期処理を行います。 libuv は、Node.js にイベントループ機能全体を提供して

    Node.jsでのイベントループの仕組みとタイマーについて - 技術探し
    behiron
    behiron 2019/04/26
  • Modules | Node.js v10.12.0 Documentation

    CommonJS modules are the original way to package JavaScript code for Node.js. Node.js also supports the ECMAScript modules standard used by browsers and other JavaScript runtimes. In Node.js, each file is treated as a separate module. For example, consider a file named foo.js: const circle = require('./circle.js'); console.log(`The area of a circle of radius 4 is ${circle.area(4)}`); On the first

    behiron
    behiron 2019/04/26
  • 1