Skip to content
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

doc: add warning to benchmark #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# moonbitlang/x/benchmark

⚠️Please note that this benchmark is a very temporary implementation and the credibility of the results may be low. Due to the lack of coordination in building the system, we need to measure the time twice (once for calculating Average Time and once for calculating the maximum and minimum values of a single measurement), so there may be situations where the average time is greater than the maximum time

In the future, we will try more effective methods to benchmark

## Overview

This section provides some benchmark APIs, which are unstable and may be removed or modified at any time.
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmark.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub fn run(self : Task) -> TaskResult {
(self.f)()
}
let time = @ffi.instant_elapsed_as_secs_f64(now)
let mut max : Double = @double.min_value
let mut min : Double = @double.max_value
let mut max = @double.min_value
let mut min = @double.max_value
for i = 1; i <= self.count; i = i + 1 {
let per_now = @ffi.instant_now()
(self.f)()
Expand Down
Loading