How can Milan restart after the Champions League exit and paying for the summer window?

After the end of the two-round series, AC Milan failed to go any further, but fell at the feet of its sworn enemy in the same city. As the defending champion, Milan’s performance has been stumbling this season. Although the Champions League has reached the semi-finals, the league competition for the fourth place is in jeopardy. A series of wrong operations last summer laid the foundation for this chaotic season. How to restart the Rossoneri revival requires Milan to think and choose together.

[The four-game losing streak has made the Milan summer window even more inefficient]

Even after 16 years in the semi-finals, Milan’s Champions League journey this season is quite bitter and embarrassing. In two rounds, I suffered a double kill from my rival Inter Milan in the same city. Counting the Super Cup and the second round of the league, I was defeated by my opponent four times in a row, losing 7 goals but not scoring 1 goal. No matter what ranking Milan will end up in this season, it is a fact that Milan’s four-game losing streak in the derby is absolutely zero, which makes the team miserable both inside and outside.

Losing the Champions League to a deadly enemy and competing for the fourth place is in jeopardy. For a defending champion, this is definitely an unacceptable result. Coach Pioli has almost overdrawn his prestige in this stumbling season. Although he helped Milan to return to the Champions League and win a Serie A championship, the successive fiasco in January has made him "stand in prison" in the hearts of many fans, and the four-game losing streak in the Derby is even more "solid".

The total score of 0-3 is not good-looking, and Pioli’s use of troops is also debatable. But in the last two weeks, Milan has already run out of ammunition and food. In the first round, Leo was injured and the midfielder Ben Nasser was damaged; In the second round, defender Jiafu went off halfway, and Kalulu, who came off the bench, made a big mistake carelessly. The rest of the players are almost drained by the long season, and Gill, Special Olympics and krunic have all shown fatigue; Mesias and Tonali struggled hard, but they were powerless.

The bigger gap between the two sides actually lies in the rotation of the lineup. On the starting Milan may be equal to Inter Milan, but in the long-distance running of the season, Milan’s replacement lineup seems to be weak. Last summer, five players, such as Decatur, Origgi, Adelie, Dester and Franks, who were introduced and returned, failed to meet expectations and were not even included in the Champions League registration list. Only German defender Jiafu and youth training teenager Pobega showed certain value.

From the appearance lineup in the Champions League stage, we can also see Milan’s inefficiency last summer-Decatur, who invested heavily, only played in the first leg against Tottenham in the knockout stage; The only new aid with a starting record in the knockout round is Zhongwei Jiafu; In the two wars against Naples, not even a new aid started. Milan lost Casey and romagnoli last summer, and Ibrahimovic was close to retiring, but the Rossoneri hardly got any new blood, and it was almost doomed that they gradually declined at the end of the season. Inzaghi can let Lu Kaku play the league, Zhe Ke play the Champions League, and Milan can only hope that Gill will stick to his teeth.

[The concept is different, but the operation is different]

Therefore, the gap between Milan and Inter Milan in this series is actually the gap between the summer window transfer results. In the past year, both teams have experienced brain drain, and Inter Milan chose to fill it with mature players, such as Lu Kaku, acerbi and mkhitaryan. However, Milan chose to invest in young players to "scratch the lottery". Except for Origgi, who signed for free, all the other players are young people under the age of 23.

Two different strategies have different advantages and disadvantages. Inter Milan’s choice can bring more instant fighting power to the team. The third-line parallel is closely related to the performances of mkhitaryan and Lu Kaku. acerbi’s aging and growing stronger offset the negative impact of skrinjar’s "defection", so that Inter Milan will not lose its fighting power because of the absence of the core central defender. However, the cost of the lineup is high and the age is high. Even if the Champions League income is more than 100 million euros this season, the Nerazzurri’s loss has reached 100 million euros.

In contrast, Milan pays more attention to the long-term growth of the lineup, but it also loses experience and ability. Apart from Gill and Kyar, there are no core players over 30 in Milan. The cost of the lineup is also relatively controllable. With the Champions League results this season and the breakthrough in sponsorship, the Rossoneri, which had suffered losses for years, are expected to have a financial balance or even a small profit this season. But investing in young players requires patience, and not every bet can be rewarded. Germany’s Zhongwei Jiafu performed well in the second half, but in the first half, he experienced several months of "slow fire"; Decatur, who has high hopes, has not adapted yet.

