CN111611047A - Method and system for optimizing list performance of mobile App - Google Patents

Method and system for optimizing list performance of mobile App Download PDF

Info

Publication number
CN111611047A
CN111611047A CN202010471309.4A CN202010471309A CN111611047A CN 111611047 A CN111611047 A CN 111611047A CN 202010471309 A CN202010471309 A CN 202010471309A CN 111611047 A CN111611047 A CN 111611047A
Authority
CN
China
Prior art keywords
rendered
list
label
rendering
tag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010471309.4A
Other languages
Chinese (zh)
Inventor
徐斌
陈云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Original Assignee
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Happly Sunshine Interactive Entertainment Media Co Ltd filed Critical Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority to CN202010471309.4A priority Critical patent/CN111611047A/en
Publication of CN111611047A publication Critical patent/CN111611047A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The invention discloses a method and a system for optimizing list performance of a mobile App, wherein the method comprises the following steps: obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures; and extracting a label corresponding to the element to be rendered from the buffered data, judging whether the element to be rendered is the same as the label, and if so, skipping the process of rendering the element to be rendered. According to the method and the device, when the list is slid, whether the element to be rendered is the same as the label corresponding to the element to be rendered is judged, and when the element to be rendered is the same as the label, the element to be rendered does not need to be rendered, so that the problems that the rendering process is long in time consumption and the sliding page is unsmooth are effectively solved.

Description

