Skip to content

Commit 1483860

Browse files
wldehAbduqodiri Qurbonzoda
authored andcommitted
docs: Refine benchmarking-overview and benchmark-runtime docs for clarity and relevance
1 parent f52c14b commit 1483860

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

docs/benchmark-runtime.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,35 @@ The benchmark configuration is handled through annotations that map directly to
2323
### File Operations
2424

2525
File reading and writing operations are performed using standard Java I/O classes, providing a consistent and reliable method for file operations across all JVM platforms.
26+
27+
## JavaScript Target
28+
29+
The JavaScript target in kotlinx.benchmark leverages the Benchmark.js library to run benchmarks. Benchmark.js is a robust tool for executing JavaScript benchmarks in different environments, including browsers and Node.js.
30+
31+
### Benchmark Execution
32+
33+
Benchmark.js handles the execution of benchmarks, managing the setup, running, and teardown of tests. Just like JMH for JVM, it also handles the calculation of results, providing a reliable framework for benchmarking on JavaScript.
34+
35+
### Benchmark Configuration
36+
37+
The benchmark configuration in JavaScript is handled through a suite and benchmark API provided by benchmark.js. The API allows the users to specify the details of the benchmark such as the function to benchmark, setup function, and teardown function.
38+
39+
### File Operations
40+
41+
File reading and writing operations in JavaScript are performed using the standard JavaScript file I/O APIs. This includes the fs module in Node.js or the File API in browsers.
42+
43+
## Native Target
44+
45+
The Native target in kotlinx.benchmark leverages the built-in benchmarking capabilities of the Kotlin/Native runtime to execute benchmarks.
46+
47+
### Benchmark Execution
48+
49+
Kotlin/Native manages the execution of benchmarks, handling the setup, running, and teardown of tests. Just like JMH for JVM and Benchmark.js for JavaScript, Kotlin/Native also takes care of the calculation of results, providing a reliable framework for benchmarking in a native environment.
50+
51+
### Benchmark Configuration
52+
53+
The benchmark configuration in Kotlin/Native is handled through annotations that are similar to those used in the JVM target. These include `@State`, `@Benchmark`, `@BenchmarkMode`, `@OutputTimeUnit`, `@Warmup`, `@Measurement`, and `@Param`.
54+
55+
### File Operations
56+
57+
File operations in the Native target are handled through Kotlin's standard file I/O APIs. These APIs are compatible with all platforms supported by Kotlin/Native, providing a consistent method for file operations.

docs/benchmarking-overview.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Harnessing Code Performance: The Art and Science of Benchmarking with kotlinx-benchmark
1+
# Code Benchmarking: A Brief Overview
22

33
This guide serves as your compass for mastering the art of benchmarking with kotlinx-benchmark. By harnessing the power of benchmarking, you can unlock performance insights in your code, uncover bottlenecks, compare different implementations, detect regressions, and make informed decisions for optimization.
44

@@ -47,8 +47,6 @@ Benchmarking provides several benefits for software development projects:
4747

4848
4. **Hardware and Environment Variations:** Benchmarking helps evaluate the impact of different hardware configurations, system setups, or environments on performance. It enables developers to optimize their software for specific target platforms.
4949

50-
comparison across systems. This eases sharing and discussing performance results within a team or the larger community.
51-
5250
## Benchmarking Use Cases
5351

5452
Benchmarking serves as a critical tool across various scenarios in software development. Here are a few notable use cases:

0 commit comments

Comments
 (0)