But on the other hand, the operation of Inter manager Mallota is still more sophisticated than that of Milan director Paolo Maldini. In recent years, Inter Milan has lost its lineup every year, but Mallota, a seasoned player, has played a perfect game. After Lu Kaku left, he signed Zhe Ke, while Eriksson signed Chaer Hanoglu when he suffered from heart problems. Instead, it was the teams of Rome and Milan who took most of the damage for Inter Milan. Even if Inter Milan’s financial problems are frequently reported in newspapers, Mallota can still guarantee the team’s basic set at the league level.

But Maldini’s operation was too idealistic last summer. Hong Niao Fund hopes to invest in young players, but it is free to choose the specific target. However, the Milan uniform team did not supplement the backcourt when Kathy and romagnoli left the team. Instead, they introduced an attacker with unclear characteristics and outstanding strength, Decatur. Every time Maignan is in a hurry, many Milan fans will think, how nice it is to spend this 32 million yuan on a lower back!

Start all over again, but who will get a second chance? 】

Outside the stadium, Milan also sent ominous signals more than once. Before the first leg of the Champions League, Maldini called Hong Niao Capital and asked for more investment. After the exit, he once again pointed the finger at the management, claiming that "the management’s strategy" decided the transfer operation. In fact, the relationship between local managers and investment funds in Milan has always been subtle. In 2020, even Bo Ban was fired after firing at the employers. This time Maldini chose to fire, which made people worry whether he would make the same mistake again.

Both Eliot and Hong Niao Capital are obviously profit-seeking, hoping that the value of the team will gradually increase. But on the other hand, Maldini received a lot of financial support. Last summer, Milan’s net investment was the first in Serie A, and 32 million euros of Decatur also set a new record in the American-funded era. While criticizing the management strategy, the resource allocation and choice of trader Maldini are equally worth examining. However, with the exit from the Champions League, the contradiction between the two sides seems to be open again. Before starting again, perhaps the Rossoneri will have to face internal friction first.

The amount involved is 53 million! Spanish prosecutors sued Barcelona for bribing referees.

According to the Spanish newspaper El Paí s reported on the 11th, on Friday, local time, Spanish prosecutors formally sued Barcelona La Liga for sports fraud and commercial corruption, involving 7.3 million euros (about 53 million yuan).

The accused included two former club presidents, Sandro Rosell and Josep Bartomeu, who were suspected of bribing former Spanish Football Association officials to gain partiality in the match.

After learning this news, Barcelona’s arch-rival Real Madrid Club immediately announced that it would hold an emergency board meeting to decide how to respond to the incident.

Laporta, current president of Barcelona.

In February this year, many Spanish media reported that Barcelona was in big trouble, and Spanish prosecutors were investigating its commercial corruption and violation of fair competition.

Sure enough, on Friday, local time, Spanish prosecutors formally sued Barcelona, accusing the latter of colluding with Jose Negreira, former vice chairman of the Spanish Football Association’s referee technical committee, involving a total amount of 7.3 million euros.

The referees’ technical committee is usually responsible for assigning referees for various competitions of the football association, selecting which referees will enforce the law in which post, and selecting referees to participate in international competitions.

Spanish "National News" report screenshot

According to the prosecution’s report, based on an oral secret agreement, two former presidents of Barcelona, Rosell and Bartomeu, remitted about 7.3 million euros to the consulting company owned by grella from 2001 to 2018, in order to seek "favoritism" in the penalty and result of the competition.

Rosell, Bartomeu and two other former Barcelona executives were charged with commercial corruption, unfair management (using partners’ money for illegal purposes) and forging business documents. Once convicted, they will go to jail.

It is worth noting that laporta, the current president of Barcelona, has not been charged. He served as the president of Barcelona from 2003 to 2010, but denied any illegal acts.

Team coach Harvey revealed in an interview that he had already communicated with laporta. "This is the responsibility of the management. He told me not to worry, we just need to focus on football."

Spain’s El Pais pointed out that this investigation originated from a tax inspection, and Negreira told the Spanish tax authorities that Barcelona paid the money in order to have a "neutral" penalty in the competition.

He also said in an interview with Spain’s radio Searle that he would never be partial to Barcelona when assigning referees. His job is just to help the club as a consultant and tell them how players should behave in the face of various referees.

Previously, Barcelona officials had a similar statement, saying that the club only paid an "external consultant" who provided them with "technical reports related to professional referees" and called it "a common practice of professional football clubs".

However, the Spanish prosecutor still considers the amount of 7.3 million euros suspicious because it is nowhere to be found in the club’s articles of association and has not been approved by the shareholders’ meeting.

The Associated Press (AP) analysis believes that it is indeed a routine operation in international football to obtain referee technical reports, and clubs can purchase or prepare relevant information from external companies.However, it is not a routine operation to provide large sums of money to insiders of Spanish referee law enforcement agencies to obtain reports.

