The two universities issued a judicial interpretation: the crime of cheating in exams can be severely punished for up to 7 years.

Cctv newsYesterday (3rd), the Supreme People’s Court and the Supreme People’s Procuratorate jointly issued the Interpretation on Several Issues Concerning the Application of Laws in Handling Criminal Cases such as Organizing Cheating in Examinations, which severely punished cheating in four categories of "national examinations prescribed by law", such as college entrance examination, postgraduate examination and judicial examination.

According to the criminal law, the crime of cheating in organizing exams, illegally selling, providing test questions and answers, and the crime of replacing exams are applicable to "national exams prescribed by law". Explain that the first article mainly clarifies which exams belong to the "national exams prescribed by law".

Jiang Qibo, Director of the Supreme People’s Court Research Office.Article 1 of the Interpretation stipulates that "the national examination prescribed by law" refers to the examination prescribed by laws formulated by the National People’s Congress and its Standing Committee.

It is clear that cheating in four types of exams, such as college entrance examination, is a crime.

This explanation makes it clear that the following examinations belong to the "national examinations prescribed by law": (1) national education examinations such as the entrance examination for ordinary colleges and universities, the entrance examination for graduate students, the self-study examination for higher education, and the entrance examination for adult colleges and universities; (2) central and local civil service recruitment examinations; (3) National unified legal professional qualification examination, national teacher qualification examination, national unified examination for certified public accountants, accounting professional and technical qualification examination, asset appraiser qualification examination, doctor qualification examination, licensed pharmacist professional qualification examination, registered architect examination, construction engineer qualification examination and other professional and technical qualification examinations; (4) other national examinations organized by the central or local competent departments and industries according to law.

On this basis, the third paragraph of Article 1 of the Interpretation further stipulates that the special types of enrollment, special skills tests, interviews and other examinations involved in the above-mentioned examinations belong to the "national examinations prescribed by law".

Criminal Law: The punishment for cheating is heavier if the circumstances are serious.

According to the provisions of the Criminal Law, whoever organizes cheating or provides cheating equipment or other help for others to commit the crime of organizing cheating in the national examination prescribed by law constitutes the crime of organizing cheating in the examination, and is sentenced to fixed-term imprisonment of not more than three years or criminal detention, with a fine or a single fine; If the circumstances are serious, he shall be sentenced to fixed-term imprisonment of not less than three years but not more than seven years and shall also be fined.

So which behaviors are serious? The judicial interpretation released yesterday also specifically clarified the serious circumstances.

The explanation is clear. The college entrance examination, postgraduate entrance examination and civil servant recruitment examination have high social concern, great influence and wide coverage. The direct stipulation of organizing cheating in these three types of exams is "serious circumstances".

Explain that it is clearly defined as "serious circumstances" that the exam is postponed, cancelled or enabled due to cheating. According to the relevant person in charge of the Supreme Law, some cheating cases are committed by exam staff, especially in cheating cases before the exam, the "shadow" of "inside ghosts" can often be seen, and the actor illegally obtains exam questions and answers by bribing a specific person to know before the exam, and then organizes cheating in the exam.

Jiang Qibo, Director of the Supreme People’s Court Research Office:Examination staff violate their responsibilities to organize cheating in exams, which is more subjective and vicious, so the Interpretation defines it as "serious circumstances". Organizing candidates to cheat across provinces, autonomous regions and municipalities directly under the Central Government is very harmful, so the Interpretation defines it as "serious circumstances".

The Interpretation defines cheating in exams for many times, cheating for more than 30 times, and providing more than 50 pieces of cheating equipment as "serious circumstances". According to the relevant person in charge of the Supreme Law, according to the different exams involved, the amount of illegal income from organizing cheating in exams or providing cheating equipment varies greatly.

Based on the consideration of severely punishing the crime of cheating in organizing exams, the Interpretation defines the illegal income of more than 300,000 yuan as "serious circumstances".

What equipment belongs to "cheating equipment"

According to the criminal law, the crime of cheating in organizing exams involves providing cheating equipment for others to commit the crime of cheating in organizing exams. So how to identify "cheating equipment"? Let’s see how it is stipulated in the Judicial Interpretation.

The judicial interpretation stipulates: "The programs and tools with the functions of avoiding or breaking through the safety management measures to prevent cheating in the examination room, obtaining, recording, transmitting, receiving and storing examination questions and answers, and the programs and tools specially designed for cheating shall be recognized as the second paragraph of Article 284-1 of the Criminal Law ‘ Cheating equipment ’ 。”