Method and system for optimizing list performance of mobile App
Technical Field
The invention relates to the technical field of mobile App application development, in particular to a method and a system for optimizing list performance of a mobile App.
Background
Currently, list data rendering in mobile APP is: typically in mobile apps, a list control named reclerview is used, an adapter that can render each element of the list in conjunction with a single data, and the list of data (typically containing text content, picture addresses, etc.) to which the list corresponds.
The problem with this conventional scheme is that, during the sliding process, no matter whether an element of a certain list has been rendered, the rendering process is executed again when the element is drawn into the screen from the outside of the screen, which is usually a waste, and if the element is complicated, for example, it is a horizontal secondary list, the rendering process is usually time-consuming, resulting in a stutter during the sliding process, and the requirement of high fluency cannot be met.
Therefore, how to solve the problems of long time consumption of the rendering process and unsmooth sliding of the page in the list sliding process is an urgent problem to be solved.
Disclosure of Invention
In view of this, the invention provides a method for optimizing list performance by a mobile App, which can solve the problems of long time consumption of rendering process and unsmooth sliding page.
The invention provides a method for optimizing list performance by a mobile App, which comprises the following steps:
obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures;
extracting a label corresponding to the element to be rendered from the buffered data;
and judging whether the element to be rendered is the same as the label or not, if so, skipping the process of rendering the element to be rendered.
Preferably, the method further comprises:
and when the rendering element is different from the label, rendering the element to be rendered.
Preferably, the method further comprises:
and setting the element to be rendered to a root node control of the element in a label mode.
Preferably, the determining whether the element to be rendered is the same as the tag includes:
and iteratively judging whether the elements to be rendered are the same as the members of the tags step by step.
Preferably, the step-by-step iteration of determining whether the element to be rendered is the same as a member of the tag includes:
and iteratively judging whether the number of the members or the content of the members of the element to be rendered and the label is equal step by step.
A system for a mobile App to optimize list performance, comprising:
an obtaining module, configured to obtain an element to be rendered, where the element to be rendered includes: text or pictures;
the extraction module is used for extracting a label corresponding to the element to be rendered from the buffer data;
the judging module is used for judging whether the element to be rendered is the same as the label or not;
and the skipping module is used for skipping the process of rendering the element to be rendered when the element to be rendered is the same as the label.
Preferably, the system further comprises:
and the rendering module is used for rendering the element to be rendered when the element to be rendered is different from the label.
Preferably, the system further comprises:
and the setting module is used for setting the element to be rendered to the root node control of the element in a label mode.
Preferably, the determining module, when performing the determination that the element to be rendered is the same as the tag, is specifically configured to:
and iteratively judging whether the elements to be rendered are the same as the members of the tags step by step.
Preferably, the determining module, when performing step-by-step iteration to determine whether the to-be-rendered element is the same as a member of the tag, is specifically configured to:
and iteratively judging whether the number of the members or the content of the members of the element to be rendered and the label is equal step by step.
To sum up, the invention discloses a method for optimizing list performance by a mobile App, which comprises the following steps: obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures; and extracting a label corresponding to the element to be rendered from the buffered data, judging whether the element to be rendered is the same as the label, and if so, skipping the process of rendering the element to be rendered. According to the method and the device, when the list is slid, whether the element to be rendered is the same as the label corresponding to the element to be rendered is judged, and when the element to be rendered is the same as the label, the element to be rendered does not need to be rendered, so that the problems that the rendering process is long in time consumption and the sliding page is unsmooth are effectively solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method of embodiment 1 of the method for optimizing the list performance of a mobile App according to the present invention;
fig. 2 is a flowchart of a method of embodiment 2 of the method for optimizing the performance of a list by a mobile App according to the present invention;
fig. 3 is a flowchart of a method of embodiment 3 of the method for optimizing the list performance of a mobile App according to the present invention;
fig. 4 is a schematic structural diagram of a system embodiment 1 for optimizing list performance by a mobile App according to the present invention;
fig. 5 is a schematic structural diagram of a system embodiment 2 for optimizing list performance by a mobile App according to the present invention;
fig. 6 is a schematic structural diagram of a system embodiment 3 for optimizing list performance by a mobile App according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a flowchart of a method of embodiment 1 of the method for optimizing list performance of a mobile App disclosed in the present invention may include the following steps:
s101, obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures;
when the performance of the mobile App list needs to be optimized, a key for caching the data of the user control is defined, wherein the key is a digital invariable constant and is unique in the whole App; xml in mobile App engineering, for example, defines an element named list _ item _ data _ key, type id.
Using list control listview provided by a mobile system for displaying list data; creating an adapter corresponding to the list control, and displaying a single list element according to the position of the element; preparing a memory data list to be displayed, wherein the name is assumed to be data, the data is usually a data entity in a memory and comprises text display contents and a url address of a network picture; the adapter is set to the list, and when the list element needs to be shown, a bindViewHolder method of the adapter is triggered, and the bindViewHolder gives a list element root layout with rendering, and the element with rendering is located at a coordinate index of the list.
If a list element has a relatively complex UI structure, for example, a secondary list, when the element is rendered for the first time, the corresponding data entity is bound to the root node view of the element in the form of a tag, and the data entity is used as a data cache.
When the element is rendered next time, firstly, the element to be rendered is obtained, wherein the element to be rendered comprises: text or pictures. For example, using the coordinate index, the single memory data object corresponding to the data to be exposed is named data. According to the actual business logic, the field to be displayed on the text or picture, usually a section of text or network picture address in the form of character string, is obtained from the data.
S102, extracting a label corresponding to an element to be rendered from the buffer data;
then, the tag is obtained from this element using the get tag method getTag () provided by the mobile App. That is, get the corresponding tag tagData from the root layout using getTag (key). For example, get tag (key) is used to get the corresponding tag tagData from a picture or text control.
S103, judging whether the element to be rendered is the same as the label, if so, entering S104:
then, whether the element to be rendered is the same as the tag is judged. That is, if the tag tagData exists, the tagData and the data object data are compared. For example, comparing tagData with the address of the text or picture taken.
S104, skipping the process of rendering the elements to be rendered.
And when the element to be rendered is the same as the label, the element to be rendered is not required to be refreshed, and the whole segment of rendering logic can be skipped.
In summary, in the above embodiment, when performance of the mobile App list needs to be optimized, an element to be rendered is first obtained, where the element to be rendered includes: text or pictures; and then extracting a label corresponding to the element to be rendered from the buffered data, judging whether the element to be rendered is the same as the label, and if so, skipping the process of rendering the element to be rendered. According to the embodiment, when the list is slid, whether the element to be rendered is the same as the label corresponding to the element to be rendered is judged, and when the element to be rendered is the same as the label, the element to be rendered is not required to be rendered, so that the problems that the rendering process is long in time consumption and the sliding page is blocked are effectively solved.
As shown in fig. 2, a flowchart of a method of embodiment 2 of the method for optimizing the list performance of a mobile App disclosed in the present invention is shown, where the method may include the following steps:
s201, obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures;
when the performance of the mobile App list needs to be optimized, a key for caching the data of the user control is defined, wherein the key is a digital invariable constant and is unique in the whole App; xml in mobile App engineering, for example, defines an element named list _ item _ data _ key, type id.
Using list control listview provided by a mobile system for displaying list data; creating an adapter corresponding to the list control, and displaying a single list element according to the position of the element; preparing a memory data list to be displayed, wherein the name is assumed to be data, the data is usually a data entity in a memory and comprises text display contents and a url address of a network picture; the adapter is set to the list, and when the list element needs to be shown, a bindViewHolder method of the adapter is triggered, and the bindViewHolder gives a list element root layout with rendering, and the element with rendering is located at a coordinate index of the list.
If a list element has a relatively complex UI structure, for example, a secondary list, when the element is rendered for the first time, the corresponding data entity is bound to the root node view of the element in the form of a tag, and the data entity is used as a data cache.
When the element is rendered next time, firstly, the element to be rendered is obtained, wherein the element to be rendered comprises: text or pictures. For example, using the coordinate index, the single memory data object corresponding to the data to be exposed is named data. According to the actual business logic, the field to be displayed on the text or picture, usually a section of text or network picture address in the form of character string, is obtained from the data.
S202, extracting a label corresponding to an element to be rendered from the buffer data;
then, the tag is obtained from this element using the get tag method getTag () provided by the mobile App. That is, get the corresponding tag tagData from the root layout using getTag (key). For example, get tag (key) is used to get the corresponding tag tagData from a picture or text control.
S203, judging whether the element to be rendered is the same as the label, if so, entering S204, otherwise, entering S205:
then, whether the element to be rendered is the same as the tag is judged. That is, if the tag tagData exists, the tagData and the data object data are compared. For example, comparing tagData with the address of the text or picture taken.
S204, skipping the process of rendering the elements to be rendered;
and when the element to be rendered is the same as the label, the element to be rendered is not required to be refreshed, and the whole segment of rendering logic can be skipped.
S205, rendering the element to be rendered;
and when the element to be rendered is different from the label or the label does not exist, continuing to go through a default rendering flow to render the element to be rendered. For example, a setText method is used to set content for a text control, or a web library is used to load a web picture.
And S206, setting the element to be rendered to the root node control of the element in a label mode.
And when the element to be rendered needs to continue to go through the default rendering flow for rendering, setting the element to be rendered to the root node control of the element in a tag form. That is, the data to be rendered is bound to the control in the form of a tag in a setTag (key, data) manner.
In summary, in this embodiment, on the basis of the above embodiment, when the element to be rendered is different from the tag, the element to be rendered can be rendered, and the element to be rendered is set to the root node control of the element in the form of the tag.
As shown in fig. 3, a flowchart of a method of embodiment 3 of the method for optimizing the list performance of a mobile App disclosed in the present invention may include the following steps:
s301, obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures;
when the performance of the mobile App list needs to be optimized, a key for caching the data of the user control is defined, wherein the key is a digital invariable constant and is unique in the whole App; xml in mobile App engineering, for example, defines an element named list _ item _ data _ key, type id.
Using list control listview provided by a mobile system for displaying list data; creating an adapter corresponding to the list control, and displaying a single list element according to the position of the element; preparing a memory data list to be displayed, wherein the name is assumed to be data, the data is usually a data entity in a memory and comprises text display contents and a url address of a network picture; the adapter is set to the list, and when the list element needs to be shown, a bindViewHolder method of the adapter is triggered, and the bindViewHolder gives a list element root layout with rendering, and the element with rendering is located at a coordinate index of the list.
If a list element has a relatively complex UI structure, for example, a secondary list, when the element is rendered for the first time, the corresponding data entity is bound to the root node view of the element in the form of a tag, and the data entity is used as a data cache.
When the element is rendered next time, firstly, the element to be rendered is obtained, wherein the element to be rendered comprises: text or pictures. For example, using the coordinate index, the single memory data object corresponding to the data to be exposed is named data. According to the actual business logic, the field to be displayed on the text or picture, usually a section of text or network picture address in the form of character string, is obtained from the data.
S302, extracting a label corresponding to an element to be rendered from the buffered data;
then, the tag is obtained from this element using the get tag method getTag () provided by the mobile App. That is, get the corresponding tag tagData from the root layout using getTag (key). For example, get tag (key) is used to get the corresponding tag tagData from a picture or text control.
S303, iteratively judging whether the elements to be rendered are the same as the members of the tags step by step, if so, entering S304, otherwise, entering S305:
then, whether the element to be rendered is the same as the tag is judged. That is, if the tag tagData exists, the tagData and the data object data are compared. For example, comparing tagData with the address of the text or picture taken.
Specifically, when judging whether the element to be rendered is the same as the tag, an equals method of java objects may be used, which means that whether the members of the two objects are the same is judged by iteration step by step. And when the number of the members is not equal or the contents are not equal at any iteration level, judging that the two objects are not equal, otherwise, considering that the two objects are equal. For example, the labels taken out of the text controls are compared with the text to be displayed, and the characters are compared one by using an equals method of character strings. For example, the labels taken out of the picture control are compared with the picture addresses to be displayed, and characters are compared one by using an equals method of character strings.
S304, skipping the process of rendering the elements to be rendered;
and when the element to be rendered is the same as the label, the element to be rendered is not required to be refreshed, and the whole segment of rendering logic can be skipped.
S305, rendering the element to be rendered;
and when the element to be rendered is different from the label or the label does not exist, continuing to go through a default rendering flow to render the element to be rendered. For example, a setText method is used to set content for a text control, or a web library is used to load a web picture.
S306, setting the element to be rendered to the root node control of the element in a label mode.
And when the element to be rendered needs to continue to go through the default rendering flow for rendering, setting the element to be rendered to the root node control of the element in a tag form. That is, the data to be rendered is bound to the control in the form of a tag in a setTag (key, data) manner.
In conclusion, the invention can skip the repeated rendering of the complex elements in the list in the up-and-down sliding process of the user, thereby avoiding the pause caused by too long rendering time when the elements are scribed into the screen for the second time; the method optimizes the granularity of all texts and network pictures, shortens the rendering consumption of a single text and picture and improves the overall fluency while not influencing the overall rendering logic of elements.
As shown in fig. 4, a schematic structural diagram of a system embodiment 1 for optimizing list performance of a mobile App disclosed in the present invention is shown, where the system may include:
an obtaining module 401, configured to obtain an element to be rendered, where the element to be rendered includes: text or pictures;
when the performance of the mobile App list needs to be optimized, a key for caching the data of the user control is defined, wherein the key is a digital invariable constant and is unique in the whole App; xml in mobile App engineering, for example, defines an element named list _ item _ data _ key, type id.
Using list control listview provided by a mobile system for displaying list data; creating an adapter corresponding to the list control, and displaying a single list element according to the position of the element; preparing a memory data list to be displayed, wherein the name is assumed to be data, the data is usually a data entity in a memory and comprises text display contents and a url address of a network picture; the adapter is set to the list, and when the list element needs to be shown, a bindViewHolder method of the adapter is triggered, and the bindViewHolder gives a list element root layout with rendering, and the element with rendering is located at a coordinate index of the list.
If a list element has a relatively complex UI structure, for example, a secondary list, when the element is rendered for the first time, the corresponding data entity is bound to the root node view of the element in the form of a tag, and the data entity is used as a data cache.
When the element is rendered next time, firstly, the element to be rendered is obtained, wherein the element to be rendered comprises: text or pictures. For example, using the coordinate index, the single memory data object corresponding to the data to be exposed is named data. According to the actual business logic, the field to be displayed on the text or picture, usually a section of text or network picture address in the form of character string, is obtained from the data.
An extracting module 402, configured to extract a tag corresponding to an element to be rendered from the buffered data;
then, the tag is obtained from this element using the get tag method getTag () provided by the mobile App. That is, get the corresponding tag tagData from the root layout using getTag (key). For example, get tag (key) is used to get the corresponding tag tagData from a picture or text control.
A judging module 403, configured to judge whether the element to be rendered is the same as the tag;
then, whether the element to be rendered is the same as the tag is judged. That is, if the tag tagData exists, the tagData and the data object data are compared. For example, comparing tagData with the address of the text or picture taken.
A skipping module 404, configured to skip the process of rendering the element to be rendered when the element to be rendered is the same as the tag.
And when the element to be rendered is the same as the label, the element to be rendered is not required to be refreshed, and the whole segment of rendering logic can be skipped.
In summary, in the above embodiment, when performance of the mobile App list needs to be optimized, an element to be rendered is first obtained, where the element to be rendered includes: text or pictures; and then extracting a label corresponding to the element to be rendered from the buffered data, judging whether the element to be rendered is the same as the label, and if so, skipping the process of rendering the element to be rendered. According to the embodiment, when the list is slid, whether the element to be rendered is the same as the label corresponding to the element to be rendered is judged, and when the element to be rendered is the same as the label, the element to be rendered is not required to be rendered, so that the problems that the rendering process is long in time consumption and the sliding page is blocked are effectively solved.
As shown in fig. 5, a schematic structural diagram of a system embodiment 2 for optimizing list performance of a mobile App disclosed in the present invention is shown, where the system may include:
an obtaining module 501, configured to obtain an element to be rendered, where the element to be rendered includes: text or pictures;
when the performance of the mobile App list needs to be optimized, a key for caching the data of the user control is defined, wherein the key is a digital invariable constant and is unique in the whole App; xml in mobile App engineering, for example, defines an element named list _ item _ data _ key, type id.
Using list control listview provided by a mobile system for displaying list data; creating an adapter corresponding to the list control, and displaying a single list element according to the position of the element; preparing a memory data list to be displayed, wherein the name is assumed to be data, the data is usually a data entity in a memory and comprises text display contents and a url address of a network picture; the adapter is set to the list, and when the list element needs to be shown, a bindViewHolder method of the adapter is triggered, and the bindViewHolder gives a list element root layout with rendering, and the element with rendering is located at a coordinate index of the list.
If a list element has a relatively complex UI structure, for example, a secondary list, when the element is rendered for the first time, the corresponding data entity is bound to the root node view of the element in the form of a tag, and the data entity is used as a data cache.
When the element is rendered next time, firstly, the element to be rendered is obtained, wherein the element to be rendered comprises: text or pictures. For example, using the coordinate index, the single memory data object corresponding to the data to be exposed is named data. According to the actual business logic, the field to be displayed on the text or picture, usually a section of text or network picture address in the form of character string, is obtained from the data.
An extracting module 502, configured to extract a tag corresponding to an element to be rendered from the buffered data;
then, the tag is obtained from this element using the get tag method getTag () provided by the mobile App. That is, get the corresponding tag tagData from the root layout using getTag (key). For example, get tag (key) is used to get the corresponding tag tagData from a picture or text control.
A judging module 503, configured to judge whether the element to be rendered is the same as the tag;
then, whether the element to be rendered is the same as the tag is judged. That is, if the tag tagData exists, the tagData and the data object data are compared. For example, comparing tagData with the address of the text or picture taken.
A skipping module 504, configured to skip a process of rendering the element to be rendered when the element to be rendered is the same as the tag;
and when the element to be rendered is the same as the label, the element to be rendered is not required to be refreshed, and the whole segment of rendering logic can be skipped.
A rendering module 505, configured to render the element to be rendered when the element to be rendered is different from the tag;
and when the element to be rendered is different from the label or the label does not exist, continuing to go through a default rendering flow to render the element to be rendered. For example, a setText method is used to set content for a text control, or a web library is used to load a web picture.
And a setting module 506, configured to set the element to be rendered to the root node control of the element in the form of a tag.
And when the element to be rendered needs to continue to go through the default rendering flow for rendering, setting the element to be rendered to the root node control of the element in a tag form. That is, the data to be rendered is bound to the control in the form of a tag in a setTag (key, data) manner.
In summary, in this embodiment, on the basis of the above embodiment, when the element to be rendered is different from the tag, the element to be rendered can be rendered, and the element to be rendered is set to the root node control of the element in the form of the tag.
As shown in fig. 6, a schematic structural diagram of a system embodiment 3 for optimizing list performance of a mobile App according to the present invention is shown, where the system may include:
an obtaining module 601, configured to obtain an element to be rendered, where the element to be rendered includes: text or pictures;
when the performance of the mobile App list needs to be optimized, a key for caching the data of the user control is defined, wherein the key is a digital invariable constant and is unique in the whole App; xml in mobile App engineering, for example, defines an element named list _ item _ data _ key, type id.
Using list control listview provided by a mobile system for displaying list data; creating an adapter corresponding to the list control, and displaying a single list element according to the position of the element; preparing a memory data list to be displayed, wherein the name is assumed to be data, the data is usually a data entity in a memory and comprises text display contents and a url address of a network picture; the adapter is set to the list, and when the list element needs to be shown, a bindViewHolder method of the adapter is triggered, and the bindViewHolder gives a list element root layout with rendering, and the element with rendering is located at a coordinate index of the list.
If a list element has a relatively complex UI structure, for example, a secondary list, when the element is rendered for the first time, the corresponding data entity is bound to the root node view of the element in the form of a tag, and the data entity is used as a data cache.
When the element is rendered next time, firstly, the element to be rendered is obtained, wherein the element to be rendered comprises: text or pictures. For example, using the coordinate index, the single memory data object corresponding to the data to be exposed is named data. According to the actual business logic, the field to be displayed on the text or picture, usually a section of text or network picture address in the form of character string, is obtained from the data.
An extracting module 602, configured to extract a tag corresponding to an element to be rendered from the buffered data;
then, the tag is obtained from this element using the get tag method getTag () provided by the mobile App. That is, get the corresponding tag tagData from the root layout using getTag (key). For example, get tag (key) is used to get the corresponding tag tagData from a picture or text control.
The judging module 603 is configured to iteratively judge whether the element to be rendered is the same as a member of the tag step by step;
then, whether the element to be rendered is the same as the tag is judged. That is, if the tag tagData exists, the tagData and the data object data are compared. For example, comparing tagData with the address of the text or picture taken.
Specifically, when judging whether the element to be rendered is the same as the tag, an equals method of java objects may be used, which means that whether the members of the two objects are the same is judged by iteration step by step. And when the number of the members is not equal or the contents are not equal at any iteration level, judging that the two objects are not equal, otherwise, considering that the two objects are equal. For example, the labels taken out of the text controls are compared with the text to be displayed, and the characters are compared one by using an equals method of character strings. For example, the labels taken out of the picture control are compared with the picture addresses to be displayed, and characters are compared one by using an equals method of character strings.
A skipping module 604, configured to skip a process of rendering the element to be rendered when the element to be rendered is the same as the tag;
and when the element to be rendered is the same as the label, the element to be rendered is not required to be refreshed, and the whole segment of rendering logic can be skipped.
A rendering module 605, configured to render the element to be rendered when the element to be rendered is different from the tag;
and when the element to be rendered is different from the label or the label does not exist, continuing to go through a default rendering flow to render the element to be rendered. For example, a setText method is used to set content for a text control, or a web library is used to load a web picture.
And a setting module 606, configured to set the element to be rendered to the root node control of the element in a tag form.
And when the element to be rendered needs to continue to go through the default rendering flow for rendering, setting the element to be rendered to the root node control of the element in a tag form. That is, the data to be rendered is bound to the control in the form of a tag in a setTag (key, data) manner.
In conclusion, the invention can skip the repeated rendering of the complex elements in the list in the up-and-down sliding process of the user, thereby avoiding the pause caused by too long rendering time when the elements are scribed into the screen for the second time; the method optimizes the granularity of all texts and network pictures, shortens the rendering consumption of a single text and picture and improves the overall fluency while not influencing the overall rendering logic of elements.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for optimizing list performance by a mobile App, comprising:
obtaining an element to be rendered, wherein the element to be rendered comprises: text or pictures;
extracting a label corresponding to the element to be rendered from the buffered data;
and judging whether the element to be rendered is the same as the label or not, if so, skipping the process of rendering the element to be rendered.
2. The method of claim 1, further comprising:
and when the rendering element is different from the label, rendering the element to be rendered.
3. The method of claim 2, further comprising:
and setting the element to be rendered to a root node control of the element in a label mode.
4. The method of claim 1, wherein the determining whether the element to be rendered is the same as the tag comprises:
and iteratively judging whether the elements to be rendered are the same as the members of the tags step by step.
5. The method of claim 4, wherein the step-wise iterating to determine whether the element to be rendered and the member of the tag are the same comprises:
and iteratively judging whether the number of the members or the content of the members of the element to be rendered and the label is equal step by step.
6. A system for a mobile App to optimize list performance, comprising:
an obtaining module, configured to obtain an element to be rendered, where the element to be rendered includes: text or pictures;
the extraction module is used for extracting a label corresponding to the element to be rendered from the buffer data;
the judging module is used for judging whether the element to be rendered is the same as the label or not;
and the skipping module is used for skipping the process of rendering the element to be rendered when the element to be rendered is the same as the label.
7. The system of claim 6, further comprising:
and the rendering module is used for rendering the element to be rendered when the element to be rendered is different from the label.
8. The system of claim 7, further comprising:
and the setting module is used for setting the element to be rendered to the root node control of the element in a label mode.
9. The system according to claim 6, wherein the determining module, when determining whether the element to be rendered is the same as the tag, is specifically configured to:
and iteratively judging whether the elements to be rendered are the same as the members of the tags step by step.
10. The system according to claim 9, wherein the determining module, when performing the step-by-step iteration to determine whether the to-be-rendered element is the same as the member of the tag, is specifically configured to:
and iteratively judging whether the number of the members or the content of the members of the element to be rendered and the label is equal step by step.
CN202010471309.4A 2020-05-28 2020-05-28 Method and system for optimizing list performance of mobile App Pending CN111611047A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010471309.4A CN111611047A (en) 2020-05-28 2020-05-28 Method and system for optimizing list performance of mobile App

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010471309.4A CN111611047A (en) 2020-05-28 2020-05-28 Method and system for optimizing list performance of mobile App