Up to now, Barcelona Club has not issued the latest statement on this matter. However, an anonymous club executive told Reuters that the club had "anticipated" the accusation. "This is only the preliminary investigation and hypothesis of the prosecution, and the judicial investigation has just begun. The club will fully cooperate, but we have never bought any referee and never tried to influence the decision of any Football Association official. "

In response to the corruption scandal in Barcelona, the first to take action was its arch-enemy Real Madrid Club. The latter announced on the 11th that the board of directors will be held on March 12th local time.

Real Madrid fan magazine "Madridista Real" reported that the board of directors of Real Madrid may choose to "sever relations" with Barcelona Club, and may even decide to appear as a private prosecutor in future court trials.

Academician Zhang Xueji, Vice President of Shenzhen University: If you master the sensing technology, you will control the world.

There are many opportunities for intelligent sensors. As the first of the six technologies in the United States, artificial intelligence can improve our quality of life through the combination of artificial intelligence and sensors. The development trend of intelligent sensors is to monitor in real time, be flexible and light, and the key is to analyze multiple parameters at the same time, be wearable and non-invasive.

"Have dinner with me and I’ll give you $300,000!" Football superstars fall into the trap of Chinese aunts.

"Have dinner with me and I’ll give you $300,000." In 2003, a female fan in China paid a lot of money to invite Ronaldo to dinner. Ronaldo was so happy that he didn’t know that he had fallen into someone else’s trap.

Speaking of Ronaldo, even those who don’t know football, I believe they have heard his name. Ronaldo’s full name is ronaldo luiz nazario de lima. If you mention Ronaldo’s achievements in football, you can even introduce him day and night without interruption. In addition, Ronaldo also has many nicknames, such as Ronnie, Fei Luo and Da Luo. Ronaldo was born on September 18th, 1976. When he was a child, his family was very poor, but it was his love for football that kept him from giving up this career, and he eventually grew up to be the king of football in the world.

In the growing experience of Ronaldo, Ronaldo can be said to have dealt with all kinds of people. Because of his high popularity, Ronaldo was still relatively strong in protecting his brand awareness when attending various activities, but what Ronaldo didn’t expect was that he actually stumbled in the hands of a China woman.

To mention this story, we have to look back to 20 years ago, that is, in 2003, when Ronaldo came to China for an exchange competition. After arriving in China, Ronaldo was quickly impressed by the enthusiasm of China fans. The scene of the game was surrounded by a sea of fans, all of whom shouted their names.

After the game, Ronaldo’s assistant told him that there was a female boss in China who wanted to have dinner with him. At first, Ronaldo refused. After all, his time is precious, but then the assistant said that the female boss was willing to pay $300,000 as a reward as long as he agreed to have dinner with her.

Hearing this, Ronaldo instantly felt very interested. He could get 300,000 yuan just by eating a meal. Why not go?

Before departure, Ronaldo specifically explained to his assistant that he must show the other party that he is just going to have dinner. If it involves endorsement or other things, he needs to talk about the price. After all, it is impossible to endorse a product casually, just 300,000.

After arriving at the scene, the female boss also made it clear that 300,000 yuan is only the cost of eating and does not involve endorsement. Ronaldo let his guard down. There were not only the female boss, but also many children who lined up to send flowers to Ronaldo.

The female boss also took out a jersey, expressing the hope that Ronaldo could wear this jersey to accept the welcome of the children, and told Ronaldo that this jersey was carefully designed by the children. Ronaldo then put on a special jersey, not only accepted the children’s flowers at the scene, but also performed a superb skill for the children at the scene.

Next, I entered the stage of eating. The whole process of eating was very relaxed, and Ronaldo didn’t feel any discomfort. After dinner, the female boss is also very generous to transfer 300,000 yuan on the spot.

At this time, Ronaldo still felt that the money was very easy to earn, and the female boss in China was really generous.

After Ronaldo returned to China, he forgot all about it because of training and competition. It was not until a long time later that Ronaldo heard the news of his endorsement of products in China from his friends. At this time, Ronaldo felt very puzzled that he did not endorse any products in China.

Only after watching the relevant advertising videos did Ronaldo recall the experience of having dinner with the female boss in China. Then Ronaldo also entrusted a lawyer to take the female boss to court.

The female boss in the story is Jiang Peizhen, the helm of Golden Voice. Jiang Peizhen was in charge of a candy factory at first, but the candy factory soon closed down due to poor management. In order to solve the dilemma, Jiang Peizhen found Wang Yaofa because she heard that Wang Yaofa had a formula in his hand. After being authorized by Wang Yaofa, Jiang Peizhen formally established Guangxi Golden Voice.