Jiang Qibo, Director of the Supreme People’s Court Research Office:According to this, button-type digital cameras and glasses-type close-up devices that can send and receive examination questions and answers by disguising themselves to avoid examination in the examination room can all be regarded as "cheating equipment".

On this basis, in order to unify the identification procedure of cheating equipment, the second paragraph of Article 3 of the Interpretation further stipulates: "Whether it belongs to the second paragraph of Article 284-1 of the Criminal Law ‘ Cheating equipment ’ It is difficult to determine, according to the report issued by the public security organ at or above the provincial level or the examination department, combined with other evidence to make a determination; Involving special spy equipment, special equipment for eavesdropping and stealing photos, ‘ Pseudo base station ’ And other equipment, in accordance with the relevant provisions of the identification. "

How to identify the cheating that was investigated before the exam began?

In addition, from a practical point of view, many cases of cheating in organizing exams are investigated before the exam begins. In this case, the purpose of cheating in organizing exams has not been achieved. Should it be regarded as a crime accomplished or attempted? This judicial interpretation has been clarified.

According to the relevant person in charge of the Supreme Law, the constitutive elements of the crime of organizing cheating in exams are organizing cheating and providing cheating equipment or other help for others to commit the crime of organizing cheating in exams. As long as the behavior of organizing cheating in exams has actually seriously endangered the order of exams, it should be regarded as a crime accomplished, and whether the purpose of cheating is realized should not affect the establishment of the crime accomplished.

Jiang Qibo, Director of the Supreme People’s Court Research Office:In order to unify the application of the law and severely punish the crime of cheating in organizing exams according to law, Article 4 of the Interpretation makes clear the relevant issues. If cheating in the exam is caught before the exam begins, but the exam questions and answers have been illegally obtained or there are other circumstances that seriously disturb the order of the exam, it shall be deemed that the crime of cheating in the organization exam has been completed.

Illegally providing test questions shall be punished for more than three years.

Explain that there are also two statutory penalties for the crime of illegally selling, providing test questions and answers. Among them, if the circumstances are serious, they shall be sentenced to fixed-term imprisonment of not less than three years but not more than seven years and fined.

Jiang Qibo, Director of the Supreme People’s Court Research Office:Article 6 of the Interpretation stipulates: "For the purpose of cheating in exams, illegally selling or providing questions and answers of national exams prescribed by law to others, if the questions are incomplete or the answers are not completely consistent with the standard answers, it will not affect the determination of the crime of illegally selling or providing questions and answers."

Clear rules for dealing with crimes instead of exams.

According to the criminal law, a person who takes the national examination in place of others or lets others take the national examination in place of himself as stipulated by law constitutes the crime of taking the examination instead, and shall be sentenced to criminal detention or public surveillance, and shall also or only be fined.

According to the relevant person in charge of the Supreme Law, in order to take into account the differences in the circumstances and circumstances of taking the test, the types of tests involved are different. In order to reflect and implement the criminal policy of combining leniency with severity, and to urge the actors who take the test to repent and turn over a new leaf, if they do show remorse, they can be suspended according to law.

Jiang Qibo, Director of the Supreme People’s Court Research Office:Article 7, paragraph 2, of the Interpretation specifically stipulates: "If the perpetrator’s crime is minor, he does show remorse, and comprehensively considers the actor’s taking the test and the type of the test, he can declare probation if he thinks that it meets the applicable conditions for probation; If the circumstances of the crime are minor, no prosecution may be instituted or criminal punishment may be exempted; If the circumstances are significant, minor and harmless, they will not be treated as crimes. "

The explanation also clarified the rules for dealing with the crime of cheating in exams other than the national exams prescribed by law.

Jiang Qibo, Director of the Supreme People’s Court Research Office:Explain the provisions of Article 10: "Whoever organizes cheating, provides cheating equipment or other help for others to organize cheating, or illegally sells or provides test questions and answers in other examinations other than the national examinations prescribed by law, which meets the constitutive requirements of crimes such as illegally obtaining state secrets, illegally producing and selling eavesdropping, stealing special equipment, illegally using eavesdropping, stealing special equipment, illegally using information networks, and disturbing the order of radio communication management, shall be investigated for criminal responsibility according to law."

News observation: "quantity" and "quality" rise together, and the consumption of new energy vehicles in China is getting better and better

CCTV News:Data show that by the end of the first quarter of this year, the cumulative promotion of new energy vehicles in China is expected to exceed 10 million. The relevant person in charge of the National Development and Reform Commission said on March 26th that the new energy automobile industry in China has gradually entered the market-driven stage. In the new development era, vehicle enterprises will not add new production capacity until the existing base reaches a reasonable scale. While promoting the accelerated development of the new energy automobile industry, it pays more attention to the overall improvement of quality and brand.

