The World Wide Web Consortium

W3CのWebパフォーマンスワーキンググループは12月12日(米国時間)、「Performance Timeline」および「User Timing」という2つのW3C勧告を公開した。前者はパフォーマンス計測データの保存および読み出しに関する統一的なインタフェースについて規定したもの、後者はWebアプリケーションのパフォーマンス計測に利用するインタフェースを規定する内容になっている。なお前者においては個別のパフォーマンス計測インタフェースは包括の範囲外としている。

WebアプリケーションやWebサービスのパフォーマンス改善にはそのソフトウェアの動作を正確に計測して把握する必要がある。「Performance Timeline」ではこうした場合に利用するためのインタフェースが定義されている。

interface PerformanceEntry {
  readonly attribute DOMString name;
  readonly attribute DOMString entryType;
  readonly attribute DOMHighResTimeStamp startTime;
  readonly attribute DOMHighResTimeStamp duration;
};

partial interface Performance {
  PerformanceEntryList getEntries();
  PerformanceEntryList getEntriesByType(DOMString entryType);
  PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType);
};

typedef sequence <PerformanceEntry> PerformanceEntryList;

User Timing」では高精度タイムスタンプにアクセスしてパフォーマンス計測に利用するためのインタフェースが規定されている。

interface PerformanceMark : PerformanceEntry {
};

interface PerformanceMeasure : PerformanceEntry {
};

partial interface Performance {
  void mark(DOMString markName);
  void clearMarks(optional  DOMString markName);

  void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
  void clearMeasures(optional DOMString measureName);
};

Performance Timeline W3C勧告サンプル

Performance Timeline W3C勧告サンプル

User Timing W3C勧告サンプル

User Timing W3C勧告サンプル