Relying on Ronaldo’s fame, Golden Voice quickly swept across the country, and the sales volume showed a surge in a short period of time. Jiang Peizhen has also become a myth in the industry, but this luck didn’t last long. Finally, in 2009, Golden Voice still had financial problems, and Jiang Peizhen was also included in the list of dishonesty.

Archsummit direct hit | Build a smooth natural flutter page


Amoy Technology Department | Leisure Fish Technology | Cloud

"Fully strengthening the flutter fluidity, sharing challenges, online monitoring tool construction, optimization means to precipitate in component containers, and finally optimized advice."

Zhang Yunlong (cloud from), idle fish client experts.Since Netease, byte, Ali is running. At the current Department of Alibaba, there are currently responsible for idle fish APP packages, fluidity, start-up equation experience.


This sharing revolves around FLUTTER fluidity, respectively: 1.Flutter fluidity optimization challenge; 2. List container and flutterdx component optimization; 3. Performance measurement and devTool extension; 4.Fltter sliding curve optimization; 5. Performance optimization suggestions.

FLUTTER fluency optimization challenge

Business complexity challenge

FLUTTER has always been known by everyone, and the list controls displayed by Flutter Gallery (shown in the left) is indeed very smooth. But the actual business scene (shown on the right) is more complex than the Gallery list demo:

  1. Same card, more and complex (such as rounded) view control;

  2. When the list scroll, there are more view logic, such as scrolling control of other controls and disappearing;

  3. Card controls, there are more business logic, such as a different label, activity price, etc. based on background data, and there is also common business logic, etc.

  4. Because idle fish is an e-commerce app, we need to have certain dynamic capabilities to deal with frequently changed activities. Here we use the Flutter Dynamicx components of Ali to implement our dynamic capabilities.

Framework challenge

Let’s look at the overall flow of the list, here only pay attention to the free scroll phase after the finger is released.

  1. When the finger is released, the initial speed is calculated based on ScrollDragController.end;

  2. UI Thread requests RequestFrame to Platform Thread, and calls BegInframe to UI Thread at Platform Thread.

  3. The UI Thread Animate phase trigger list slides a little distance while registering the next frame callback to Platform Thread;

  4. Ui Thread Build Widget, generate / update the renderObject tree through the three tree DIFF algorithm of Flutter;

  5. UI Thread RenderObject Tree Layout, Paint Generates an Scene object, and finally passed to Raster Thread to draw on-screen;

The above flow must be completed in 16.6 ms to ensure that the frame cannot be guaranteed. Most of the cases, there is no need to build a new card, but when the new card enters the list area, the entire calculation amount will become huge, especially in complex business scenes, how to ensure all calculations within one frame of 16.6ms, Is a small challenge.

The figure above is a sliding devTool sample, and the Carton stage occurs when the new card is on the screen, and the other phases are very smooth, because the scrolling speed is attenuated, so the carton interval is also getting bigger. Because most of the time is very smooth, the average FPS is not low. However, the new card is built at the time of production, which gives us a stylish body feeling.

Challenge of dynamic capabilities – Flutter Dynamicx

The free fish APP card uses the self-developed Flutter Dynamicx to support our dynamic capabilities. Basic Principle: Online Edit Layout DSL, generate DX files and send it. The end side generates the DXComponentWidget by parsing the DX file and combines the back card data, and finally generates Widget Tree. FLUTTER DYNAMICX technology brings dynamic update capabilities, unified monitoring capabilities (such as dxcomponentwidget monitoring cards), good research and development insecurity (online DSL and Android Layout, and optimize Android), online editing capabilities;

But in performance, we also pay a certain price: DX cards add time to the template loading and data binding overhead, Widget wants to recursively create through WidgetNode traverses dynamically, and the view nesting layer will be deeper (followed by later).

Description: Flutter Dynamicx Reference Ali Group DSL Rules Realization

User’s sense of physical challenge

I have already described above, and the card in the FLUTTER list is more obvious.

When Android RecycleView occurs, the physical feel is not obvious, and the FLUTTER list has occurred when the card occurs, not only the time pause, but also a hopping on the OFFSET, and the physical feeling of small card is also changed. It is obvious;

Suppose the list content is simple enough, scrolling does not happen, we also found that the Flutter list and Android RecycleView are not the same:

? Use ClampingscrollPhysics to feel the feeling of similar magnets when the list is stopped.

? Use BOUNCINGSCROLLLPHYSICS, the list is started, and the speed attenuation is faster;

