Optimization method and device for log module Histogram in web page rendering engine

By modifying the Histogram log module of the web rendering engine Blink to an empty class or an empty function, optimizing its call, solving the problem of excessive resource usage and realizing the effect of reducing the library size and memory usage.

CN113987379BActive Publication Date: 2024-11-12SHANDONG BAIMENG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111213663.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-19
Publication Date
2024-11-12
Estimated Expiration
2041-10-19

AI Technical Summary

Technical Problem

The Histogram log module in the existing web rendering engine causes a lot of resources to occupy, increasing the library size, runtime memory and CPU time consumption.

Method used

By obtaining the source code of the web rendering engine Blink, modifying the log module Histogram calls as empty classes or empty functions, and optimizing them during the compilation process, thereby reducing the library size and memory usage and saving CPU time.

Benefits of technology

It realizes reducing the library size and memory usage, saving CPU time, and solving the problem of excessive resource usage of web rendering engines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113987379B_ABST
    Figure CN113987379B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for optimizing a log module Histogram in a web page rendering engine, wherein the method comprises: obtaining the source code of a web page rendering engine Blink, wherein the source code of the web page rendering engine comprises a log module Histogram, and the log module comprises an empty class or an empty function called by the source code of the web page rendering engine; compiling the source code of the web page rendering engine to obtain the web page rendering engine used in an embedded device, and after optimization, the purpose of reducing the library size, reducing the memory usage, and saving the CPU time can be achieved, thereby solving the problem of more resource usage of the web page rendering engine in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of web page rendering, and in particular to a method and device for optimizing a Histogram of a log module in a web page rendering engine. Background Art

[0002] Blink is an open source web rendering engine, equivalent to a software operating platform. It needs to be able to correctly render and display various existing web pages, and be able to provide assistance to developers in the process of developing new web pages. Therefore, Blink has a set of Histogram log modules that can track Blink's resource usage status to help developers correctly run and optimize web pages.

[0003] The working principle of the Histogram log module is to insert a piece of code when a resource is needed in the source code, commonly known as statistical dotting. This piece of code can record the usage of resources and output the usage in different ways when needed. Because a piece of code is inserted into the source code, it will be compiled into the library, which will increase the size of the library and increase memory usage and CPU time when the program is running. Summary of the invention

[0004] The main purpose of the present invention is to provide a method and device for optimizing the Histogram of a log module in a web page rendering engine, so as to solve the problem of excessive resource occupation of the web page rendering engine in the prior art.

[0005] To achieve the above-mentioned purpose, according to one aspect of the present invention, a method for optimizing a log module Histogram in a web page rendering engine is provided, comprising: obtaining source code of a web page rendering engine Blink, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; and compiling the source code of the web page rendering engine to obtain the web page rendering engine used in an embedded device.

[0006] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: modifying the macro definition in the source code of the web page rendering engine to an empty call, so that the statistical dot function inserted in the web page rendering engine calls an empty function.

[0007] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: defining a target function in the log module, wherein the target function is a function in the HistogramBase class that is called in a parameter when the source code of the web page rendering engine calls a macro definition.

[0008] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: setting the function in the UMA module in the log module to an empty call.

[0009] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: setting the statistical dot insertion function that directly calls the Histogram class in the source code of the web page rendering engine to be an empty call.

[0010] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: setting the custom Histogram macro definition used in the net module of the web page rendering engine to call an empty function.

[0011] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: setting the Histogram macro definition used in the gpu module of the web page rendering engine to call an empty function.

[0012] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: setting the Histogram macro definition used in the storage module of the web page rendering engine to call an empty function.

[0013] Optionally, before obtaining the source code of the web page rendering engine Blink, the method further includes: setting the Histogram macro definition used in the ui module of the web page rendering engine to call an empty function.

