Skip to content

Fastest sort by default #1323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.