On the 90Hz machine, the early flutter list is not smooth, the reason is that the touch sampling rate is 120 Hz, and the screen refresh rate is 90Hz, causing partial screens to be 2 touch events, part is a 1 touch event, last Resulting in rolling OFFSET effects. When the Flutter 1.22 version, RESAMPLINGENABLED can be used to re-sample the touch event.

List container and flutterdx component optimization

Telling the challenge of Flutter fluidity optimization, now share how you optimize the smoothness and precipitate into PowerScrollView and Flutter Dynamic components.

PowerScrollView design and performance optimization

PowerscrollView is a snarefish team’s self-developing Flutter list assembly, with better packages and supplements on the Sliver Agreement: Data increased deletion, complement local refresh; layout, supplemented the waterfall flow; incident, supplement the card on the screen , Away, scrolling events; control, support for scrolling to Index.

In terms of performance, the waterfall flow layout optimization, local refresh optimization, card division optimization, and sliding curve optimization.

PowerScrollView Waterfall Flow Layout

PowerScrollView Waterfall Flow Layout provides longitudinal layout, lateral layout, mixed arrangement (transverse card and ordinary card mix). Nowadays, most of the listings of the hiped fish are available in PowerScrollView’s waterfall flow layout, such as the home page, search results page, etc.

PowerScrollView Waterfall Flow Layout Optimization

First, through conventional cache optimization, cache each card upper corner X value and which column belonging.

Compared to the Slivergrid card into the list area, the waterfall flow layout, we need to define Page, card admission to create and leave the field destruction need to be units. Before optimization, Page calculates cards in a screen visual area, and in order to determine the starting point Y value of Page, the primary layout needs to calculate the Page N and N + 1 two pages, so the amount of cards involved in the layout calculation is much lower, and the performance is low. After optimization, the approximation of all card height averages calculates Page, which greatly reduces the number of participating in the layout card, and the number of cards destroyed by Page also becomes less.

After the column cache and paging optimization, use the idle fish Self-developing Benchmark tool (follow-up) to compare the waterfall flow and GridView, view the number of frames and the worst frame consumption, can find that performance performance is basically consistent.

PowerScrollView local refresh optimization

Leisure fish products expect users to browse products more smooth, will not be loaded by loadmore, so the list is required to trigger LoadMore during scrolling. FLUTTER SLIVERLIST When the LOADMORE supplement card data, the List control is tender, and the slterlist building will destroy all cards and recreate it, and the performance data can be imagined very bad. PowerScrollView provides a layout refresh optimization: all cards on the cache screen, no longer recreate, ui thread Optimize from the original 34MS to 6MS (see the lower left picture), the right image is viewed by Timeline, the depth and complexity of the view built Optimize.

PowerScrollView card fragmentation optimization

The second figure 2 card is the early search results page of the idle fish, and it is not a waterfall flow. To view the Timeline chart when the card is created (adding DX Widget creation and PerformLayout overhead), you can find that the complexity of the card creation is extremely large. On the normal mid-range machine, the UI Thread consumes more than 30ms, to be optimized to 16.6ms It is very difficult to use routine optimization. For this purpose, two cards can be disassembled, and each frame is used to render.

Directly see the source code, the basic idea is to mark the card widget, when the card is true, the right card first _BuildPlaceHoldercell builds the Widget (empty Container), and register the next frame. In the next frame, the right card is modified with NeedShowRealcell for True, and self-laminate, and then build real content.

Is it delayed to build a true content of the card, will it affect the display content? Because the FLUTTER list has a cacheextends area on the visual area, this part of the area is not visible. In most scenarios, users don’t see the scene of the blank card.

Also using the FLUTTER BENCHMARK tool to perform performance test, you can see 90 points before and after the card division, 99 packet consumption has a significant downgrade, and the number of lost frames is also reduced from 39 to 27.

Note Here, when listening to the next frame, you need widgetsbinding.instance.scheduleframe to trigger the RequestFrame. Because when the list is displayed, it is possible because there is no callback from the next frame, resulting in the task of the delay display queue, eventually makes the first screen content display is incorrect.

Delayed framing optimization ideas and suggestions

Comparison of Flutter and H5 design:

  1. DART and JS are single-threaded models that need to be sequenced and deserialized across threads;

  2. Flutter Widget is similar to H5 VDOM, there is a DIFF process.

Early Facebook In React Optimization, the Fiber Architecture is proposed: Based on the VDOM Tree’s Parent Node → Sub-node → Brothers Node → Sub-node, the VDOM Tree is converted to the Fiber data structure (chain structure), and the reconcile phase is implemented. Interrupt recovery; based on the Fiber data structure, the control section continues in the next frame.