The proportion of private consumption of new energy vehicles increased from 47% to 78%.

Lin Nianxiu, deputy director of the National Development and Reform Commission, said that in 2021, new energy vehicles will be driven by both market and policy. Compared with the initial period of the Thirteenth Five-Year Plan, the proportion of private consumption has increased from 47% to 78%, and the proportion of private consumption in non-restricted cities has increased from 40% to 70%. While the degree of marketization is increasing year by year, it is necessary to make overall arrangements for the high-quality development of the new energy automobile industry.

Lin Nianxiu, Deputy Director of the National Development and Reform Commission:Guide industries to gather in areas and main bodies with good development foundation and full capacity utilization, and focus on building internationally competitive industrial clusters in the Yangtze River Delta, Pearl River Delta, Beijing-Tianjin-Hebei, Chengdu-Chongqing and other regions. (In addition, vehicle enterprises should highlight the key layout, rely on the development of existing production bases, and no new production capacity will be distributed until the existing bases reach a reasonable scale.

China strengthens clean-up and rectification of illegal projects of new energy vehicles.

Lin Nianxiu said that China will also strengthen the clean-up and rectification of illegal projects of new energy vehicles, and investigate and deal with illegal behaviors such as unapproved construction, zero-batch construction, and construction while approving. At the same time, standardize the merger and reorganization of vehicle enterprises, and vigorously promote the withdrawal of backward enterprises and ineffective production capacity.

By the end of the first quarter, the cumulative promotion is expected to exceed 10 million vehicles.

It is reported that by the end of the first quarter of this year, the cumulative promotion of new energy vehicles in China is expected to exceed 10 million. New progress has been made in key technologies of new energy vehicles, positive progress has been made in sodium ion batteries and modular power exchange, and the computing power of artificial intelligence has reached the international advanced level. At the same time, new energy vehicles still have some shortcomings in terms of quality and safety, low-temperature adaptability, etc. The integrated development of electrification, intelligence and networking needs to be continuously deepened.

Xin Guobin, Vice Minister of Industry and Information Technology:In 2021, China enterprises obtained more than 30,000 patents related to new energy vehicles, accounting for 70% of the global total, and saw new achievements in comprehensive income. By the end of 2021, the cumulative consumption of new energy vehicles was about 1.6 trillion yuan, driving the output value of upstream and downstream industrial chains to about 4.8 trillion yuan, and reducing carbon dioxide emissions by more than 100 million tons.

We will continue to strengthen top-level design and optimize supporting policies.

Lin Nianxiu said that the steady growth of the automobile industry has provided strong support for reviving the industrial economy. In particular, the development of new energy vehicles in China has achieved new breakthroughs and become a new bright spot for the high-quality development of the automobile industry. However, problems such as blind investment and disorderly development of new energy vehicles still exist to varying degrees. In the future, we will continue to strengthen the top-level design, continuously optimize supporting policies such as scientific and technological innovation, industrial layout, tax incentives, and infrastructure construction for charging and replacing electricity, and pay more attention to the overall improvement of quality and brand while promoting the accelerated development and growth of the new energy vehicle industry.

Popular "CHAGPT" and the prospect of AI

1. what is chagpt?

It is a natural language model GPT (Generative Pre-trained Transformer) released by OpenAI a few years ago. The principle of GPT is: first, provide it with a huge corpus (directly grabbed from the Internet), and let the model break up, mark and learn these texts through hundreds of billions (175 billion) parameters to build a complex prediction model; Then, according to this prediction model, it is judged which word a word should take in this situation. In this way, one word is strung together to form a paragraph or an article.

Its core is: building GTP model (structure)-model pre-training and self-learning to build internal feedback (motivation)-Chat is to build a friendly user interface and interactive way to realize external feedback (interactive layer).

2. What can chatgpt do now?

A, answer questions; Chatgpt’s actual expression ability is better than many people; Because of the "breadth of self-learning", the content it answers can often give the questioner a new angle or a perfect framework;

B, write an article; Also based on the "breadth of feeding", we can give quality results such as emails, reports, papers, planning schemes, etc.

C, summarizing and refining; Can help you listen to videos, podcasts, articles, etc., and summarize the main points in concise language;

D, generating codes; Also based on "feeding professionalism", its code generation ability is also very strong;

3. Disadvantages of chatgpt:

A, the level of input information: ChatGPT can’t generate information out of thin air, and all its knowledge can only come from the corpus it is fed. Obviously, the answers it can provide and the contents it can output will not exceed the average level of these corpora; It is essentially a kind of second-hand information. It is neither accurate nor traceable.

B, moral and ethical issues: under the current modeling conditions, there are negative and "deviation" phenomena;

C, the answer error rate is high (about 5%): it is difficult for us to see where the answer given by ChatGPT is wrong, which will lead to potential risks to users;

4. the prospect of chatgpt:

A. Search: Looking back at people’s search for information, in the search 1.0 stage, they can only go to the library to look up information; Search 2.0 stage

Information is digitized, and information can be queried and exchanged through the Internet; However, the information is too complicated and needs to be effectively screened, refined and integrated, which is the search 3.0 stage; It solves the contradiction between "too much information" and "too little attention"

B. Reading: In the future, each of us may have our own "exclusive doctor, lawyer, financial manager", etc. No matter what questions we want to consult, ask artificial intelligence directly, and it will give the latest, most comprehensive and accurate answer;

C. Writing: We no longer need to spend a lot of energy on writing plans and documents. We just need to think and come up with all kinds of ideas, themes, ideas, etc., and then tell these ideas to artificial intelligence, give it enough information, and it can be automatically output.

5. Future prospects of AI:

A. The future of AI will become the same infrastructure as water and electricity; Just as the first industrial revolution harnessed coal, the second industrial revolution harnessed oil, electricity and the third industrial revolution harnessed information; The next revolution will be to control "data and computing power", and the future intelligence will become the most basic facilities and mass goods of the whole society.

B. For individuals, AI may not make you unemployed, but those who will use AI in the future will make you unemployed. That is to say, if employees can’t strive to upgrade to High Concept (high concept, responsible for deep thinking) or High Touch (high experience, responsible for interpersonal interface), they will be gradually eliminated.

The Frontier of Science and Technology | See how AI doctors crack down on "invisible killers" that endanger the health of teenagers

Cover journalist Tan Yuqing Bian Xue

In recent years, scoliosis has become a common disease that harms teenagers, making it difficult for sick teenagers to straighten their backs. According to statistics, the number of scoliosis among primary and secondary school students in China exceeds 5 million, and it is still increasing at a rate of about 300,000 per year. Scoliosis has become the third major disease that harms the health of children and adolescents after obesity and myopia.

Early detection, early diagnosis and early treatment are the key points to combat scoliosis, otherwise it may develop into a very serious deformity, which may affect cardiopulmonary function and even lead to paralysis in severe cases.

Scoliosis model

In the past, doctors would diagnose scoliosis by manual measurement and X-ray screening, but with the integration of artificial intelligence (AI) into medical imaging technology, this step may be further optimized. In the screening stage, it is only necessary to "simply take pictures" to preliminarily determine whether scoliosis occurs, and in the diagnosis stage, the "experienced" AI system can also assist doctors to quickly read films for diagnosis.

Why can taking pictures replace x-rays? How does AI system assist doctors in screening and diagnosing scoliosis? Recently, the cover journalist explored the development of AI+ medical imaging technology.

It only takes a few seconds. Did the AI system tell you about scoliosis?

In the "simulated physical examination room", the reporter saw the hardware part of the spine AIS intelligent screening and diagnosis system (hereinafter referred to as the "system")-a rectangular metal frame about 2 meters high, with a group of small cameras in the center of the top. It looks simple, but the effect is not simple. The reporter’s on-site experience found that it took only a few seconds from detection to obtaining the report results.

The hardware part of the system is the camera.

"As long as the examinee stands in a standard position and poses Adam’s position to expose his back, the system can quickly complete the screening by using an infrared depth camera to collect information on his back." According to Fan Jipeng, the person in charge of the Shuangxin Department of Chengdian Gold Disk, the system will map and transform the image information collected by the camera to get the depth information of multiple posture key points on the back, so as to calculate the back asymmetry index and judge whether the subject may have scoliosis.

Schematic diagram of screening process

He said that this intelligent system will get closer and closer to the level of X-ray diagnosis by constantly learning actual cases and optimizing existing algorithms. While ensuring the accuracy and efficiency of screening, it can also prevent the teenagers being tested from being exposed to X-ray radiation.

This new technology may help to better implement the scoliosis examination project that was included in the physical examination of students in 2022. "We think the greatest significance of the screening system is that it can quickly complete large-scale examinations, so that children with scoliosis who have not yet been discovered will not be delayed."

Interface of scoliosis diagnosis system

In the diagnosis stage, the intelligent system is also a good assistant for doctors. Fan Jipeng explained that in the traditional process, in order to diagnose scoliosis, doctors need to measure the Cobb angle of the spine with a ruler, but this is time-consuming. Different doctors will make some errors when measuring by hand. Doctors with less experience may need to consult for scoliosis with large curvature, and the diagnosis time will be prolonged. However, after deep learning, the artificial intelligence system can accurately read and measure the film within 3~5 seconds, and give diagnosis suggestions.

At present, the system has completed the screening and diagnosis of more than 5,000 cases of scoliosis. "Now we are cooperating with Electronic Science and Technology University Hospital, Zhongshan Pok Oi Hospital and Shenzhen Children’s Scoliosis Center, and this number will be continuously updated."

Training "AI Good Doctor" by "Engraving" Algorithm of Expert Experience

"The accuracy of top doctors’ diagnosis of scoliosis may be 85%~90%, and the overall accuracy of our system will continue to approach this figure." Fan Jipeng said that at present, of course, the accuracy of top experts is higher, but compared with ordinary doctors, the system may have exceeded their basic level.

So, what gives the diagnosis system the ability to catch up with top experts? The answer is the experts themselves.

"When experts mark the angles of thousands of scoliosis cases, the system will learn based on this and solidify the experience of top experts into the algorithm, thus reaching a higher diagnostic level." In Fan Jipeng’s view, although the system is not as good as top experts, it is used to assist ordinary doctors in diagnosis or help improve their medical level.

The marked samples provided by human experts are the "success stories" of artificial intelligence doctors, but Fan Jipeng said that this is also one of the difficulties in the development of AI doctors. Different races, even people in different regions, will have certain differences. If the diagnosis is accurate enough, researchers need to collect as many samples as possible for AI to learn.

At present, the real large-scale landing of the system still faces some difficulties in the process. "How to make the medical examiners go through the inspection process quickly and how to ensure that their Adam posture is standard requires some corresponding training."

Therefore, the system will learn more practical cases, further optimize its algorithm program, continuously improve the diagnostic accuracy, and design detailed operating standards for the system, "for example, what is the standard Adam position, how to do it well, etc."

Camara disappeared, many people in Rome were abandoned? Going his own way, Mourinho’s embarrassment and stubbornness

A paradox lies before Mourinho.

Is Rome useless or useless? In March, halfway through the Devil’s schedule, Mourinho is worried about a long list of injuries. At present, there are important players absent from the third-line positions except the goalkeeper. The media are talking about the need for Rome to make a rotation, but this is Mourinho’s embarrassment.

Rotation. Who? Take the midfield as an example. I’m afraid Marty Camara himself can’t remember the last time he played. Mourinho would rather let Cristante and Ma Diqi fight repeatedly than send him to play. Even the teenager Tasirovich has temporarily replaced him, while Camara has almost disappeared. Some media rumors that he is injured, but since 2023, he has been healthy enough to enter the big list and sit on the bench. Some critics say that Rome will use him only if it is necessary, mainly because he is worried that his appearances will be full.

Not only Camara, but also young players such as volpato and Tacirovich, who had been highly anticipated by Mourinho, have lost their chances in the standing list after a period of tempering. Young Beauvais was once in Mourinho’s plan, but he still couldn’t play the main role after the game was tempered. Rome had hoped to use him and volpato as additions to the purchase of Fratesi during the winter transfer.

Also gradually disappearing in the starting lineup is celik, the winner of the bid. celik has not played in four games since he came out after Rome defeated Verona’s substitute Solbakken 1-0 on February 20th. Some media have analyzed that the confidence of Turks has been affected since the goal against cremona, and the strong comeback of Karsdorp and the rapid growth of Zalewski have compressed the space of celik.

Of course, for coach Jose Mourinho, he is more aware of different tactics and player arrangements for different opponents, just like when he played against Real Society, he used Karsdorp accurately, which inspired the fighting spirit and energy of the Dutch. Similarly, Camara, Tasirovich and celik do not mean that they have been completely abandoned. They can only play when Mourinho thinks fit. In the past, many media questioned that Mourinho often went his own way and didn’t know how to rotate. In fact, Rome suffered from rotation at many times this season. In the two games against cremona, it happened that Mourinho tried to rotate, and the result was without exception.

This is also Mourinho’s embarrassment, rotation? Losing, not rotating? Lack of physical strength may lose the game. In desperation, he had to give up his own ban, so as to encourage and infect the only main lineup, and let them believe that they have the ability to conquer everything and believe in the strength of team and blood. However, his inner helplessness has long been revealed. At the press conference after the Europa League match, he envied Bayern’s substitute lineup and said that even if those people only gave him one player, it would be good. This is also his difficulty to some extent. In Rome, it is not that no one is available. The real problem is that some people are really useless.

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.