1

I have a MultiView with several items and TImages as icons instead of an ImageList (I used ImageList before but it is very broken and no less CPU is consumed).

The thing that happen is: when the user tap the MasterButton or slide the MultiView for the first time after the app is open, the app freeze for around 1/3 of a sec and the slide animation is shown with around 2 or 3 fps, after this first slide the MultiView come back to normal fps animation.

enter image description here

I tried removing all code from OnStartShowing but it did absolutely no difference. What may be causing this issue? There is some way to "pre-load" what may be loading during the first show?

Maurício Lima
  • 504
  • 6
  • 20
  • 2
    Not surprising at all, I've seen tons and tons of complaints of this exact issue. Not your exact scenario, not necessarily just the Multi View, but generally, many FMX controls, the first time they're accessed and/or animated, it's extremely sluggish. I always hate to discourage this, but if performance is an issue, and if you *only* intend to target Android, then you should use a more native Android development tool. For example: https://stackoverflow.com/questions/43232968/delphi-firemonkey-tcombobox-extreme-slow-opening?s=1|1.8014 – Jerry Dodge Aug 08 '17 at 21:47
  • Maybe there is something we can edit on the FMX library to improve it? Make it threaded or double buffered... – Maurício Lima Aug 09 '17 at 02:28
  • 1
    @MaurícioLima While Delphi does come with full VCL code I'm afraid that provided FMX code is limited. So I doubt you would be able to optimize it much by yourself especially since there is no provided code for rendering core of FMX. – SilverWarior Aug 09 '17 at 05:35
  • @SilverWarior I understand, maybe if I switch the ListBox to something else could improve some performance? – Maurício Lima Aug 09 '17 at 15:37

1 Answers1

1

One option will be to remove all the standard control you use inside the multiview and use instead the Alcinoe standard controls. They are double buffered so you can preload them and they are much (and i say much) more faster to draw than normal Delphi styled controls. In general try to avoid all styled controls (ex: Tlabel) and use instead classic control (ex: TText)

Another remark: try to see if you select a font that is available on the system, else when the app will do the first render of the control, with a font that is not on the system, it's will take a very long time to determine with font to use

note: I can't comment so i can't answer to @jerrydodge, but i would like to say him that he is false, with delphi you can do app that are fast as app build with as studio/xcode (at least under berlin, with tokyo their is a bug actually)! You just need to build it correctly ;) try to look at the alcinoe project with their double buffered controls

andrey
  • 191
  • 8
  • Actually I did a change on FMX.FontGlyphs.Android.pas so I can use a font that is in deploy, that may be causing the 0.3 sec freeze? I had already used Alcinoe TEdit once, I'll try to implement the other controls. Thanks. – Maurício Lima Aug 16 '17 at 14:15
  • I swapped tons of controls in my project to Alcinoe controls, but some of them (like Image and Video) seem a little confusing to build properly and there is no tutorial explaining. – Maurício Lima Nov 05 '17 at 08:36