Based on React Fiber thinking, we propose its own delayed framing optimization, not just left and right card size, further, render content disassembled as the current frame task, high-excellent delay task and low delay tasks, the upper screen priority is sequentially changed Low. Where the current frame task is the left and right white Container; the high-optovel delay task is exclusively frame, where the picture portion also uses Container placeholders; in the idle fish scene, we dismantled all DX image widget from the card, as low as low Excellent delay tasks and is set to no more than 10 in one frame consumption.

By disassembling the 1 frame display task to 4 frames, the highest UI on the high-end machine will be optimized from 18 ms to 8 ms.

Description 1: Different business scenes, high-yogle and low-probing task settings have different description 2: Slide on the low-end machine (such as Vivo Y67), the sub-frame scheme will let the user see the list whitening and content Upable process

FLUTTER-DYNAMICX Component Optimization – Principle Explanation

Edit the "Class Android Layout DSL", compile the binary DX file. The end side is downloaded, loaded, and resolved, and the WidgetNode Tree is generated. See the right figure.

After the business data issued in the background, the Widget Tree is generated by recursively traversing WidgetNode Tree, and finally appears.

Description: Flutter Dynamicx Reference Ali Group DSL Rules Realization

FLUTTER-DYNAMICX Component Optimization – Cache Optimization

I know the principle, it is easy to discover the flow in the red box in the picture: binary (template) file parsing load, data binding, Widget dynamic creation has certain overhead. To avoid repeated overhead, we have cached DXWIDGETNODE and DXWIDGET, and the blue selection code shows the Widget cache.

FLUTTER-DYNAMICX Component Optimization – Independence ISOLATE Optimization

In addition, the above logic is placed in a stand-alone ISOLATE, and the maximum amount is lowered to the lowest. After the line technology grayscale AB experiment, the average carton bad frame ratio is reduced from 2.21% to 1.79%.

FLUTTER-DYNAMICX Component Optimization – Hierarchical Optimization

FLUTTER DYNAMICX provides class Android Layout DSL, adds Decoration layers to implement each control Padding, Margin, Corner, adds the Decoration layer; to implement the DXContainerRender layer. Every layer has its own clear duty, the code level is clear. However, since the increase in 2 layers caused the Widget Tree hierarchy, the DIFF logic of 3 trees became complicated and the performance becomes low. To do this, we merge the Decoration layer and the DXContainerRender layer, see the middle Timeline diagram, which can be found that the optimized flame grading and complexity becomes low. After the line technology grayscale AB experiment, the average carton bad frame ratio is reduced from 2.11% to 1.93%.

Performance measurement and devtool extension

Tell the optimization tool, which is described here to make a measure of how to measure, and the build / extension of the tool.

Offline scene – Flutter BenchmarkWhen the FLUTTER is detected, the calculation consumption on the UI Thread and Raster Thread is required. So the Flutter optimizes before and after comparison, using the time consuming data of the UI Thread and Raster Thread of each frame.

In addition, the fluency performance value is affected by the operating gesture, the scrolling speed, so the error based on the measurement results of manual operations will have errors. Here, use the WidgetController control list control FLING.

The tool provides the interval between the scrolling speed, the number of scrolls, the scroll, and the like. After the scrolling test is completed, the data is displayed by the UI and Raster Thread frame, 50 points, 90 points, and 99-positioned frame consumption, and give performance data from a variety of dimensions.

Offline scenario – Based on the recording screen

Flutter Benchmark gives multi-dimensional measurement data at the Flutter page, but sometimes we need a horizontal comparison competition app, so we need to have a tool transverse to more different technologies. The idle fish is self-developed in the Android side to self-developed the recording screen data. Imagine the mobile phone interface into multiple screens, get the screen data (byte arrays) (byte arrays) by sending VirtualDisplay, interval 16.6 ms, using the Hash value of the byte array represents the current picture, the current 2 The Hash-read hash value is unchanged, and the Carton is considered.

In order to ensure that the fluency detecting tool app itself does not have a carton, it is read, which is compressed, and the compression ratio on the low-end machine is higher.

Through the detection of the tool without invading, a rolling test can be detected, the average FPS value (57), the frame distribution is variance (7.28), 1S time, the large number of large cards (0.306), large card cumulative time (27.919). Intermediate array display frame distribution: 371 represents the number of normal frames, 6 generations 16.62ms of small cardon quantity, 1 generation 16.63MS quantity.

Here is the definition of the big Carton: Carton, greater than 16.6 * 2 ms.