[0014] To achieve the above-mentioned purpose, according to one aspect of the present invention, there is provided an optimization device for a log module Histogram in a web page rendering engine, comprising: an acquisition unit, used to acquire the source code of a web page rendering engine Blink, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; and a compilation unit, used to compile the source code of the web page rendering engine to obtain the web page rendering engine used in an embedded device.

[0015] Optionally, the apparatus of the present application may further include: an optimization unit, for modifying the macro definition in the source code of the web page rendering engine Blink to an empty call before obtaining the source code of the web page rendering engine, so that the statistical dot function inserted in the web page rendering engine calls an empty function.

[0016] Optionally, the optimization unit is further used to: define a target function in the log module before obtaining the source code of the web rendering engine Blink, wherein the target function is a function in the HistogramBase class that is called in the parameter when the source code of the web rendering engine calls the macro definition.

[0017] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the function in the UMA module in the log module to be an empty call.

[0018] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the statistical dot function that directly calls the Histogram class to insert statistical dot in the source code of the web page rendering engine to be an empty call.

[0019] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the custom Histogram macro definition used in the net module of the web page rendering engine to call an empty function.

[0020] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the gpu module of the web page rendering engine to call an empty function.

[0021] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the storage module of the web page rendering engine to call an empty function.

[0022] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the ui module of the web page rendering engine to call an empty function.

[0023] By applying the technical solution of the present invention, the source code of the web page rendering engine Blink is obtained, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; the source code of the web page rendering engine is compiled to obtain the web page rendering engine used in an embedded device, and the modified empty class or empty function will be optimized by the compiler during the compilation and linking process of Blink, so that there will be no call to the Histogram log module in the generated library. Therefore, after optimization, the purpose of reducing the library size, reducing memory usage, and saving CPU time can be achieved, thereby solving the problem of high resource usage of the web page rendering engine in the prior art.

[0024] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0026] Figure 1 It is a flowchart of an optional optimization method of a log module Histogram in a web page rendering engine according to an embodiment of the present application;

[0027] Figure 2 is a schematic diagram of an optional workflow of a log module according to an embodiment of the present application;

[0028] Figure 3 is a schematic diagram of an optional workflow of a log module according to an embodiment of the present application; and,

[0029] Figure 4 It is a schematic diagram of an optional optimization device of a log module Histogram in a web page rendering engine according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0034] According to one aspect of an embodiment of the present application, a method embodiment of a method for optimizing a Histogram of a log module in a web page rendering engine is provided. Figure 1 is a flowchart of an optional method for optimizing the log module Histogram in a web page rendering engine according to an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps:

[0035] Step S101, obtaining the source code of the web page rendering engine Blink, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine;

[0036] Step S102, compile the source code of the web page rendering engine to obtain the web page rendering engine used in the embedded device.

[0037] By applying the technical solution of the present invention, the source code of the web page rendering engine Blink is obtained, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; the source code of the web page rendering engine is compiled to obtain the web page rendering engine used in the embedded device, and the modified empty class or empty function will be optimized by the compiler during the compilation and linking process of Blink, so that there will be no call to the Histogram log module in the generated library. Therefore, after optimization, the purpose of reducing the library size, reducing memory usage, and saving CPU time can be achieved, thereby solving the problem of more resource usage of the web page rendering engine in the prior art.

[0038] like Figure 2 As shown in the figure, it is the workflow of the Histogram log module. In the macro definition of the Histogram log module (the second part from the left), because there are a large number of key nodes in Blink that need to mark resource usage, there are a large number of places in the source code that call macro definitions. If the macro definition is deleted, there will be a lot of places that need to be modified, and when upgrading and merging in the future, the existing modifications cannot be reused to reduce a large number of modifications. The main implementation part of the Histogram log module (the third and fourth parts from the left) is also the part that occupies the library size after compilation, the memory size and CPU time during runtime. In other words, not calling this part can achieve the purpose of reducing the library size, reducing memory usage, and saving CPU time.

[0039] However, on embedded platforms with limited system resources, such as set-top boxes or TVs, the Histogram log module is equivalent to increasing the library size, occupying Flash space, and increasing runtime resources, occupying memory space and CPU time. At the same time, the embedded platform only renders and displays some specific web pages, and web pages can be developed on non-embedded platforms, so there is no need to track the resource usage status of web pages. Therefore, Blink can be customized and optimized and ported to the embedded platform, and its Histogram log module can be optimized to the minimum. The workflow of the optimized Histogram log module is as follows: Figure 3 As shown:

[0040] The middle part is the modified macro definition, etc., and the right part is the empty function or empty class added to the Histogram log module. After the modification, the empty class or empty function will be optimized by the compiler during the compilation and linking process of Blink. In this way, there will be no call to the Histogram log module in the generated library. Therefore, after optimization, the library size can be reduced, the memory usage can be reduced, and the CPU time can be saved.

[0041] The Histogram log module is a statistical function in Blink. It can easily and efficiently insert a large number of statistical points into the source code. The statistical results can be printed out or the statistical items to be output can be customized. The statistical results mainly include the number of statistics, the total, and the distribution of each point. This information can be displayed in a variety of ways, such as ASCII text, HTML, and JSON. In order to conveniently and efficiently insert statistical points into the source code, the Histogram log module uses macro definitions to call functions within the module. Therefore, the first step is to let these macro definitions call empty functions. For example, the HISTOGRAM macro definition in the source code defines variables and calls the Histogram log module. After changing it to an empty function call, this part of the call can be omitted.

[0042] There are more than ten macro definitions in the Histogram log module that need to be modified to empty calls. After the modification, the inserted statistical dot function calls in Blink will call empty functions, thus reducing the library size, reducing memory calls and saving CPU time at runtime. Although the macro definition is modified to empty calls, when the macro definition is called in the Blink source code, the function in the HistogramBase class will be called in the parameter, which will cause the corresponding function to not be found during compilation. Therefore, the second step is to define these functions that will be called, and there will be no error that these functions cannot be found during compilation. Moreover, these functions will only be called in the parameters of the empty macro definition, so the implementation of these functions will not be found during linking, so these functions only need to be defined, such as these six functions:

[0043] int Add(base::HistogramBase::Sample);

[0044] int AddBoolean(base::HistogramBase::Sample);

[0045] int AddTimeMillisecondsGranularity(base::HistogramBase::Sample);

[0046] int AddTimeMillisecondsGranularity(const base::TimeDelta&);

[0047] int AddTimeMicrosecondsGranularity(base::HistogramBase::Sample);

[0048] After this modification, some efficient statistical insertion points can be set to empty in Blink. However, the Histogram log module has another method of inserting statistical points that is not so efficient, which is to directly call the UMA (User Metrics Analysis) module of the Histogram class. The functions in the UMA module are all defined in histogram_functions.h starting with UmaHistogram. Therefore, the third step is to modify the functions of the UMA module to empty calls. After being modified to empty functions, the empty functions will be optimized during the compilation and linking process of Blink, so that the original functions will not be called, thereby reducing the library size, reducing memory usage and saving CPU time at runtime, such as the UmaHistogramExactLinear function in the source code.

[0049] After this modification, all resource-consuming processing in the UMA module can be removed. However, there is still a small part of the source code in Blink that directly calls the Histogram class for statistical insertion, such as MemoryPressureMonitor, CancelableTaskTracker, ThreadGroupImpl, PersistentMemoryAllocator, etc. Therefore, the fourth step is to modify the Blink source code and set the statistical insertion function that directly calls the Histogram class to an empty call, such as the function in cancelable_task_tracker.cc.

[0050] Most of the inserted statistical dot functions in Blink have been modified to empty, but some source codes in the net module use custom Histogram macro definitions, so the fifth step is to modify these macro definitions to call empty functions, such as the CACHE_HISTOGRAM_CUSTOM_COUNTS macro definition in the source code.

[0051] In addition to the net module directly calling the Histogram class, there are other modules that have a small number of calls, such as gpu, storage, ui, etc. Therefore, the sixth step modifies a small number of calls in these modules so that they do not call the Histogram log module, such as the CustomCountHistogram class in the source code.

[0052] In this way, all key nodes in Blink that call the Histogram log module to count resource usage will not call the Histogram log module, but the metrics module only uses the output function of the Histogram log module, especially the HistogramSnapshotManager, PersistentHistogramAllocator and other classes. Therefore, the seventh step is to modify these classes to empty functions, such as the HistogramSnapshotManager class in the source code.

[0053] Since the statistics dot function is modified to an empty function in Blink, all dot statistics are gone, and the management class of dot statistics cannot receive any data, so the management class is equivalent to being useless. However, the management class is still created when Blink is initialized, and is called at certain key nodes in the page life cycle. Therefore, the eighth step is to modify and optimize the management class StatisticsRecorder of the Histogram log module, minimize it, remove the data in the class, and replace all functions in the class with empty functions, which can not only reduce the size of the library, but also reduce memory usage and save CPU time at runtime. For example, there is a function in the source code that indicates whether to record statistics, which is modified to directly return false.

[0054] After this modification, all methods in the StatisticsRecorder class can be replaced with empty functions. After the above steps, the Histogram log module can be optimized to the minimum.

[0055] The Histogram log module has lost its original function after optimization, so the metrics module and services that use the Histogram log module can also be optimized. The metrics module and services use the output function of the Histogram log module, so the metrics module and services can be modified or deleted. The metrics module and services are UKM (URL-Keyed Metrics) recording modules, which are used to collect UKM records. UKM records count Blink's resource usage in the form of events. The UKM module's statistics are directly called in the source code. The UKM class is created and passed to the metrics service after ukm_recorder is created. Therefore, it is more complicated to modify the UKM statistics. It is necessary to find the place where the UKM module is called in the Blink source code, and then make different modifications according to the specific source code of the context. Most of them only require calling empty functions.

[0056] The present invention reduces the library size by about 1M, reduces the memory usage during runtime, especially the stack memory, and also saves CPU time.

[0057] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0059] According to another aspect of the embodiments of the present application, a device for implementing the above method is also provided. Figure 4 is a schematic diagram of an optional optimization device for a log module Histogram in a web page rendering engine according to an embodiment of the present application, such as Figure 4 As shown, the device may include:

[0060] An acquisition unit 41 is used to acquire the source code of the web page rendering engine Blink, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; a compilation unit 42 is used to compile the source code of the web page rendering engine to obtain the web page rendering engine used in the embedded device.

[0061] Optionally, the apparatus of the present application may further include: an optimization unit, for modifying the macro definition in the source code of the web page rendering engine Blink to an empty call before obtaining the source code of the web page rendering engine, so that the statistical dot function inserted in the web page rendering engine calls an empty function.

[0062] Optionally, the optimization unit is further used to: define a target function in the log module before obtaining the source code of the web rendering engine Blink, wherein the target function is a function in the HistogramBase class that is called in the parameter when the source code of the web rendering engine calls the macro definition.

[0063] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the function in the UMA module in the log module to be an empty call.

[0064] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the statistical dot function that directly calls the Histogram class to insert statistical dot in the source code of the web page rendering engine to be an empty call.

[0065] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the custom Histogram macro definition used in the net module of the web page rendering engine to call an empty function.

[0066] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the gpu module of the web page rendering engine to call an empty function.

[0067] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the storage module of the web page rendering engine to call an empty function.

[0068] Optionally, the optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the ui module of the web page rendering engine to call an empty function.

