From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/tools/performance/examples/index.html | 12 ++++ .../sorting_algorithms_comparison/index.html | 73 ++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 files/ja/tools/performance/examples/index.html create mode 100644 files/ja/tools/performance/examples/sorting_algorithms_comparison/index.html (limited to 'files/ja/tools/performance/examples') diff --git a/files/ja/tools/performance/examples/index.html b/files/ja/tools/performance/examples/index.html new file mode 100644 index 0000000000..06fadd2aca --- /dev/null +++ b/files/ja/tools/performance/examples/index.html @@ -0,0 +1,12 @@ +--- +title: Examples +slug: Tools/Performance/Examples +tags: + - TopicStub +translation_of: Tools/Performance/Examples +--- +
{{ToolsSidebar}}
+ +

パフォーマンスシナリオとチュートリアルのデモページのリストです。

+ +

{{ ListSubpages ("/ja/docs/Tools/Performance/Examples", 5) }}

diff --git a/files/ja/tools/performance/examples/sorting_algorithms_comparison/index.html b/files/ja/tools/performance/examples/sorting_algorithms_comparison/index.html new file mode 100644 index 0000000000..70e8a8f7b5 --- /dev/null +++ b/files/ja/tools/performance/examples/sorting_algorithms_comparison/index.html @@ -0,0 +1,73 @@ +--- +title: ソートアルゴリズムの比較 +slug: Tools/Performance/Examples/Sorting_algorithms_comparison +translation_of: Tools/Performance/Examples/Sorting_algorithms_comparison +--- +
{{ToolsSidebar}}
+ +

この記事では、2つのパフォーマンスガイドで使用する簡単なサンプルプログラムについて説明します。コールツリーのガイドとフレームチャートのガイドです。

+ +

このプログラムは、3つの異なるソートアルゴリズムのパフォーマンスを比較します。

+ + + +

これは以下の機能で構成されています。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sortAll()トップレベルの関数。 (200回)反復的に配列を生成し、sort()を呼び出します。
sort()bubbleSort()selectionSort()quickSort()を順に選択し、結果を記録します。
bubbleSort()バブルソートを実装し、ソートされた配列を返します。
selectionSort()選択ソートを実装し、ソートされた配列を返します。
quickSort()クイックソートを実装し、ソートされた配列を返します。
swap()bubbleSort()selectionSort()のヘルパー関数。
partition()quickSort()のヘルパー関数。
+ +

コールグラフは次のようになります。

+ +
sortAll()                     // (generate random array, then call sort) x 200
+
+    -> sort()                 // sort with each algorithm, log the result
+
+        -> bubbleSort()
+
+            -> swap()
+
+        -> selectionSort()
+
+            -> swap()
+
+        -> quickSort()
+
+            -> partition()
+ +

プログラムのソートアルゴリズムの実装は、https://github.com/nzakas/computer-science-in-javascript/から取得され、MITライセンスで使用されます。

+ +

ここでサンプルプログラムを試してみて、ここでコードをクローンすることができます(gh-pagesブランチを確認してください)。 私たちが議論した特定のプロフィールをダウンロードすることもできます。あなたがフォローしたい場合は、パフォーマンスツールにインポートするだけです。 もちろん、独自のプロファイルを生成することもできますが、数字は少し異なります。

-- cgit v1.2.3-54-g00ecf