Description
Info
- Dart 3.5.3 (stable) (Wed Sep 11 16:22:47 2024 +0000) on "linux_x64"
- on linux / Linux 6.1.0-27-amd64 Process tests sometimes cause timeout on Linux #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01)
- locale is en_US.UTF-8
Problem
Hi!
Yesterday, I was trying for the first time to benchmark my code by reading the final assembly code.
That's the program I have (coming from a Twitter post) :
import 'dart:typed_data';
void main(List<String> args) {
final u = int.parse(args[0]);
final r = 8372;
final List<int> a = Uint32List(10000);
for (int i = 0; i < 10000; i++) {
for (int j = 0; j < 100000; j++) {
a[i] = a[i] + j % u;
}
a[i] += r;
}
print(a[r]);
}
I compiled that code with dart compile exe my_program.dart
then run objdump -d my_program.dart > output.asm
to get the assembly code.
I can see a lot of Dart_DebugName
and Dart_DetectNullSafety
. I thought it would be compile without the debug info so I checked the available flag and with the flag -save-debugging-info
, I should remove them and save them in an external file.
I run the new command dart compile exe --save-debugging-info debug.txt my_program.dart
. I don't know which extension should be the debugging info file. I can already see my file getting smaller! From 5.4MB to 5.2MB!
I checked again the assembly and I still find the previous symbols Dart_DebugName
and Dart_DetectNullSafety
that I thought would be stripped from the final executable.
Is it a normal behavior?