Offline Scene – Performance Detection Based on DEVTOOL

In addition, the scenes of the idle fish are also extended DevTool. In a Timeline map extended time-consuming, greater than 16.6ms red highlight, convenient development.

Online scene-Flutter high available detection FPS implementation principle

Online scene, idle fish self-developed Flutter high available. The basic principle is based on 2 events:

  • Ui.window.onbeginframe event

    • Engine notifies the VYSNC signal arrival, notify UI Thread to start preparing the next frame building

    • Trigger schedulerbinding.handlebeginframe callback

  • Ui.window.ondrawframe event

    • Engine Notification UI Thread Start Draw Next Frame

    • Trigger schedulerbinding.handledrawframe callback

Here we have recorded a frame start event before the Handlebeginframe processing, and the end of the frame is recorded after HandledrawFrame. Each frame here needs to calculate the list control offset value, and the specific code implementation is implemented. When the entire accumulated exceeds 1, executes a calculation, filtering out the scene without scrolling, calculates the FPS value using each frame.

Online Scene – FlutterBlockcanary Line Stack Stack Detection

After using Flutter high available to get the online FPS value, how to locate the stack information, you need to collect stack information. Free fish collects carton stacks using the self-developed Flutterblockcanary. The basic principle is that the signal is transmitted in the C layer, such as 5ms once, each signal receives the Dart Ui Thread stack collection, the resulting series of stacks are aggregated, and the same stacks in a row are considered to have occurred in Carton, this This stack is the stack of Carton we want.

The following figure is the stack information collected by Flutterblockcanary, and the middle framefpsRecorder.getscrolloffset is a Carton call.

Online scene – FlutterBlockcanary Detects overreservation

In addition, FlutterBlockcanary also integrates over-rendering detection capabilities. Replace the Buildowner object by replying widgetsflutterbinding, replacing the buildowner object, and rewrive the ScheduleBuildFor method to intercept Element. Based on the dirty ELEMENT node, extract the depth of the dirty node, the number of direct child nodes, the number of all child nodes.

Based on the number of all child nodes, in the idle fish details page, we are positioned to the "Quick Question View" during scrolling, and the number of transes and all child nodes are too large. View the code, positioning the view hierarchical level, by sinking the view to the leaves node, the number of stasible Build nodes is optimized from 255 to 43.

FLUTTER sliding curve optimization

The front told Tarton optimization means and measures and standards are mainly surrounded by FPS. But from the user’s physical feel, we found that Flutter also has many optimal points.

FLUTTER list slide curve and native curve

Compare the scroll curve of OFFSET / TIME, you can find that the Flutter BouncingScrollsimulation and iOS scroll curve are close, Clampingscrollsimulation and RecyClerView are close. Check the Flutter source code, it is true.

Because BouncingScrollsimulation has rebound, many pull-down refreshes and load more features are based on BOUNCINGSCROLLSIMULATION package, which causes the Flutter page sliding, physical and native Android pages inconsistent.

Flutter list performance and optimization under fast sliding

Although the Clampingscrollsimulation slides and Android RecyclerView is close, but in the quick sliding scenario, you can find that the flutter list scrolls quickly stops, and quickly slides. For the reason, you can see the moment that the sliding curve is stopped, and the speed is not a decline, and it will speed up, finally reach the end point, and stop. Based on the source code formula, the curve can be discovered that flutter clampingscrollsimulation is approximated by the Formula Fitting Method to approximate the Android RecyclerView Curve. In the case of rapid sliding, the focus of the formula curve is not 1 corresponding value, but the right image is broken, the speed will become fast.

It can be understood that the FLUTTER’s formula fit is not ideal. In the near future, there is also a PR proposed using DART to implement the RecyclerView curve.

Flutter list performance and optimization in the case of Carton

The first chapter is mentioned in the case of the same FPS, such as the FPS 55, the native list feels smooth, and the styles of the FLUTTER list are more obvious. One reason here is that the native list usually has multiple thread operations, and there is a lower probability of the big Carton; the other reason is that the same small carton’s body, FLUTTER has obvious statter, and the native list can’t feel. So why?

When we build cards, we deliberately create small Carton, compare the flutter list and RecyclerView before and after, and you can find that RecyclerView Offset does not hop, and the Flutter curve has a lot of burrs, because Flutter scrolling is based on D / T curve calculation, When a carton occurs, △ t doubles, and OFFSET also trips. It is also because of time pause and offset jump, let users know that the Flutter list is not unstoppable in small Carton.

