flutter-tizen / engine

The Flutter engine
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
6 stars 19 forks source link

Enable compressed pointers for arm64 #220

Closed swift-kim closed 2 years ago

swift-kim commented 2 years ago

https://medium.com/dartlang/dart-2-15-7e7a598e508a#0c15

The feature is currently only enabled for Android 64-bit by default.

https://github.com/flutter-tizen/engine/blob/a0668c013ea4bfe0fde7eea99d4819c526940ead/tools/gn#L389-L391

We need to check if it can be enabled for Tizen arm64 targets.

bwikbs commented 2 years ago

In my case it didn't run on arm64 target(rb5) without this.

swift-kim commented 2 years ago

"without this" means with compressed pointers enabled? We need more details on why it fails.

bwikbs commented 2 years ago

In conclusion, it's not quite working properly... It's my misunderstanding..

I just get the following message with abort signal at launching phase. [FATAL:flutter/runtime/dart_vm_initializer.cc(22)] Error while initializing the Dart VM: Snapshot not compatible with the current VM configuration: the snapshot requires 'product no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks no-lazy_dispatchers use_bare_instructions dedup_instructions no-asserts arm64-sysv compressed-pointers null-safety' but the VM has 'product no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks no-lazy_dispatchers use_bare_instructions dedup_instructions no-asserts arm64-sysv no-compressed-pointers null-safety' So I thought it was necessary. Of course, I still think it's probably necessary, but I can't be sure until I look a little more.

swift-kim commented 2 years ago

Even if you manage to build successfully, probably you will not be able to test it right now because of https://github.com/flutter-tizen/engine/issues/219.

bwikbs commented 2 years ago

You're right. I'm currently looking for a way.

swift-kim commented 2 years ago

I tested this feature with the Gallery app on RPi4 (arm64) and it just worked without any further configuration. Note that both gen_snapshot and the engine must be built with the dart_use_compressed_pointers flag enabled.

Should we enable this for Tizen arm64 by default or do we need more testing?

bwikbs commented 2 years ago

RB5 is also the same result. I think this is what we need feature at this time.

swift-kim commented 2 years ago

The benefit is not that great according to the measurement. Only 4 MB (3.5%) reduction of the total memory footprint when measured right after app launch (Gallery).

Application                                    PSS (KB)                RSS (KB)
io.flutter.demo.gallery          112445  108510   -3.5%  130466  126530   -3.0%
bwikbs commented 2 years ago

Worried about performance impact?

swift-kim commented 2 years ago

No. The feature is new and could cause instability or bugs. I think it would be safe to keep away from it for now. Our new board has enough memory (8 GB) so it's not worth taking risk.

bwikbs commented 2 years ago

I got what you meant. I have an attitude of applying and seeing if there is no problem, but I am not insisting on applying this. :smile: (It's only my preference.)