Closed maks closed 1 year ago
@rmacnak-google - fyi
Can you split running from source into these two steps and report which is slow?
$ time dart-sdk/bin/dart --snapshot=test.dart.dill test.dart
$ time dart-sdk/bin/dart test.dart.dill
Yes of course, sorry about that @rmacnak-google , I should of thought to do that. Here are the results:
rv@licheerv:~$ time dart-sdk/bin/dart --snapshot=test.dart.dill test.dart
Info: Compiling with sound null safety
real 0m36.367s
user 0m31.154s
sys 0m2.931s
rv@licheerv:~$ time dart-sdk/bin/dart test.dart.dill
hello world
real 0m4.884s
user 0m2.453s
sys 0m0.460s
I only ran the above 3 times, but the times for each run are all with a ~5% of each other.
And for completeness my test.dart
is:
void main() {
print("hello world");
}
I'm happy to run other tests to try to debug this further if that would help. I know this is very new hardware and its only beta channel but I thought it might be helpful to report real world usage.
The dev board itself is very nice and tiny form factor, yet seems to have reasonable amount of CPU perf and RAM for its power usage, and with the only slightly larger carrierboard you get full size HDMl & USB-A so I can see even these early boards being very popular for a whole range of embedded/kiosk/infotainment applications and it would be great to be able to use Dart (and eventually) Flutter on them.
time test.exe -bash: test.exe: command not found real 0m0.015s user 0m0.000s sys 0m0.012s
The AOT time contains an error, so it does not reflect AOT performance. Can you re-run this with the correct path?
Sorry about that and for the delay in replying @rmacnak-google Re-running it with the path correctly set I get:
time ./test.exe
hello world
real 0m1.088s
user 0m0.032s
sys 0m0.048s
Please do let me know if there is anything else I can do to help or if there are any specific newer SDK builds you would like me to test,
We got a DevTerm Kit R-01, which also has a Allwinner D1, and can reproduce similar performance measurements.
What's going on is that since Dart 2 the cost of the frontend / running from source and the up-front cost of the core libraries is significantly higher than in Dart 1 (compare https://github.com/dart-lang/sdk/issues/34172). Since the D1 is a rather slow CPU, this cost is much more noticeable than on a desktop. There's no RISC-V specific issue here, and the VM implements nearly all the same optimizations for RISC-V as it does for x86 or ARM (except for SIMD).
Using:
on a Sipeed Lichee RV I see very slow startup and execution times.
I'm running a custom built debian (prebuilt from here):
I have disabled swap, so I'm sure it not swapping that is causing this.
Running a simple
print ("helloworld")
or evendart --help
takes a long time:and
Compiling was much worse:
Though the compiled binary is fine:
And other things seem to take a reasonable amount of time too, eg. compiling a hello world in C: