CN114327685B - Method and device for optimizing running speed of applet - Google Patents

Method and device for optimizing running speed of applet Download PDF

Info

Publication number
CN114327685B
CN114327685B CN202210001371.6A CN202210001371A CN114327685B CN 114327685 B CN114327685 B CN 114327685B CN 202210001371 A CN202210001371 A CN 202210001371A CN 114327685 B CN114327685 B CN 114327685B
Authority
CN
China
Prior art keywords
applet
thread
target applet
priority
target
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.)
Active
Application number
CN202210001371.6A
Other languages
Chinese (zh)
Other versions
CN114327685A (en
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210001371.6A priority Critical patent/CN114327685B/en
Publication of CN114327685A publication Critical patent/CN114327685A/en
Application granted granted Critical
Publication of CN114327685B publication Critical patent/CN114327685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides an applet running speed optimization method and device, and relates to the technical field of computers. The specific implementation scheme is as follows: responding to a starting instruction of a target applet, and modifying a default thread priority parameter of a logic thread created for the target applet into an immediate response priority; in response to the logical thread being started, the target applet is run. The priority of the logic thread of the target applet can be improved, namely, the priority of the resource allocated to the target applet by the lifting system is improved, so that the opening speed and the running speed of the target applet are improved. And the method has no perception to a developer, does not need the developer to carry out code adaptation, and further does not have the problem of performance degradation possibly caused by the code adaptation of the developer.

Description

Method and device for optimizing running speed of applet
Technical Field
The disclosure relates to the field of computer technology, and in particular relates to a method and a device for optimizing the running speed of an applet.
Background
The applet is an application that can be used without downloading and installing, and the running speed of the applet means: the speed at which the applet is loaded and presented in the host App (Application), and the speed at which the applet responds to user interaction. The speed of the applet running largely determines the user experience.
Disclosure of Invention
The disclosure provides an applet running speed optimization method and device.
According to an aspect of the present disclosure, there is provided an applet operation speed optimization method including:
responding to a starting instruction of a target applet, and modifying a default thread priority parameter of a logic thread created for the target applet into an immediate response priority;
the target applet is run in response to the logical thread being started.
According to another aspect of the present disclosure, there is provided an applet operation speed optimizing apparatus including:
the parameter changing module is used for responding to a starting instruction of a target applet and changing a default thread priority parameter of a logic thread established for the target applet into an immediate response priority;
and the running module is used for responding to the start of the logic thread and running the target applet.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform applet run speed optimization.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform an applet running speed optimization method.
According to yet another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements a applet running speed optimization method.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure.
FIG. 1 is a schematic flow chart of an applet operation speed optimization method according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an applet, twin-thread model provided in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an applet run speed optimization method provided by an embodiment of the present disclosure;
FIG. 4 is a block diagram of an apparatus for implementing an applet run speed optimization method of an embodiment of the disclosure;
fig. 5 is a block diagram of an electronic device for implementing the applet running speed optimization method of an embodiment of the disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
An applet is an application that can be used without downloading an installation. The running speed of the applet means: the speed at which the applet is loaded and presented in the host App, and the speed at which the applet responds to user interaction.
The speed of the applet running largely determines the user experience. Poor performance of the applet display and slow response to interactive instructions can even occur where the content is not accessible, which can affect the user experience to a different extent, resulting in user churn.
The purpose of optimizing the running speed of the applet mainly includes the following aspects:
1. the User viscosity (User viscocity) is increased. 2. The conversion rate is improved. 3. And the user experience is improved.
In particular, developers want users to be able to do meaningful behavior through applets. For example, e-commerce class applets wish a user to purchase goods; content class applets want users to read and subscribe; a plurality of case researches show that the operation speed is high, the users can be better reserved, and the viscosity of the users is improved.
Increasing user viscosity is critical to increasing conversion, which refers to the ratio of the number of accesses a user has made to certain target actions, including subscriptions, purchases, etc., to the total number of accesses. Studies have shown that increasing the speed of operation of the applet can effectively increase conversion.
Performance is an essential element in creating a good user experience. When the user enters the applet, the page is fast loaded with good performance, and if the performance is poor, the loading speed is too slow, the user has to wait, and when the user tolerates the applet with low performance to a certain extent, the user can choose to give up.
The current common methods for optimizing applet operating speed include the following:
1. the initData generation is accelerated. The specific means comprise: the sub-packaging is reasonably used, the dynamic library is reasonably used, and the like.
2. The main data is requested in advance. The specific means comprise: first screen data, data pre-acquisition, data persistence, etc. are requested at onlnit (initialization stage).
3. The rendering speed of the rendering layer is optimized. The specific means comprise: custom components, etc. are reasonably used.
The disadvantages of the above methods are: the methods are gradually popularized, the gap between the method and the bid is difficult to be opened, and all the current technical schemes depend on a developer to carry out corresponding code adaptation, and the unreasonable code adaptation of the developer can possibly cause performance degradation.
In order to improve the running speed of the applet and overcome the above shortcomings, the present disclosure provides an applet running speed optimizing method and apparatus.
In one embodiment of the present disclosure, there is provided an applet operation speed optimization method, the method comprising:
responding to a starting instruction of a target applet, and modifying a default thread priority parameter of a logic thread created for the target applet into an immediate response priority;
the target applet is run in response to the logical thread being started.
It can be seen that, in response to a start instruction of a target applet, a default thread priority parameter of a logical thread created for the target applet is modified to an immediate response priority; in response to the logical thread being started, the target applet is run.
Because the instant response priority is higher than the default thread priority parameter priority, the thread priority parameter can represent the priority of the resources (including CPU time slice resources, network resources, hard disk resources and the like) allocated by the system for the thread after the thread starts to execute, so that the priority of the system for allocating the resources for the target applet is improved, and the opening speed and the running speed of the target applet are improved.
In addition, the optimization method is applicable to host App which is arbitrarily accessed with the applet SDK (software development kit ), has no perception to a developer, does not need the developer to carry out code adaptation, and further does not cause performance degradation problem possibly caused by the code adaptation of the developer.
Referring to fig. 1, fig. 1 is a schematic flow chart of an applet operation speed optimization method according to an embodiment of the disclosure, as shown in fig. 1, the method may include the following steps:
s101: in response to a start instruction of the target applet, a default thread priority parameter for the logical thread created by the target applet is modified to an immediate response priority.
In the embodiment of the disclosure, the starting instruction of the target applet may be in various forms, for example, a user clicks an icon of the target applet in the host App, and the clicking action may be used as the starting instruction of the target applet.
As will be appreciated by those skilled in the art, the applet uses a bilinear model, including logical threads and rendering threads. The logic thread is responsible for the execution of js (JavaScript) code, thereby controlling the generation and processing of applet data; the rendering thread is responsible for rendering the page and receives event interaction behavior of the user.
The relationship between two threads can be seen in fig. 2, and fig. 2 is a schematic diagram of an applet dual thread model provided in an embodiment of the present disclosure, as shown in fig. 2, where communication between a logical thread and a rendering thread is relayed via Native (client) of an applet hosting App.
After receiving the starting instruction of the target applet, the operating environment of the applet needs to be created first, and the target applet can be normally operated after the creation is completed. First, it is necessary to create an applet code execution environment, which is required to be created because the development language of the applet is JavaScript. Because the logical layer and the rendering layer of the applet are separate, it is also necessary to create an applet rendering environment, then create a logical thread for the target applet and start the logical thread, until the applet's running environment is created. Wherein, javaScript is a lightweight, interpreted or just-in-time compiled programming language with function priority.
Generally, under ios operating systems, creating an applet's runtime environment includes: creating jscore (JavaScriptCore) an execution environment, creating a WebView rendering environment, creating a logical thread that executes js code, and starting the logical thread.
Under the android operating system, creating the running environment of the applet comprises: creating a Chrome V8 engine execution environment, creating a Chrome kernel rendering environment, creating a logical thread for executing js code, and starting the logical thread.
Under ios or android operating systems, the created logical threads have default thread priority parameters.
For ease of understanding, the thread priority parameter is described below.
Under ios operating systems, the thread priority parameter, also called a quality of service parameter, is an enumerated value provided by the ios operating system that describes priority, and therefore may also be referred to as a quality of service enumerated value, which is used to represent the nature of work and importance to the system. Threads using high priority quality of service parameters are readily able to obtain more resources when there is contention for resources.
In other words, the quality of service parameter of the thread determines the priority of the system resource allocation after the task starts to execute, such as CPU time slice resources, network resources, hard disk resources, etc., and the newly created thread has a default priority associated with it.
The quality of service parameters specifically include the following classes:
NSQualityOfServiceUserInteractive: the quality of service enumeration value is the highest priority quality of service enumeration value and is typically used for work directly related to providing an interactive UI (User Interface). For example: process control events or draw on screen.
NSQualityOfServiceUserInitiated: the quality of service enumeration value is the next highest priority enumeration value of quality of service, typically used to perform work explicitly required by the user, and in order to allow further user interaction, the results of these work have to be displayed immediately. For example: the mail is loaded after the user selects the mail in the mail list.
NSQualityOfServiceUtility: the quality of service enumeration value is a quality of service common priority enumeration value that is typically used to perform a task where it is unlikely that a user will immediately wait for a result. This work may be requested by the user or may be initiated automatically and is typically operated on a time scale visible to the user using a non-mode progress indicator. For example: periodic content updates or batch file operations, such as media importation.
NSQualityOfServiceBackgroup: the quality of service enumeration value is a quality of service background priority enumeration value for non-user initiated or invisible work. Often the user does not even know that this work is being done. For example: preshared content, search index, backup, or synchronize data with external systems.
NSQualityOfServiceDefault: the quality of service enumeration value is a quality of service default priority enumeration value, indicating that there is no explicit quality of service information, which is also a default enumeration value for logical threads created for the target applet under ios operation.
In the disclosed embodiment, after the logical thread is created, the default thread priority parameter is modified to be the immediate response priority.
Under ios operating system, the step of modifying the default thread priority parameter of the logic thread created for the target applet into the immediate response priority with the thread priority parameter being the quality of service parameter may specifically include:
the quality of service parameters of the logical thread created for the target applet are modified to immediate response parameters.
In particular, although NSQualityOfServiceUserInteract has a higher priority, the quality of service enumeration value is for logical threads that are directly involved in providing interactive UI, and are not suitable for applets.
While the quality of service next highest priority enumerated value, NSQualityOfServiceUserInitiated, is used to perform the work explicitly required by the user and to allow further user interaction, the results of these work must be displayed immediately, so NSQualityOfServiceUserInitiated, which may also be referred to as an immediate response parameter, can be applied to the logical thread of the applet, thus modifying the default thread priority parameter of the logical thread of the target applet to NSQulityOfServiceUserInitiated.
According to actual measurement, if the running environment of the applet is the ios operating system, modifying the thread priority parameter of the logical thread of the applet into NSQualityOfServiceUserInitiated (instant response parameter), and improving the running speed of the applet obviously.
S102: in response to the logical thread being started, the target applet is run.
In the embodiment of the disclosure, after the thread priority parameter of the logic thread is modified to the immediate response priority, the logic thread is started, and the execution environment of the applet is created, so that the target applet can be started and run.
According to actual measurement and calculation, the optimization method provided by the present disclosure improves the opening speed of the applet by 20ms, optimizes the opening speed from 1178ms to 1158ms, and optimizes the opening range by 1.6%.
It can be seen that, in response to a start instruction of a target applet, a default thread priority parameter of a logical thread created for the target applet is modified to an immediate response priority; in response to the logical thread being started, the target applet is run.
Because the instant response priority is higher than the default thread priority parameter priority, the thread priority parameter can represent the priority of the resources (including CPU time slice resources, network resources, hard disk resources and the like) allocated by the system for the thread after the thread starts to execute, so that the priority of the system for allocating the resources for the target applet is improved, and the opening speed and the running speed of the target applet are improved.
Moreover, the optimization method is applicable to any host App accessed with the applet SDK, has no perception to a developer, does not need the developer to carry out code adaptation, and further does not cause performance degradation possibly caused by the code adaptation of the developer.
Under the android operating system, the thread priority parameters specifically include the following levels:
read_priority_default: default thread priority;
read_priority_low: the lowest priority of the active thread;
read_priority_back_turn_around: the standard background thread priority, namely the priority which is usually set by the background thread;
read_priority_foregroup: standard foreground thread priority, i.e., the priority typically employed by UI (User Interface) threads that a User is interacting with.
Read_priority_display: the standard display system PRIORITY, also a PRIORITY level associated with UI interactions, is higher than the THREAD_PRIORITY_FOREGROUND PRIORITY.
Read_priority_source_display: the standard, more important display priority, is the highest level of the display thread for processing the drawing picture and retrieving input events.
Read_priority_audio: standard sound thread priority, i.e., standard level of sound threads.
Read_priority_window_audio: the standard more important sound THREAD PRIORITY is the highest level of sound THREADs, with a higher PRIORITY than the read_priority_audio.
In one embodiment of the present disclosure, if the running environment of the target applet is an android operating system, the running speed of the applet is most significantly improved when the THREAD PRIORITY parameter is read_priority_window_display (standard DISPLAY system PRIORITY). And the read _ PRIORITY _ resource _ DISPLAY is also used to perform the work explicitly requested by the user and in order to allow further user interaction the results of these work must be displayed immediately. Thus, the read_priority_window_display also belongs to the immediate response parameter.
Thus, after creating a logical thread, the logical thread priority parameter is modified to: the standard DISPLAY system PRIORITY value read_priority_window_display. The priority of the logic thread of the target applet can be improved, namely, the priority of the resource allocated to the target applet by the lifting system can be improved, so that the opening speed and the running speed of the target applet can be improved.
In one embodiment of the present disclosure, the step of running the target applet may include: and running the business codes of the target applet.
Specifically, taking ios operating system as an example, creating an operating environment of an applet includes: creating a jscore execution environment, creating a WebView environment, creating a logic thread for executing js code, and starting the logic thread. In the embodiment of the disclosure, after the logic thread for executing the js code is created, the thread priority parameter of the logic thread is modified, the logic thread is restarted after the modification is completed, after the logic thread is started, the operating environment of the applet can be considered to be created, and the target applet can be started, namely, the service code of the target applet is operated, so that the page of the target applet is loaded.
After the target applet is started, the running process of the target applet can be kept consistent with the related art.
For ease of understanding, the method for optimizing the operating speed of the applet provided in the embodiments of the present disclosure will be further described with reference to fig. 3, and fig. 3 is a schematic diagram of the method for optimizing the operating speed of the applet provided in the embodiments of the present disclosure.
Taking ios operating system as an example, as shown in fig. 3, after receiving the target applet start instruction, the creation of the applet operating environment is started. The method specifically comprises the following steps: creating a jscore execution environment of the logic layer, creating a WebView environment of the rendering layer, creating a logic thread, modifying a thread priority parameter of the logic thread to be an immediate response priority, and then starting the logic thread.
After the logic thread is started, the applet running environment is created, and the starting of the target applet, namely the running of the service code of the target applet, is started.
Therefore, in the process of creating the applet running environment, the priority of the logic thread of the target applet is improved, namely, the priority of the resource allocated to the applet by the lifting system is improved, so that the opening speed and the running speed of the target applet are improved.
Moreover, the optimization method is applicable to any host App accessed with the applet SDK, has no perception to a developer, does not need the developer to carry out code adaptation, and further does not cause performance degradation possibly caused by the code adaptation of the developer.
Referring to fig. 4, fig. 4 is a block diagram of an apparatus for implementing an applet running speed optimization method according to an embodiment of the disclosure, as shown in fig. 4, the apparatus may include:
a parameter modification module 401, configured to modify a default thread priority parameter of a logical thread created for a target applet into an immediate response priority in response to a start instruction of the target applet;
an execution module 402 is configured to execute the target applet in response to the logical thread being started.
In one embodiment of the present disclosure, the running environment of the target applet is ios operating system, and the thread priority parameter is a quality of service parameter.
In one embodiment of the present disclosure, the parameter modification module 401 is specifically configured to:
and modifying the service quality parameters of the logic threads created for the target applet into instant response parameters.
In one embodiment of the present disclosure, further comprising: the running environment creation module is used for:
the operating environment of the target applet is created before modifying the default thread priority parameter of the logical thread created for the target applet to an immediate response priority.
In one embodiment of the present disclosure, the execution environment creation module is specifically configured to:
creating an applet code execution environment;
creating an applet rendering environment;
a logical thread is created for the target applet.
In one embodiment of the disclosure, the operation module 402 is specifically configured to:
and responding to the logic thread being started, and running the business code of the target applet.
It can be seen that, in response to a start instruction of the target applet, a default thread priority parameter of a logical thread created for the target applet is modified to a preset parameter; in response to the logical thread being started, the target applet is run.
Because the instant response priority is higher than the default thread priority parameter priority, the thread priority parameter can represent the priority of the resources (including CPU time slice resources, network resources, hard disk resources and the like) allocated by the system for the thread after the thread starts to execute, so that the priority of the system for allocating the resources for the target applet is improved, and the opening speed and the running speed of the target applet are improved.
Moreover, the optimization method is applicable to any host App accessed with the applet SDK, has no perception to a developer, does not need the developer to carry out code adaptation, and further does not cause performance degradation possibly caused by the code adaptation of the developer.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
The present disclosure provides an electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform an applet operating speed optimization method.
The present disclosure provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a applet running speed optimization method.
The present disclosure provides a computer program product comprising a computer program which when executed by a processor implements a applet running speed optimization method.
Fig. 5 illustrates a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 includes a computing unit 501 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, ROM 502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, etc.; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508 such as a magnetic disk, an optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the respective methods and processes described above, such as the applet running speed optimization method. For example, in some embodiments, the applet running speed optimization method is implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When a computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the applet running speed optimization method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the applet run speed optimization method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (10)

1. An applet running speed optimization method comprising:
responding to a starting instruction of a target applet, and modifying a default thread priority parameter of a logic thread created for the target applet into an immediate response priority;
running the target applet in response to the logical thread being started;
the running environment of the target applet is ios operating system, and the thread priority parameter is service quality parameter;
wherein the step of modifying the default thread priority parameter of the logical thread created for the target applet to an immediate response priority comprises:
and modifying the service quality parameters of the logic threads created for the target applet into instant response parameters.
2. The method of claim 1, further comprising, prior to modifying a default thread priority parameter for a logical thread created for the target applet to an immediate response priority:
and creating the running environment of the target applet.
3. The method of claim 2, wherein the creating the runtime environment of the target applet comprises:
creating an applet code execution environment;
creating an applet rendering environment;
a logical thread is created for the target applet.
4. The method of claim 1, wherein the step of running the target applet comprises:
and running the business codes of the target applet.
5. An applet running speed optimizing apparatus comprising:
the parameter changing module is used for responding to a starting instruction of a target applet and changing a default thread priority parameter of a logic thread established for the target applet into an immediate response priority;
an operation module for operating the target applet in response to the logical thread being started;
the running environment of the target applet is ios operating system, and the thread priority parameter is service quality parameter;
the parameter changing module is specifically configured to:
and modifying the service quality parameters of the logic threads created for the target applet into instant response parameters.
6. The apparatus of claim 5, further comprising: the running environment creation module is used for:
the operating environment of the target applet is created before modifying the default thread priority parameter of the logical thread created for the target applet to an immediate response priority.
7. The apparatus of claim 6, wherein the execution environment creation module is specifically configured to:
creating an applet code execution environment;
creating an applet rendering environment;
a logical thread is created for the target applet.
8. The device of claim 5, wherein the operation module is specifically configured to:
and responding to the logic thread being started, and running the business code of the target applet.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
CN202210001371.6A 2022-01-04 2022-01-04 Method and device for optimizing running speed of applet Active CN114327685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210001371.6A CN114327685B (en) 2022-01-04 2022-01-04 Method and device for optimizing running speed of applet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210001371.6A CN114327685B (en) 2022-01-04 2022-01-04 Method and device for optimizing running speed of applet

Publications (2)

Publication Number Publication Date
CN114327685A CN114327685A (en) 2022-04-12
CN114327685B true CN114327685B (en) 2023-08-11

Family

ID=81023460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210001371.6A Active CN114327685B (en) 2022-01-04 2022-01-04 Method and device for optimizing running speed of applet

Country Status (1)

Country Link
CN (1) CN114327685B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114721742A (en) * 2022-04-14 2022-07-08 北京字节跳动网络技术有限公司 Application program starting optimization method and device, computer equipment and storage medium
CN114924807B (en) * 2022-04-28 2023-12-01 支付宝(杭州)信息技术有限公司 Method and device for improving running speed of applet
CN116700814A (en) * 2022-10-20 2023-09-05 荣耀终端有限公司 Method for starting applet and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766101A (en) * 2017-09-30 2018-03-06 五八有限公司 App starts processing method, device and the equipment of event
EP3470999A1 (en) * 2017-10-13 2019-04-17 IDEMIA France Securing of conditional connection instructions composed in a computer program in intermediate code
CN111787088A (en) * 2020-06-28 2020-10-16 百度在线网络技术(北京)有限公司 Method and device for processing applet data
CN111813536A (en) * 2019-04-11 2020-10-23 华为技术有限公司 Task processing method, device, terminal and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766101A (en) * 2017-09-30 2018-03-06 五八有限公司 App starts processing method, device and the equipment of event
EP3470999A1 (en) * 2017-10-13 2019-04-17 IDEMIA France Securing of conditional connection instructions composed in a computer program in intermediate code
CN111813536A (en) * 2019-04-11 2020-10-23 华为技术有限公司 Task processing method, device, terminal and computer readable storage medium
CN111787088A (en) * 2020-06-28 2020-10-16 百度在线网络技术(北京)有限公司 Method and device for processing applet data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
THDS-100调度自动化系统中多线程技术的应用;夏明超, 黄益庄, 谢忻;清华大学学报(自然科学版)(03);全文 *

Also Published As

Publication number Publication date
CN114327685A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
CN114327685B (en) Method and device for optimizing running speed of applet
CN112861057B (en) Page rendering method, device, equipment and storage medium based on applet
CN112540806B (en) Method and device for rendering small program page, electronic equipment and storage medium
US20220365773A1 (en) Run-Time Application Modification
US10574759B2 (en) Message-based contextual dialog
CN115309470B (en) Method, device, equipment and storage medium for loading widget
CN114035865B (en) Method, device and equipment for starting small program and storage medium
CN113722647A (en) Method and device for displaying information
EP3407186B1 (en) Interface refresh synchronization method and apparatus, terminal, and storage medium
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN112506854A (en) Method, device, equipment and medium for storing page template file and generating page
US10402210B2 (en) Optimizing user interface requests for backend processing
US11520473B2 (en) Switch control for animations
CN113608809B (en) Layout method, device, equipment, storage medium and program product of components
CN114090118A (en) Method, device and equipment for starting small program and storage medium
CN112966201B (en) Object processing method, device, electronic equipment and storage medium
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
CN114138358A (en) Application program starting optimization method, device, equipment and storage medium
CN114428646B (en) Data processing method and device, electronic equipment and storage medium
WO2023024035A1 (en) Request processing method and apparatus, electronic device, and storage medium
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
CN114035885B (en) Applet page rendering method and device and electronic equipment
CN113360074B (en) Soft keyboard display method, related device and computer program product
CN113378087B (en) Page processing method, page processing device, electronic equipment and storage medium
EP3951687A2 (en) Business content output method, apparatus, storage medium and program product

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
GR01 Patent grant
GR01 Patent grant