Publications (1)

Publication Number Publication Date
CN111611047A true CN111611047A (en) 2020-09-01

Family

ID=72200167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010471309.4A Pending CN111611047A (en) 2020-05-28 2020-05-28 Method and system for optimizing list performance of mobile App

Country Status (1)

Country Link
CN (1) CN111611047A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656006A (en) * 2021-08-18 2021-11-16 广东触电传媒科技有限公司 Rich text rendering method and rendering equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021421A (en) * 2016-05-13 2016-10-12 北京视博云科技有限公司 Method and device for accelerating web page rendering
CN106941567A (en) * 2017-03-27 2017-07-11 广州优视网络科技有限公司 Show method, device and the user terminal of network picture

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021421A (en) * 2016-05-13 2016-10-12 北京视博云科技有限公司 Method and device for accelerating web page rendering
CN106941567A (en) * 2017-03-27 2017-07-11 广州优视网络科技有限公司 Show method, device and the user terminal of network picture

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656006A (en) * 2021-08-18 2021-11-16 广东触电传媒科技有限公司 Rich text rendering method and rendering equipment
CN113656006B (en) * 2021-08-18 2023-06-30 广东触电传媒科技有限公司 Rich text rendering method and rendering device

Similar Documents

Publication Publication Date Title
CN109801347B (en) Method, device, equipment and medium for generating editable image template
WO2021218327A1 (en) Page processing method and related device
CN109408752B (en) Online document display method and device and electronic equipment
CN109032722B (en) Method, device, equipment and medium for updating display effect of UI component
CN102693280B (en) Webpage browsing method, WebApp framework, method and device for executing JavaScript, and mobile terminal
US9111007B2 (en) Adaptive rendering of a webpage on an electronic display device
JP2008158765A (en) Information processing device, information processing method, and program for executing it by computer
JP6975339B2 (en) Backdrop rendering of digital components
CN103605502A (en) Form page display method and server
CN111951356B (en) Animation rendering method based on JSON data format
EP3654175A1 (en) Terminal device, ui extension method, and ui extension program
CN109685595A (en) Method for pushing, device, mobile terminal and storage medium based on data analysis
CN112068911A (en) Method, device, system, equipment and medium for generating electronic form
US10956658B2 (en) Digital content editing of a document object model (DOM) based on object model comparison
CN111611047A (en) Method and system for optimizing list performance of mobile App
US9501457B2 (en) Creating a communication editable in a browser independent of platform and operating system
CN115268904A (en) User interface design file generation method, device, equipment and medium
CN102099806B (en) Information output apparatus, information output method, and recording medium
CN114020187A (en) Font icon display method and device and electronic equipment
CN105373524A (en) Demonstration text editing method and apparatus
CN113779466B (en) Page display method and device, storage medium and electronic equipment
CN116302264A (en) Interface dynamic effect execution method and device, terminal equipment and storage medium
US20160210007A1 (en) Textbox associated with device native feautures
CN113656020A (en) Reactnative-based picture display component development method and related components
CN114491350A (en) Content display method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200901