[0069] By applying the technical solution of the present invention, the source code of the web page rendering engine Blink is obtained, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; the source code of the web page rendering engine is compiled to obtain the web page rendering engine used in the embedded device, and the modified empty class or empty function will be optimized by the compiler during the compilation and linking process of Blink, so that there will be no call to the Histogram log module in the generated library. Therefore, after optimization, the purpose of reducing the library size, reducing memory usage, and saving CPU time can be achieved, thereby solving the problem of more resource usage of the web page rendering engine in the prior art.

[0070] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, numerical expressions and numerical values ​​do not limit the scope of the present invention. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be regarded as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.

[0071] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0072] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the devices or elements referred to must have a specific direction or be constructed and operated in a specific direction. Therefore, they cannot be understood as limiting the scope of protection of the present invention. The directional words "inside and outside" refer to the inside and outside relative to the contours of each component itself.

[0073] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for optimizing the Histogram of a log module in a web page rendering engine, characterized in that: include: Obtaining source code of a web page rendering engine Blink, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; Compiling the source code of the web page rendering engine to obtain the web page rendering engine used in the embedded device; Before obtaining the source code of the web page rendering engine Blink, the method further includes: Modify the macro definition in the source code of the web page rendering engine to an empty call, so that the statistical dot function inserted in the web page rendering engine calls an empty function; Before obtaining the source code of the web page rendering engine Blink, the method further includes: A target function is defined in the log module, wherein the target function is a function of the HistogramBase class that is called in a parameter when the source code of the web page rendering engine calls a macro definition; Before obtaining the source code of the web page rendering engine Blink, the method further includes: Set the function in the UMA module in the log module to be an empty call; Before obtaining the source code of the web page rendering engine Blink, the method further includes: Set the statistical dot function that directly calls the Histogram class to insert statistical dot in the source code of the web page rendering engine to an empty call; Before obtaining the source code of the web page rendering engine Blink, the method further includes: The custom Histogram macro definition used in the net module of the web page rendering engine is set to call an empty function; Before obtaining the source code of the web page rendering engine Blink, the method further includes: The Histogram macro definition used in the gpu module of the web page rendering engine is set to call an empty function.

2. The method according to claim 1, characterized in that Before obtaining the source code of the web page rendering engine Blink, the method further includes: The Histogram macro definition used in the storage module of the web page rendering engine is set to call an empty function.

3. The method according to claim 1, characterized in that Before obtaining the source code of the web page rendering engine Blink, the method further includes: The Histogram macro definition used in the UI module of the web page rendering engine is set to call an empty function.

4. A device for optimizing the log module Histogram in a web page rendering engine, characterized in that: include: An acquisition unit, configured to acquire source code of a web page rendering engine Blink, wherein the source code of the web page rendering engine includes a log module Histogram, and the log module includes an empty class or an empty function called by the source code of the web page rendering engine; A compiling unit, used for compiling the source code of the web page rendering engine to obtain the web page rendering engine used in the embedded device; The optimization unit is used to modify the macro definition in the source code of the web page rendering engine Blink to an empty call before obtaining the source code of the web page rendering engine Blink, so that the statistical dot function inserted in the web page rendering engine calls an empty function; The optimization unit is further used to: define a target function in the log module before obtaining the source code of the web page rendering engine Blink, wherein the target function is a function in the HistogramBase class that is called in a parameter when the source code of the web page rendering engine calls a macro definition; The optimization unit is further used to: before obtaining the source code of the web page rendering engine Blink, set the function in the UMA module in the log module to be an empty call; The optimization unit is further used for: before obtaining the source code of the web page rendering engine Blink, setting the statistical dot function that directly calls the Histogram class to insert statistical dot in the source code of the web page rendering engine as an empty call; The optimization unit is further used for: before obtaining the source code of the web page rendering engine Blink, setting the custom Histogram macro definition used in the net module of the web page rendering engine to call an empty function; The optimization unit is also used to: before obtaining the source code of the web page rendering engine Blink, set the Histogram macro definition used in the gpu module of the web page rendering engine to call an empty function.