Reverse String

Performance Test

Running benchmarking tests on the Devnet will not yield satisfactory results; you need a full-scale network for that purpose.

The contract MpBenchmarking is designed to benchmark the reverse function using different numbers of processes in parallel.

The reverse function in the contract takes a byte array as input and reverses its contents. Finally, it calculates the keccak256 hash of the reversed array. The execution time for each thread count (1, 2, 4, 8, 12, 16, 32, 64) was recorded for each of the 10 runs. Statistics (min, max, mean, and standard deviation) were extracted from the result data.

Results (ms):


Given that the test machine only has 32 physical cores, adding more threads beyond 32 threads is unlikely to result in significant improvements in performance.

Test case Decreasing Execution Time with Increasing Threads: As the number of threads increases, the execution time generally decreases. This trend is evident across the different thread counts. It suggests that the benchmark benefits from parallelization, and as more threads are utilized, the computation becomes more efficient. While increasing the number of threads initially leads to significant reductions in execution time, the rate of improvement starts to slow down as the number of threads increases.

Last updated