By modifying the Y=D (T) formula, in the case of Carton, ΔT-16.6ms will ensure that the small Carton case is not hopped. In the case of Great Carton, it is not necessary to reset the ΔT to 16.6ms, because in the parking time, it has been clearly allowed to give the user to feel the carton, OFFSET does not have a trip only to make the list rolling distance short.

Performance optimization

Finally share some suggestions for performance optimization.

  1. In optimization, we should pay more attention to the user’s body, not only the performance value. The upper right map is visible, even if the FPS value is the same, but the taste occurs, the body feels clearly; the bottom of 2 game recording screens, the left side average 40 fps, the average of 30 fps, but the body feels is more smooth .

  2. Not only should I pay attention to the performance of UI Thread, but also pay attention to the overhead of Raster Thread, such as the characteristics / operation of Save Layer, but also causing Carton.

  3. In terms of tool, it is recommended to use different tools in different scenarios. It should be noted that the problem of tool detection is a stable reproduction problem or the occasion of data jitter. In addition, it is also necessary to consider the performance overhead of the tool itself, and the tool itself needs to be as low as possible.

  4. In terms of optimization ideas, we must broaden the direction. Most optimized ideas of Flutter are optimized computing tasks; and multithreading direction is not, refer to the independent ISOLATE Optimization of Flutter Dynamicx; in addition, it is difficult to digestive tasks for one frame Whether it is possible to disassemble multiple frame time, try to make a card per frame, priority to the user.

  5. Finally, I recommend paying attention to the Flutter community. The Flutter community continues to have a variety of optimization, regularly upgraded Flutter or dimensions, CHERRY-PICK optimization submission, is a good choice.

Performance analysis tool usage suggestions

Flutter tool, the first push is the official devtools tool, the Timeline and CPU Flammatic maps can help us discover problems well; in addition, Flutter also provides a wealth of Debug Flags to assist our positioning problems, familiar with each Debug switch Role, I believe that there will be no homage to our daily research and development; in addition to official tools, performance logs are also good auxiliary information, as shown in the lower right corner, the idle fish Fish-Redux component outputs the task overhead in the scroll, can It is convenient to see that at that moment.

Performance analysis tools themselves

Performance testing tools inevitably have certain overhead, but must be controlled within an acceptable range, especially on the line. A case in front sharing the FLUTTERBLOCKCANARY detection tool, discovers the framefpsRecorder.getscrolloffset time consumption, and the logic is just that Flutter is highly available to scroll offset. See the right front source code of the right picture, each frame needs to be recursively traversed to collect RenderViewPortBase, which is a small overhead. Finally, we avoid the repetition calculations during the scroll through the cache optimization.

Carton optimization suggestions

Reference official documents and excellent performance articles, precipitated a lot of routine optimization methods in the UI and GPU side, such as refreshing the minimum widget, using itemextent, recommended using Selector and Consumer, etc., avoid unnecessary DIFF computing, layout calculation, etc. Reduce SAVELAYER, replace half-transparent effects using images, alleviate the overhead of the Raster thread.

Because of the reasons, only part of the sequence, more common optimization suggestions see the official documentation.

Use the latest Flutter Engine

As mentioned earlier, the Flutter community is also active, Framework and Engine layers have an optimized PR income, which mostly can make the business layer without perception, and better optimize performance from the bottom viewing angle.

Here, there is a typical optimization scheme: existing flutter solution: When each VSYNC signal arrives, it triggers the build operation. At the end of Build, start register the next vsync callback. In the case where a carton does not occur, see Figure Normal. However, in the case of carton, see Figure Actual Results, just over 16.6ms here, because it is a registration listening to the next vsync callback, triggered the next build, for this, a large amount of time in the middle. Obviously, what we expect is, at the end, immediately execute, assuming enough to execute enough, this time the screen is still smooth.

If the team allows, it is recommended to upgrade the flutter version regularly; or maintain your own Flutter independent branch is also a good choice. From the community Cherry-Pick optimization, you can guarantee that business stability can also enjoy the community contribution. In short, I recommend you to pay attention to the community.


In summary, the challenges, monitoring tools, optimization methods, and recommendations are shared by Flutter fluidity optimization. Performance optimization should be people-centered, develop monitoring indicators and optimization points from actual physical fitness; fluency optimization is not one, the above share is not all, there are many optimized means to pay attention: How to better multiplex Element, how to avoid Platform Thread busy leading to vsync signal lacking, etc., is a point that can be concerned. Only the continuous technical enthusiasm and conscious spirit can optimize the APP performance to the ultimate; technical teams also have access to open source communities, other teams / companies to connect, That stone stone, Can be attacked.