Skip to content

Commit

Permalink
Fastest sort by default (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh authored Oct 20, 2024
1 parent 07aeab3 commit 78c9f23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions docs/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ async function graph({
// build a list of module names for sorting
let sortedValues: BenchmarkResult[] = [];

if (sort === 'fastest') {
if (sort === 'fastest' || !sort) {
sortedValues = [...valuesNodejs, ...valuesBun].sort(
(a, b) => b.ops - a.ops
);
} else if (sort === 'alphabetically' || !sort) {
} else if (sort === 'alphabetically') {
sortedValues = [...valuesNodejs, ...valuesBun].sort((a, b) =>
a.name < b.name ? -1 : 1
);
Expand Down Expand Up @@ -437,7 +437,7 @@ class App extends Component<
selectedBunVersions: {},
valuesNodeJs: [],
valuesBun: [],
sortBy: 'alphabetically' as const,
sortBy: 'fastest' as const,
};

getNodeJsVersions() {
Expand Down Expand Up @@ -645,8 +645,8 @@ class App extends Component<
}
value={this.state.sortBy}
>
<option value="alphabetically">Alphabetically</option>
<option value="fastest">Fastest</option>
<option value="alphabetically">Alphabetically</option>
</select>
</label>
</div>
Expand Down
26 changes: 13 additions & 13 deletions docs/dist/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78c9f23

Please sign in to comment.