dart:math, log() function is slow #45414
Labels
area-vm
Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
library-math
Dart SDK version: 2.13.0-116.0.dev (dev) (Sun Mar 7 18:57:20 2021 -0800) on "windows_x64"
Came across an article regarding
FFI
, there was a comparison of Dart performance to gcc. The sample code was trivial and usedlog()
in a loop and the difference in performance was 10x. Got curious and did my own micro-benchmarks using Dart, gcc and .NET 5.Empty loop (not included in code below) and
sin()
(included) gave similar results for all 3 languages, logarithm is ~5-25x slower with Dart (both VM/Jit and AOT) - ~20s vs 3-0,7s.Results, console output
Dart
.NET 5/C# (app built in Release mode)
gcc/C++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project - 8.1.0)
Dart Code
C# code
C++ code
The text was updated successfully, but these errors were encountered: