CN117271371A - Performance test method, device, computer equipment and storage medium - Google Patents

Performance test method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117271371A
CN117271371A CN202311492189.6A CN202311492189A CN117271371A CN 117271371 A CN117271371 A CN 117271371A CN 202311492189 A CN202311492189 A CN 202311492189A CN 117271371 A CN117271371 A CN 117271371A
Authority
CN
China
Prior art keywords
performance
tested
target
game
index
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.)
Granted
Application number
CN202311492189.6A
Other languages
Chinese (zh)
Other versions
CN117271371B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311492189.6A priority Critical patent/CN117271371B/en
Publication of CN117271371A publication Critical patent/CN117271371A/en
Application granted granted Critical
Publication of CN117271371B publication Critical patent/CN117271371B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a performance test method, a performance test device, computer equipment and a storage medium, wherein a game running resource file of a game application to be tested can be obtained; determining performance indexes to be tested of the game application to be tested according to the game scene information of the game application to be tested; performing test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file; running a game based on the configured game running resource file, and collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier; and generating a performance test result of the game application to be tested according to the index data. The automatic performance test is realized, and the efficiency and the accuracy of the performance test are improved.

Description

Performance test method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a performance testing method, a performance testing device, a computer device, and a storage medium.
Background
With the rapid development of smart devices, applications that can be used by smart devices are becoming more and more abundant, for example, game applications can be installed to run games. However, as the complexity of games continues to increase, various performance problems may occur during their development, and thus, related performance testing of the game application is typically required prior to release of the game application.
At present, in the process of performing performance test on game application, firstly, a release version package containing all game scene resources is constructed to find out problems, then, an independent development version package is constructed for the problems to perform data acquisition, and testers participate in test and statistical analysis. Therefore, the whole development version package is longer in construction time, development time is wasted, the data storage length is very limited when data acquisition is carried out, the self-defined collection of various data cannot be realized, the reliability of testing is reduced, meanwhile, the acquisition and output of various log files can be carried out in the development version package, the recording of performance data can be greatly influenced, and particularly, the frame rate of a low-end machine is greatly influenced. In addition, problems occurring in release version packages are often not reproduced well when the development version packages are reused for reproduction, especially for various multi-person scene problems, labor is very consumed in organizing the reproduction scene problems, and the participation of testers causes artificial subjective influence in the test process, so that not only is the labor cost consumed, but also the test result is influenced.
Disclosure of Invention
The embodiment of the application provides a performance testing method, a performance testing device, computer equipment and a storage medium, which can improve the efficiency and the accuracy of performance testing.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
the embodiment of the application provides a performance test method, which comprises the following steps:
acquiring a game running resource file of a game application to be tested;
determining performance indexes to be tested of the game application to be tested according to the game scene information of the game application to be tested;
performing test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file;
running a game based on the configured game running resource file, and collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier;
and generating a performance test result of the game application to be tested according to the index data.
According to an aspect of the present application, there is also provided a performance test apparatus including:
the acquisition unit is used for acquiring a game running resource file of the game application to be tested;
the determining unit is used for determining performance indexes to be tested of the game application to be tested according to the game scene information of the game application to be tested;
the configuration unit is used for carrying out test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file;
The first acquisition unit is used for running the game based on the configured game running resource file and acquiring index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier;
and the first generation unit is used for generating a performance test result of the game application to be tested according to the index data.
In some embodiments, the performance testing apparatus further comprises:
the screening unit is used for screening target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test result;
the setting unit is used for setting a target test identifier in the game running resource file according to the target performance index to obtain a target game running resource file;
the compiling unit is used for compiling the target game running resource file to obtain a compiled game running resource file;
the second acquisition unit is used for loading the compiled game running resource file and acquiring target index data corresponding to the target performance index based on the target test identifier;
and the second generating unit is used for generating a target performance test result of the game application to be tested according to the target index data.
In some embodiments, the screening unit is specifically configured to:
and screening out index data with the operation time consumption greater than a preset time length threshold from the index data of the performance indexes to be tested according to the performance test result, and taking the performance indexes to be tested corresponding to the screened out index data as target performance indexes.
In some embodiments, the second acquisition unit is specifically configured to:
acquiring the instruction number of the performance index function provided with the target test identifier in the game running resource file;
screening performance indexes corresponding to performance index functions with instruction numbers larger than a preset quantity threshold from the target performance indexes to obtain screened performance indexes;
and acquiring target index data corresponding to the screened performance index based on the target test identifier.
In some embodiments, the target performance index includes a plurality of target performance indexes, and the second acquisition unit is specifically configured to: invoking a plurality of threads to run a performance index function provided with the target test identifier, and respectively collecting target index data corresponding to each target performance index;
the performance test device further includes:
and the storage unit is used for determining the function identifier of the performance index function operated by each thread and storing the target index data of the target performance index matched with the function identifier into a storage address matched with the thread identifier of each thread.
In some embodiments, the test identifier includes a start identifier and a termination identifier, and the configuration unit is specifically configured to:
determining the code position matched with the performance index to be tested in the game running resource file;
and configuring a start identifier and a termination identifier in the game running resource file according to the code position to obtain the configured game running resource file.
In some embodiments, the first acquisition unit is specifically configured to:
calling a timing function through a performance interface adapter, starting timing at the position of the start mark, and ending timing at the position of the stop mark to obtain the running time of the performance index to be tested;
and generating index data corresponding to the performance index to be tested of the game application to be tested according to the running time.
In some embodiments, the performance testing apparatus further comprises:
the processing unit is used for carrying out serialization processing on the performance test result and generating a performance test file based on the serialized performance test result;
the compression unit is used for compressing the performance test file to obtain a compressed performance test file;
and the uploading unit is used for uploading the compressed performance test file to a server.
According to an aspect of the present application, there is also provided a computer device, including a processor and a memory, where the memory stores a computer program, and when the processor invokes the computer program in the memory, any one of the performance test methods provided by the embodiments of the present application is executed.
According to an aspect of the present application, there is also provided a storage medium for storing a computer program, the computer program being loaded by a processor to perform any one of the performance test methods provided by the embodiments of the present application.
According to one aspect of the present application, there is also provided a computer program product comprising a computer program loaded by a processor for performing any of the performance testing methods provided by the embodiments of the present application.
According to the embodiment of the application, the game running resource file of the game application to be tested can be obtained, and the performance index to be tested of the game application to be tested is determined according to the game scene information of the game application to be tested; then, the game running resource file can be subjected to test identification configuration according to the performance index to be tested, and the configured game running resource file is obtained; running the game based on the configured game running resource file, collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier, and generating a performance test result of the game application to be tested according to the index data. According to the scheme, the automatic performance test can be completed only by the game running resource file, a development version does not need to be constructed, collection and output of various log files do not need to be carried out, the test time is saved, the influence on the performance of a low-end machine is reduced, the test efficiency and convenience are improved, and the customized collection of targeted index data can be realized through test identification configuration, so that a performance test result is generated, and the reliability and accuracy of the performance test are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scenario in which a performance test method provided in an embodiment of the present application is applied;
FIG. 2 is a schematic flow chart of a performance testing method according to an embodiment of the present disclosure;
FIG. 3 is another flow chart of a performance testing method according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of performance testing by a lightweight performance analyzer LightProfiler provided by an embodiment of the present application;
fig. 5 is a schematic diagram of a LightProfiler data acquisition architecture provided in an embodiment of the present application;
FIG. 6 is a schematic diagram of a performance test result display provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of performance testing by a deep profiler provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a data store provided by an embodiment of the present application;
FIG. 9 is a schematic diagram of a target performance test result display provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of a performance testing apparatus provided by an embodiment of the present application;
fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In the following description of the present application reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
In the following description of the present application, the terms "first", "second", etc. are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", etc. may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the present application described herein to be implemented in an order other than that illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
The embodiment of the application provides a performance test method, a performance test device, computer equipment and a storage medium.
Referring to fig. 1, fig. 1 is a schematic view of a scenario in which a performance testing method provided by an embodiment of the present application is applied, where the performance testing method may be applied to a performance testing system, where the performance testing system may include a server 10, a terminal 20, and the like, and the terminal 20 may be integrated with a performance testing device provided by the present application, and the terminal 20 may be a mobile phone, a computer, an intelligent home appliance, a vehicle-mounted terminal, a wearable device, or the like. The server 10 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligence platforms, but is not limited thereto. The server 10 and the terminal 20 may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
The terminal 20 may be configured to obtain a game running resource file of the game application to be tested, and determine, according to game scene information of the game application to be tested, a performance index to be tested of the game application to be tested; then, the game running resource file can be subjected to test identification configuration according to the performance index to be tested, and the configured game running resource file is obtained; running the game based on the configured game running resource file, collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier, and generating a performance test result of the game application to be tested according to the index data.
After the performance test result is obtained, the terminal 20 may perform serialization processing on the performance test result, generate a performance test file based on the serialized performance test result, perform compression processing on the performance test file to obtain a compressed performance test file, upload the compressed performance test file to the server 10, and store the compressed performance test file by the server 10. When the performance test result is required to be used, the terminal 20 may send a file acquisition request to the server 10, the server 10 responds to the file acquisition request and sends the stored compressed performance test file to the terminal 20, the terminal 20 may decompress the compressed performance test file to obtain the performance test file, extract the serialized performance test result from the performance test file, and perform deserialization on the serialized performance test result to obtain the performance test result of the game application to be tested.
In addition, the terminal 20 may also perform a deep performance test: and screening target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test results, and setting target test identifiers in the game running resource files according to the target performance indexes to obtain target game running resource files. And compiling the target game running resource file to obtain a compiled game running resource file, loading the compiled game running resource file, collecting target index data corresponding to the target performance index based on the target test identifier, and generating a target performance test result of the game application to be tested according to the target index data.
After obtaining the target performance test result, the terminal 20 may perform serialization processing on the target performance test result, generate a target performance test file based on the serialized target performance test result, perform compression processing on the target performance test file to obtain a compressed target performance test file, upload the compressed target performance test file to the server 10, and store the compressed target performance test file by the server 10.
According to the scheme, the automatic performance test can be completed only by the game running resource file, a development version does not need to be constructed, collection and output of various log files do not need to be carried out, the test time is saved, the influence on the performance of a low-end machine is reduced, the test efficiency and convenience are improved, and the customized collection of targeted index data can be realized through test identification configuration, so that the reliability and accuracy of the performance test are improved.
It should be noted that, the schematic view of the scenario of the application of the performance test method shown in fig. 1 is only an example, and the application and the scenario of the performance test method described in the embodiment of the present application are for more clearly describing the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application, and those skilled in the art can know that, with the evolution of the application of the performance test method and the appearance of a new service scenario, the technical solution provided by the embodiment of the present application is equally applicable to similar technical problems.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
In the present embodiment, description will be made from the viewpoint of a performance test apparatus, which may be integrated in a computer device such as a terminal.
Referring to fig. 2, fig. 2 is a flow chart illustrating a performance testing method according to an embodiment of the disclosure. The performance test method may include:
s101, acquiring a game running resource file of the game application to be tested.
The game application to be tested may be a game application of a hand game or other types, but is not limited thereto, and the game application to be tested may be run on a terminal. The game running resource file may include a code file, a game configuration file, a game audio/video file, and other game scene resources required for running the game, and of course, the game running resource file may also include other resource files, which are not limited herein.
The method for obtaining the game running resource file may include: receiving a file editing instruction input by a user, and generating a game running resource file of the game application to be tested based on editing content input by the file editing instruction; or receiving a game running resource file of the game application to be tested, which is sent by the file generation terminal; or sending an acquisition request to a server, and receiving a game running resource file of the game application to be tested returned by the server in response to the acquisition request; etc. Of course, the game execution resource file may be obtained in other manners, which are not limited herein.
S102, determining performance indexes to be tested of the game application to be tested according to game scene information of the game application to be tested.
For different game applications to be tested, different game scene information can be corresponding, wherein the game scene information can comprise information such as the number of virtual characters, the moving position, the execution action, the release skill and the like, and can also comprise information such as game environment, buildings, props and the like.
After determining the game application to be tested, one or more game scene information of the game application to be tested can be obtained, and the performance index to be tested of the game application to be tested is determined according to the one or more game scene information of the game application to be tested. For example, the game scene information to be focused can be screened out from various game scene information of the game application to be tested through experience knowledge of research personnel, target game scene information is obtained, and the performance index to be tested of the game application to be tested is determined based on the target game scene information. For another example, a performance index model may be trained in advance, game scene information of the game application to be tested is obtained through the trained performance index model, and according to the game scene information of the game application to be tested, the performance index to be tested of the game application to be tested is determined, where a specific model structure of the performance index model may be flexibly set according to actual requirements, and the method is not limited herein.
The performance indicators to be tested may include Frame Per Second (FPS), power system static stabilizer (Power System Stabilizer, PSS), central processing unit (Central Processing Unit, CPU) occupation, frame rendering time (frametime), graphics rendering thread time (gfxthreadtime), memory usage (Mono) of the memory occupied by script code running (Mono), total memory allocated by one (Mono reserved), draw calls (drawcall), number of rendering channels (setpass calls), moving time of virtual characters, time of executing a certain action, time of releasing a certain skill, and the like. The performance index to be tested may be referred to as a performance hot spot, which may be a performance representative index that needs attention, and may be fully automatically resolved (i.e., tested) by a lightweight performance analyzer (LightProfiler) to realize monitoring of the performance hot spot.
S103, performing test identification configuration on the game running resource file according to the performance index to be tested to obtain the game running resource file after configuration.
After determining the performance index to be tested of the game application to be tested, determining configuration information needing to be subjected to test identifier configuration in the game running resource file according to the performance index to be tested, and carrying out test identifier configuration on the game running resource file based on the configuration information to obtain a configured game running resource file, wherein the configuration information can comprise the configuration number, the configuration position and the like of the test identifiers. The configured game running resource file contains a test identifier, the test identifier can be used for identifying a test position or test content and the like, the test identifier can comprise one or more test identifiers, and the specific content of the test identifier can be flexibly set according to actual requirements without limitation. The configuration of the test identifier may be referred to as a instrumentation configuration, where instrumentation may be understood as setting a point of interest for performance so as to collect information about the point of interest during execution of the test.
In order to improve accuracy and convenience of test identifier configuration, an initial identifier and a termination identifier may be configured based on the determined position, and in some embodiments, the test identifier includes an initial identifier and a termination identifier, and the test identifier configuration is performed on the game running resource file according to the performance index to be tested, to obtain a configured game running resource file, including:
determining the code position matched with the performance index to be tested in the game running resource file;
and configuring a start identifier and a termination identifier in the game running resource file according to the code position to obtain the configured game running resource file.
The test identifier comprises a start identifier and a termination identifier, and index data corresponding to the performance index to be tested can be collected between the start identifier and the termination identifier in the process of executing the test. Specifically, in the process of configuring the test identifier, a code position in the game running resource file, which is matched with the performance index to be tested, may be determined first, for example, when the performance index to be tested is a test frame rendering time (frame time), a code position in the game running resource file of the frame rendering function may be determined, and for example, if the performance index to be tested is time consuming for testing to release a certain skill, a code position in the game running resource file of the skill function may be determined.
Then, the starting identifier and the ending identifier can be configured in the game running resource file according to the code position, so that the configured game running resource file is obtained. For example, a start identifier may be configured according to a code start position of the frame rendering function in the game execution resource file, and a stop identifier may be configured according to a code stop position of the frame rendering function in the game execution resource file. The starting identifier and the ending identifier are accurately configured in the game running resource file by determining the code position, so that the accuracy and convenience of configuration of the test identifier are improved.
And S104, running the game based on the configured game running resource file, and acquiring index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier.
After the configured game running resource file is obtained, the game can be run based on the configured game running resource file, and in the game running process, index data corresponding to the performance index to be tested of the game application to be tested is collected based on the pre-configured test identifier, the index data can be different based on different performance indexes to be tested, and the index data can comprise the used amount of memory, the time-consuming value of frame rendering, the time-consuming value of releasing a certain skill and the like.
Since the test identifier includes a start identifier and a stop identifier, where the start identifier may be a start timing identifier (i.e., a start timing identifier) and the stop identifier may be a stop timing identifier (i.e., a stop timing identifier), the running time may be counted by the start identifier and the stop identifier, and in some embodiments, the collecting, based on the test identifier, index data corresponding to a performance index to be tested of the game application to be tested includes:
calling a timing function through the performance interface adapter, starting timing at the position of the start mark, and ending timing at the position of the stop mark to obtain the running time of the performance index to be tested;
and generating index data corresponding to the performance index to be tested of the game application to be tested according to the running time.
Specifically, the timing function can be called through the performance interface adapter, timing is started at the position of the start identifier based on the timing function, and timing is ended at the position of the end identifier, so that the running time of the performance index to be tested can be obtained, index data corresponding to the performance index to be tested can be generated according to the running time, for example, the running time can be used as the index data corresponding to the performance index to be tested, and for example, the running time can be used as the index data corresponding to the performance index to be tested after being fused with other data. Index data is generated by counting the time consumption of operation, so that the flexibility of index data acquisition is improved.
Taking the test identifier as the instrumentation configuration as an example, the instrumentation time consumption statistics are exemplified, when the instrumentation configuration is carried out, an automatic performance timing record can be directly carried out by using an automatic timing function (LightProfilerAutoObject), the time consumption is directly timed by using the inspection time of the shell shader (hullflader) (namely automatic timing), the time consumption statistics can also be realized by matching the use of a start timing identifier (lightrofiler_begin) and an END timing identifier (lightrofiler_end), the statistics interval mark can be carried out before the time consumption, and the lightrofiler_end () can be used after the time consumption, so that the time consumption statistics of the whole interval from the start timing mark to the END timing mark are completed.
The pile-inserting time-consuming statistics principle may be that a start mark BeginTag (namely a start timing mark) is stored in a start time-consuming statistics function (LightProfiler:: begin), a current time stamp is pressed into a queue for storage, and a current corresponding time-consuming label is marked by a name mark (push_marker); when the time consumption statistics are ended, an End mark EndTag (namely an End timing mark) is saved by an End time consumption statistics function (LightProfiler: end), a current time stamp is pressed into a queue for saving, and the total time consumption can be calculated through the time stamp of starting timing and the time stamp of ending timing saved in the queue.
S105, generating a performance test result of the game application to be tested according to the index data.
After the index data corresponding to the performance index to be tested is obtained, a performance test result of the game application to be tested can be generated according to the index data, and the performance test result can include other information such as a performance analysis result besides the index data, and is not limited herein. For example, performance analysis may be performed on the game application to be tested based on index data corresponding to the performance index to be tested, to obtain a performance analysis result, and a performance test result of the game application to be tested may be generated based on the performance analysis result and the index data.
In order to facilitate storing the performance test result, the performance test result may be serialized, compressed, and the like, and then uploaded to a server for storing, and in some embodiments, after generating the performance test result of the game application to be tested according to the index data, the performance test method further includes:
serializing the performance test result, and generating a performance test file based on the serialized performance test result;
compressing the performance test file to obtain a compressed performance test file;
And uploading the compressed performance test file to a server.
Specifically, after the performance test result is obtained, the performance test result may be subjected to serialization processing, for example, data included in the performance test result may be subjected to serialization processing, so as to obtain a binary serialized performance test result. A performance test file is then generated based on the serialized performance test results, e.g., the serialized performance test results may be written to the performance test file. At this time, the performance test file may be compressed to obtain a compressed performance test file, and the compressed performance test file is uploaded to a server, where the server stores the compressed performance test file, and the server may be a background server of the game application to be tested, or a designated file storage server. After the performance test results are processed in sequence, compressed and the like, compressed performance test files are obtained, the compressed performance test files are uploaded to a server, the transmission efficiency of the compressed performance test files can be improved, the compressed performance test files are stored through the server, and the storage convenience and safety of the compressed performance test files are improved.
It should be noted that, the compressed performance test file may be encrypted according to actual requirements to obtain an encrypted performance test file, and the encrypted performance test file is uploaded to the server.
When the performance test result is required to be used, a file acquisition request can be sent to a server, the compressed performance test file sent by the server in response to the file acquisition request is received, decompression processing is carried out on the compressed performance test file to obtain the performance test file, the serialized performance test result is extracted from the performance test file, and deserialization processing is carried out on the serialized performance test result to obtain the performance test result of the game application to be tested.
After obtaining the performance test result of the game application to be tested, since the performance test result may be a performance test result obtained by performing a performance test by a lightweight performance analyzer (LightProfiler), in order to further analyze a depth cause affecting performance, a depth performance analysis may be performed on the game application to be tested by a depth performance analyzer (deep profiler), and in some embodiments, after generating the performance test result of the game application to be tested according to the index data, the performance test method further includes:
Screening target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test results;
setting a target test identifier in the game operation resource file according to the target performance index to obtain a target game operation resource file;
compiling the target game operation resource file to obtain a compiled game operation resource file;
loading a compiled game running resource file, and collecting target index data corresponding to a target performance index based on a target test identifier;
and generating a target performance test result of the game application to be tested according to the target index data.
Specifically, first, according to the performance test result of the game application to be tested, target performance indexes meeting the conditions may be screened out from the performance indexes to be tested, for example, target performance indexes having abnormality or having long running time may be screened out.
In some embodiments, according to the performance test result, selecting a target performance index satisfying the condition from the performance indexes to be tested, including: according to the performance test result, screening out the index data with the operation time consumption greater than the preset time length threshold value from the index data of the performance index to be tested, and taking the performance index to be tested corresponding to the screened index data as the target performance index.
Specifically, according to the performance test result, the index data with the operation time consumption greater than the preset time length threshold value can be screened out from the index data of the performance indexes to be tested, and the performance indexes to be tested corresponding to the screened index data with the operation time consumption greater than the preset time length threshold value are used as target performance indexes, for example, the corresponding target performance indexes such as frame rendering or skill release with the operation time consumption greater than the preset time length threshold value can be screened out, so that the target performance indexes required for deep performance analysis can be screened out in a targeted manner, and the flexibility and convenience of screening the target performance indexes are improved. The specific value of the preset duration threshold can be flexibly set according to actual requirements, and the preset duration threshold is not limited herein.
After the target performance index is determined, a target test identifier can be set in the game running resource file according to the target performance index, so as to obtain a target game running resource file. For example, the configuration information of the game running resource file, which needs to be configured with the target test identifier, can be determined according to the target performance index, and the game running resource file is configured with the target test identifier based on the configuration information, so as to obtain the target game running resource file. The configuration information may include a configuration number and a configuration location of the target test identifier, and the configuration of the target test identifier may be referred to as a instrumentation configuration.
After the target game running resource file is obtained, the target game running resource file can be compiled to obtain the compiled game running resource file, then the compiled game running resource file is loaded, and target index data corresponding to the target performance index is acquired based on the target test identifier.
To reduce the impact on the low consumption function, in some embodiments, collecting target performance index data corresponding to a target performance index based on a target test identity includes:
acquiring the instruction number of a performance index function provided with a target test identifier in a game running resource file;
screening performance indexes corresponding to performance index functions with instruction numbers larger than a preset number threshold from target performance indexes to obtain screened performance indexes;
and acquiring target index data corresponding to the screened performance indexes based on the target test identification.
Specifically, firstly, the instruction number of the performance index function with the target test identifier in the game running resource file is obtained, wherein the instruction number can be the number of code call lines, and the performance index function can be called a performance hot spot function or a hot spot function. And then, performance index functions with the instruction number larger than the preset number threshold can be screened out, so that performance indexes corresponding to the performance index functions with the instruction number larger than the preset number threshold can be screened out from target performance indexes, and the screened performance indexes are obtained, wherein specific values of the preset number threshold can be flexibly set according to actual requirements, and the performance index functions are not limited. At this time, target index data corresponding to the performance index after screening may be collected based on the target test identifier.
Taking deep profiler instrumentation as an example, starting timing function (enter_mono_sample) represents to start timing operation marking on a current function, ending timing function (leave_mono_sample) represents to end timing operation marking on the current function, instrumentation processing is performed on all functions of a game only by starting a deep parser (enable deep profiler) during construction, in order to reduce the influence on a low consumption function, the instruction number of a performance index function (namely a hot spot function) can be obtained through a method instruction number function (method (), body, entities, count), and only the time-consuming acquisition is performed on the performance index function with the instruction number larger than a preset number threshold (for example, 10), so that the influence on the low consumption function is reduced, full-scale automation on the hot spot function based on the deep profiler is realized, and the efficiency of performance test is improved.
When the deep profiler saves the hot-spot function call information (which may include time-consuming function running), only the function identifier (i.e., function ID) of each hot-spot function may be recorded, so as to avoid the overhead of mark-up (Marshal) of the runtime symbol. For example, for function a, function B, function C, function D and function E, in the instrumentation logic, the memory addresses of function IDs 0x10001 to 0x10005 are automatically recorded, and when 0x00001 is represented as a function exit flag, the call sequence of function a to function E is sequentially stored in the memory addresses of 0x10001, 0x10002, 0x10004, 0x00001, 0x10003, 0x10005, 0x00001 and 0x 00001.
In some embodiments, the target performance index includes a plurality of target performance index data corresponding to the target performance index is collected based on the target test identifier, including: invoking a plurality of threads to run a performance index function provided with target test marks, and respectively collecting target index data corresponding to each target performance index;
after collecting the target index data corresponding to the target performance index based on the target test identifier, the performance test method further comprises the following steps: and determining the function identification of the performance index function operated by each thread, and storing the target index data of the target performance index matched with the function identification into a storage address matched with the thread identification of each thread.
Specifically, when the target performance indexes include a plurality of target performance indexes, each target performance index corresponds to a performance index function, each performance index function corresponding to each target performance index is provided with a target test identifier, at this time, a plurality of threads can be called to respectively run the performance index function provided with the target test identifier, and target index data corresponding to each target performance index is respectively collected based on the running performance index function. After the target index data is obtained, the function identifier (i.e., function ID) of the performance index function operated by each thread may be determined, and the target index data of the target performance index matched with the function identifier may be stored to a storage address matched with the thread identifier (i.e., thread ID) of each thread. For example, a mapping relationship between the function identifier of the performance index function corresponding to each target performance index, the thread identifier of each thread, and the storage address may be constructed, and target index data of the target performance index matching the function identifier may be stored in the storage address matching the thread identifier according to the mapping relationship. For another example, a function identifier of a performance index function corresponding to each target performance index may be constructed, a first mapping relationship between the function identifier and a thread identifier of each thread running the performance index function, and a second mapping relationship between the thread identifier and a storage address of each thread, and target index data of the target performance index matching the function identifier may be stored in the storage address matching the thread identifier according to the first mapping relationship and the second mapping relationship.
Taking deep profiler data acquisition as an example, in the process of deep profiler data acquisition, a C# logic may have a plurality of threads, instrumentation codes cannot be distinguished, at this time, the overhead of acquiring a thread ID can be optimized by using an inline assembly instruction in ID identification, a current thread ID is acquired by an instruction asm volt ("src p15, 0,% 0, C13, C0, 3": "=r" (tid)), and target index data is stored in a storage address matched with the thread ID, so that data differentiated storage under multiple threads can be realized.
After the target index data is obtained, a target performance test result of the game application to be tested can be generated according to the target index data. The target performance test result may include, in addition to target index data, other information such as a target performance analysis result, which is not limited herein. For example, a target performance analysis result may be obtained after performance analysis is performed based on target index data, and a target performance test result of the game application to be tested may be generated based on the target performance analysis result and the target index data. The performance test result may include target index data (such as how much time is spent by the frame time) collected based on the LightProfiler, and the target performance test result may include target index data (such as how much time is spent by the frame time, including which functions are spent by the frame time), where both the LightProfiler and the deepfilter can store and parse the hotspot function offline (i.e., offline test) for a long time.
After the target performance test result is obtained, the target performance test result can be subjected to serialization processing, a target performance test file is generated based on the serialized target performance test result, the target performance test file is subjected to compression processing to obtain a compressed target performance test file, the compressed target performance test file is uploaded to a server, and the server stores the compressed target performance test file. The compressed target performance test file can be encrypted according to actual requirements to obtain an encrypted target performance test file, and the encrypted target performance test file is uploaded to a server.
When the target performance test result is required to be used, a target file acquisition request can be sent to a server, the target performance test file after compression is sent by the server in response to the target file acquisition request, decompression processing is carried out on the target performance test file after compression to obtain the target performance test file, the serialized target performance test result is extracted from the target performance test file, and anti-serialization processing is carried out on the serialized target performance test result to obtain the target performance test result of the game application to be tested.
According to the embodiment of the application, the game running resource file of the game application to be tested can be obtained, and the performance index to be tested of the game application to be tested is determined according to the game scene information of the game application to be tested; then, the game running resource file can be subjected to test identification configuration according to the performance index to be tested, and the configured game running resource file is obtained; running the game based on the configured game running resource file, collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier, and generating a performance test result of the game application to be tested according to the index data. According to the scheme, the automatic performance test can be completed only by the game running resource file, a development version does not need to be constructed, collection and output of various log files do not need to be carried out, the test time is saved, the influence on the performance of a low-end machine is reduced, the test efficiency and convenience are improved, and the customized collection of targeted index data can be realized through test identification configuration, so that a performance test result is generated, and the reliability and accuracy of the performance test are improved.
The method described in the above embodiments is described in further detail below by way of example.
In this embodiment, the performance testing apparatus is integrated in a terminal, where the terminal may be provided with a U3D (Unity 3D) platform, and an automatic performance test is implemented by using the U3D platform, where the U3D may be a real-time 3D interactive content creation and operation platform, and all creators including game development, art, architecture, automobile design, and video use of Unity to make the creative realistic. The Unity platform can provide a complete set of software solutions, can be used for creating, operating and rendering any real-time interactive 2D and 3D content, and can support terminals such as mobile phones, computers, game hosts, augmented reality and virtual reality devices. Referring to fig. 3, fig. 3 is another flow chart of the performance testing method according to the embodiment of the present application. The method flow may include:
s201, the terminal acquires a game running resource file of the game application to be tested.
S202, the terminal determines performance indexes to be tested of the game application to be tested according to game scene information of the game application to be tested.
For example, the terminal may display game scene information of the game application to be tested and receive performance indicators to be tested of the game application to be tested input by the user based on the game scene information. For another example, the terminal may obtain game scene information of the game application to be tested through the trained performance index model, and determine the performance index to be tested of the game application to be tested according to the game scene information of the game application to be tested.
S203, the terminal performs test identification configuration on the game running resource file according to the performance index to be tested, and the game running resource file after configuration is obtained.
The terminal can determine configuration information which needs to be subjected to test identification configuration in the game running resource file according to the performance index to be tested, and perform test identification configuration (i.e. instrumentation configuration) on the game running resource file based on the configuration information to obtain a configured game running resource file, wherein the configuration information can comprise the configuration quantity, the configuration position and the like of the test identification.
For example, as shown in fig. 4, the terminal may perform stub configuration of the LightProfiler on related performance hot spots in a game running resource file (including a program or an engine, etc.), after the configuration is completed, may perform index data collection of various configured performance hot spots (i.e., lightProfiler data collection) in the game running process, such as various game time including frame rendering time (frame time) and graphic rendering thread time (gfxthreadtime), and then aggregate the index data of the performance hot spots, perform file writing (i.e., performance aggregate file writing), then perform compression processing on the whole file, and finally perform background uploading and saving (i.e., uploading to a server for storage).
S204, the terminal runs the game based on the configured game running resource file, and collects index data corresponding to the performance index to be tested of the game application to be tested based on the test identification.
The terminal can run the game through the U3D platform based on the configured game running resource file, and acquire index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier. For example, when the terminal performs pile insertion configuration, an automatic performance timing record may be directly performed by using an automatic timing function (LIGHTPROFILER autoobject), and the time consumed by checking the shell shader (hullhead) may be directly performed by using the light timer_ AUTO (CheckHullSHader) (i.e., automatic timing), or the time consumed by using the start timing identifier (light timer_begin) and the END timing identifier (light timer_end) together may be used to implement time consumed statistics, and the statistics interval may be marked by using the light timer_ BEGIN (CheckHullSHader) before the time consumed and the light timer_end (), so that the time consumed statistics from the start timing identifier to the END timing identifier for the whole interval is completed.
The pile-inserting time-consuming statistics principle may be that a start mark BeginTag (namely a start timing mark) is stored in a start time-consuming statistics function (LightProfiler:: begin), a current time stamp is pressed into a queue for storage, and a current corresponding time-consuming label is marked by a name mark (push_marker); when the time consumption statistics are ended, an End mark EndTag (namely an End timing mark) is saved by an End time consumption statistics function (LightProfiler: end), a current time stamp is pressed into a queue for saving, and the total time consumption can be calculated through the time stamp of starting timing and the time stamp of ending timing saved in the queue.
For example, as shown in fig. 5, the architecture of the LightProfiler data collection may include a Native Engine (Native Engine) local service Native layer, various types of adapters (Native & Managed adapter), game management (name: managed), write loop (Write frame loop), etc., and the index data cached in each buffer of the Native Engine local service Native layer may be called by various types of adapters (Native & Managed adapter). The Native layer of the Unity Engine (Unity Engine) local service may include a tag c++ function (Marker c++ Functions), a tag name buffer (NameBuffer) for buffering index data (LightProfiler Data) of performance hot spots, a function time-consuming buffer (TimeBuffer), and other buffers (Other ProfilerDatas), etc. The types of adapters (Native & Managed adapters) may include types of adapters such as begin management (begin management), begin rendering (begin frame), other functions (Other Profiler Functions), get names of tag performance indicators (GetRawName), get time consuming for tag performance indicators (GetRawTime), and other get data (getxxprofiledatas). Game management (name: management) may include marking C# Functions (Marker C# Functions), managing a marking function queue (ManagedMark queue) that may be executed by a main thread (MainThread), writing data to a file (Write Data To File) that may be executed by a write thread (WriteThread), writing data to a file (Write Data To File), and the like. The Write cycle (Write frame loop) may include: the management tag function queue (Get ManagedMarkerQueue From Game) is first obtained from the game, and the index data is obtained from the engine (Get ProfilerData From Engine), then the current frame data is serialized (Serilize Current FrameData), and the serialized data is written to a file (Write SerilizeData To File) or the like.
Specifically, the process of LightProfiler data acquisition may include: the terminal performs time-consuming pile inserting configuration (Marker) of various performance hot spots on the Game side, queues various performance hot spot functions through a name marking queue (Marker queue), submits index data of various performance hot spots to write files continuously, various operations on the Game side can be realized by calling a bottom function through various performance interface adapter (adapter) interface functions, such as starting statistics of time consumption by calling a Begin function, starting acquisition by calling a Begin frame, calling a name to acquire a marking performance index, and time consumption by calling a GetRawTime. For the Unity engine, the local service layer (i.e. Native layer) is also marked by the c++ function, such as rendering time of graphics, and the bottom layer of the c++ function can be implemented based on various c++ functions corresponding to the interface functions of Adapter, such as saving the names of various marking performance hot spots through a name buffer, and saving the function time of various marking performance through a time buffer. In addition, all performance hot spot function time consuming can complete the final data Write through Write frame loop: and acquiring a complete marker function queue (marker queue) from the Game side, acquiring the ProfilerData of each marker performance hot spot from the Engine side, carrying out serialization operation on the current frame data, and finally writing the serialization data into a file to finish the storage of the index data of the performance hot spot.
S205, the terminal generates a performance test result of the game application to be tested according to the index data.
After obtaining the index data corresponding to the performance index to be tested, the terminal can perform performance analysis on the game application to be tested based on the index data corresponding to the performance index to be tested, so as to obtain a performance analysis result, and generate a performance test result of the game application to be tested based on the performance analysis result and the index data.
For example, as shown in fig. 6, the terminal may select a performance index to be tested and display a performance test result in an index data display area of the display interface. The performance test result may include monitoring various frame time consuming hot spots by a lightweight performance analyzer (LightProfiler), such as frame time consuming monitoring, including frame rendering time (frame time) and graphics rendering thread time (gfxthreadtime), etc.; monitoring memory hotspots of a memory (Mono) occupied by the script code during operation, such as Mono memory usage (MonoUsed) and Mone allocated total memory (MonoReserved); and monitoring draw call (draw calls) hotspots, such as batch calls (batches), draw calls (draw calls), and rendering channel numbers (setpasscalls), etc.; and monitoring art asset hotspots such as triangles (triangules), vertices (vertetics), textures (texture), and texture renderings (render) and the like.
After the performance test result is obtained, the terminal can perform serialization processing on the performance test result, and then generate a performance test file based on the serialized performance test result. At this time, the performance test file may be compressed to obtain a compressed performance test file, and the compressed performance test file is uploaded to the server, where the server stores the compressed performance test file.
S206, the terminal screens out target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test result.
After the performance test result of the game application to be tested is obtained, since the performance test result may be a performance test result obtained by performing performance test through a lightweight performance analyzer (LightProfiler), in order to further analyze the depth cause affecting the performance, the game application to be tested may be subjected to depth performance analysis through a depth performance analyzer (deep profiler), and the terminal may screen out target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test result, for example, may screen out target performance indexes having anomalies or having long running time.
S207, the terminal sets a target test identifier in the game operation resource file according to the target performance index to obtain a target game operation resource file.
After determining the target performance index, the terminal can determine the configuration information of the game running resource file, which needs to be configured with the target test identifier, according to the target performance index, and perform the target test identifier configuration (i.e. instrumentation configuration) on the game running resource file based on the configuration information to obtain the target game running resource file.
For example, as shown in fig. 7, the terminal may perform deep profiler instrumentation configuration on the game running resource file through a deep profiler, which is different from the instrumentation of the LightProfiler, and the deep profiler may perform automatic function time-consuming record on all functions in the compiling stage, and the deep profiler may perform various function sampling time-consuming collection (i.e., deep profiler data collection), collect index data of the performance hotspot function and perform file writing (i.e., performance summary file writing), then compress the file, and then perform final background uploading, thereby completing the overall data storage.
In the process of deep profiler instrumentation, the terminal may start to perform a timing operation mark on the current function by using a start timing function (enter_mono_sample), end timing function (leave_mono_sample) indicates to end the timing operation mark on the current function, and in the process of construction, the instrumentation process is performed on all functions of the game only by starting a deep parser (enable deep profiler), in order to reduce the influence on the low consumption function, the instruction number of the performance index function (i.e. the hot spot function) may be obtained by using a method instruction number function (method_entities. Count), and only the performance index function whose instruction number is greater than a preset number threshold (e.g. 10) is acquired in a time-consuming manner, thereby reducing the influence on the low consumption function and realizing full-scale automation of the hot spot function based on deep profiler.
S208, the terminal compiles the target game operation resource file to obtain a compiled game operation resource file.
S209, loading the compiled game running resource file by the terminal, and acquiring target index data corresponding to the target performance index based on the target test identifier.
For example, as shown in fig. 8, when the deep profiler saves hot spot function call information (which may include time consuming function running), in order to save overhead, only the function identification (i.e., function ID) of each hot spot function may be recorded, thereby avoiding the mark-up (Marshal) overhead of the runtime symbol. For example, for function a, function B, function C, function D and function E, in the instrumentation logic, the memory addresses of function IDs 0x10001 to 0x10005 are automatically recorded, and when 0x00001 is represented as a function exit flag, the call sequence of function a to function E is sequentially stored in the memory addresses of 0x10001, 0x10002, 0x10004, 0x00001, 0x10003, 0x10005, 0x00001 and 0x 00001.
In the process of collecting data by the deep profiler, the C# logic may have a plurality of threads, and the instrumentation code cannot be distinguished, so that overhead of obtaining the thread ID can be optimized by using an inline assembly instruction in ID identification, a current thread ID is obtained by an instruction asm volt ("src p15, 0,% 0, C13, C0, 3": "=r" (tid)), and target index data is stored in a storage address matched with the thread ID, thereby realizing data distinguishing storage under multiple threads.
S210, the terminal generates a target performance test result of the game application to be tested according to the target index data.
After the target index data is obtained, the terminal can obtain a target performance analysis result after performing performance analysis based on the target index data, and generate a target performance test result of the game application to be tested based on the target performance analysis result and the target index data.
For example, as shown in fig. 9, in the target performance test result, the upper graph shows the time spent by a single frame of all frames of the recorded game running, and it can be seen that the total time spent by the currently selected frame is 66ms, and the upper graph shows the relevant information such as the total amount of information of the whole hot-spot function, the complete call stack of the current hot-spot function, the duty ratio of each function in the whole time spent by one frame, and the like.
S211, the terminal performs serialization processing on the target performance test result, and generates a target performance test file based on the serialized target performance test result.
S212, the terminal compresses the target performance test file to obtain a compressed target performance test file.
S213, uploading the compressed target performance test file to a server.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of an embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of the performance testing method, which is not repeated herein.
According to the embodiment of the application, the automatic performance test can be completed only by the game running resource file, the development version is not required to be constructed for data collection, collection and output of various log files are not required, the test time is saved, the influence on the performance of a low-end machine is reduced, the test efficiency and convenience are improved, the targeted self-defined collection of index data can be realized through the test identification configuration, the index data can be archived, the offline running is supported, the complete collection of the index data of the performance index to be tested is greatly facilitated, and the reliability and the accuracy of the performance test are improved.
In order to facilitate better implementation of the performance testing method provided by the embodiment of the application, the embodiment of the application also provides a device based on the performance testing method. Where the meaning of a noun is the same as in the performance test method described above, specific implementation details may be referred to in the description of the method embodiments.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a performance testing apparatus according to an embodiment of the present application, where the performance testing apparatus 300 may include an obtaining unit 301, a determining unit 302, a configuring unit 303, a first collecting unit 304, a first generating unit 305, and so on.
The acquiring unit 301 is configured to acquire a game running resource file of a game application to be tested;
a determining unit 302, configured to determine a performance index to be tested of the game application to be tested according to game scene information of the game application to be tested;
the configuration unit 303 is configured to perform test identifier configuration on the game running resource file according to the performance index to be tested, so as to obtain a configured game running resource file;
the first collection unit 304 is configured to run a game based on the configured game running resource file, and collect index data corresponding to a performance index to be tested of the game application to be tested based on the test identifier;
the first generating unit 305 is configured to generate a performance test result of the game application to be tested according to the index data.
In some embodiments, the performance testing apparatus 300 further comprises:
the screening unit is used for screening target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test result;
the setting unit is used for setting a target test identifier in the game running resource file according to the target performance index to obtain a target game running resource file;
the compiling unit is used for compiling the target game running resource file to obtain a compiled game running resource file;
The second acquisition unit is used for loading the compiled game running resource file and acquiring target index data corresponding to the target performance index based on the target test identifier;
and the second generation unit is used for generating a target performance test result of the game application to be tested according to the target index data.
In some embodiments, the screening unit is specifically for:
according to the performance test result, screening out the index data with the operation time consumption greater than the preset time length threshold value from the index data of the performance index to be tested, and taking the performance index to be tested corresponding to the screened index data as the target performance index.
In some embodiments, the second acquisition unit is specifically configured to:
acquiring the instruction number of a performance index function provided with a target test identifier in a game running resource file;
screening performance indexes corresponding to performance index functions with instruction numbers larger than a preset number threshold from target performance indexes to obtain screened performance indexes;
and acquiring target index data corresponding to the screened performance indexes based on the target test identification.
In some embodiments, the target performance index includes a plurality of second acquisition units specifically configured to: invoking a plurality of threads to run a performance index function provided with target test marks, and respectively collecting target index data corresponding to each target performance index;
The performance testing apparatus 300 further includes:
and the storage unit is used for determining the function identifier of the performance index function operated by each thread and storing the target index data of the target performance index matched with the function identifier into the storage address matched with the thread identifier of each thread.
In some embodiments, the test identifier includes a start identifier and a termination identifier, and the configuration unit 303 is specifically configured to:
determining the code position matched with the performance index to be tested in the game running resource file;
and configuring a start identifier and a termination identifier in the game running resource file according to the code position to obtain the configured game running resource file.
In some embodiments, the first acquisition unit 304 is specifically configured to:
calling a timing function through the performance interface adapter, starting timing at the position of the start mark, and ending timing at the position of the stop mark to obtain the running time of the performance index to be tested;
and generating index data corresponding to the performance index to be tested of the game application to be tested according to the running time.
In some embodiments, the performance testing apparatus 300 further comprises:
the processing unit is used for carrying out serialization processing on the performance test results and generating a performance test file based on the serialized performance test results;
The compression unit is used for compressing the performance test file to obtain a compressed performance test file;
and the uploading unit is used for uploading the compressed performance test file to the server.
In the embodiment of the present application, the acquiring unit 301 may acquire a game running resource file of the game application to be tested, and the determining unit 302 determines, according to game scene information of the game application to be tested, a performance index to be tested of the game application to be tested; then, the configuration unit 303 can perform test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file; the first collection unit 304 may collect, based on the configured game running resource file, index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier, and at this time, the first generation unit 305 may generate a performance test result of the game application to be tested according to the index data. According to the scheme, the automatic performance test can be completed only by the game running resource file, a development version does not need to be constructed, collection and output of various log files do not need to be carried out, the test time is saved, the influence on the performance of a low-end machine is reduced, the test efficiency and convenience are improved, and the customized collection of targeted index data can be realized through test identification configuration, so that a performance test result is generated, and the reliability and accuracy of the performance test are improved.
The embodiment of the present application further provides a computer device, which may be a terminal or the like, as shown in fig. 11, which shows a schematic structural diagram of the computer device according to the embodiment of the present application, specifically:
the computer device may include one or more processors 401 of a processing core, memory 402 of one or more computer readable storage media, a power supply 403, and an input unit 404, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 11 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of charge, discharge, and power consumption management may be performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 404, which input unit 404 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the computer device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions as follows:
acquiring a game running resource file of a game application to be tested; determining performance indexes to be tested of the game application to be tested according to game scene information of the game application to be tested; performing test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file; running the game based on the configured game running resource file, and collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier; and generating a performance test result of the game application to be tested according to the index data.
In some implementations, the processor 401 is further configured to perform: screening target performance indexes meeting the conditions from the performance indexes to be tested according to the performance test results; setting a target test identifier in the game operation resource file according to the target performance index to obtain a target game operation resource file; compiling the target game operation resource file to obtain a compiled game operation resource file; loading a compiled game running resource file, and collecting target index data corresponding to a target performance index based on a target test identifier; and generating a target performance test result of the game application to be tested according to the target index data.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of an embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of the performance testing method, which is not repeated herein.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations of the above embodiments.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by computer instructions, or by control of associated hardware, that may be stored on a computer readable storage medium (i.e., a storage medium) and loaded and executed by a processor. To this end, embodiments of the present application provide a storage medium having stored therein a computer program that may include computer instructions that can be loaded by a processor to perform any of the performance testing methods provided by embodiments of the present application.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the storage medium may perform the steps in any performance testing method provided in the embodiments of the present application, the beneficial effects that any performance testing method provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
The foregoing describes in detail a performance testing method, apparatus, computer device and storage medium provided in the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (11)

1. A performance testing method, comprising:
acquiring a game running resource file of a game application to be tested;
determining performance indexes to be tested of the game application to be tested according to the game scene information of the game application to be tested;
performing test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file;
running a game based on the configured game running resource file, and collecting index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier;
And generating a performance test result of the game application to be tested according to the index data.
2. The performance testing method according to claim 1, wherein after the performance test result of the game application to be tested is generated according to the index data, the performance testing method further comprises:
screening target performance indexes meeting conditions from the performance indexes to be tested according to the performance test results;
setting a target test identifier in the game operation resource file according to the target performance index to obtain a target game operation resource file;
compiling the target game operation resource file to obtain a compiled game operation resource file;
loading the compiled game running resource file, and collecting target index data corresponding to the target performance index based on the target test identifier;
and generating a target performance test result of the game application to be tested according to the target index data.
3. The performance testing method according to claim 2, wherein the step of screening target performance indexes satisfying a condition from the performance indexes to be tested according to the performance test result includes:
And screening out index data with the operation time consumption greater than a preset time length threshold from the index data of the performance indexes to be tested according to the performance test result, and taking the performance indexes to be tested corresponding to the screened out index data as target performance indexes.
4. The performance testing method according to claim 2, wherein the collecting, based on the target test identifier, target index data corresponding to the target performance index includes:
acquiring the instruction number of the performance index function provided with the target test identifier in the game running resource file;
screening performance indexes corresponding to performance index functions with instruction numbers larger than a preset quantity threshold from the target performance indexes to obtain screened performance indexes;
and acquiring target index data corresponding to the screened performance index based on the target test identifier.
5. The performance testing method according to claim 2, wherein the target performance indexes include a plurality of target index data corresponding to the target performance indexes is collected based on the target test identifier, and the method includes:
invoking a plurality of threads to run a performance index function provided with the target test identifier, and respectively collecting target index data corresponding to each target performance index;
After the target performance index data corresponding to the target performance index is collected based on the target test identifier, the performance test method further comprises:
and determining the function identification of the performance index function operated by each thread, and storing the target index data of the target performance index matched with the function identification to a storage address matched with the thread identification of each thread.
6. The performance test method according to claim 1, wherein the test identifier includes a start identifier and a stop identifier, the configuring the test identifier for the game running resource file according to the performance index to be tested, to obtain a configured game running resource file, includes:
determining the code position matched with the performance index to be tested in the game running resource file;
and configuring a start identifier and a termination identifier in the game running resource file according to the code position to obtain the configured game running resource file.
7. The performance testing method according to claim 6, wherein the collecting, based on the test identifier, index data corresponding to a performance index to be tested of the game application to be tested includes:
Calling a timing function through a performance interface adapter, starting timing at the position of the start mark, and ending timing at the position of the stop mark to obtain the running time of the performance index to be tested;
and generating index data corresponding to the performance index to be tested of the game application to be tested according to the running time.
8. The performance testing method according to any one of claims 1 to 7, characterized in that after the performance testing result of the game application to be tested is generated from the index data, the performance testing method further comprises:
carrying out serialization processing on the performance test result, and generating a performance test file based on the serialized performance test result;
compressing the performance test file to obtain a compressed performance test file;
and uploading the compressed performance test file to a server.
9. A performance testing apparatus, comprising:
the acquisition unit is used for acquiring a game running resource file of the game application to be tested;
the determining unit is used for determining performance indexes to be tested of the game application to be tested according to the game scene information of the game application to be tested;
The configuration unit is used for carrying out test identification configuration on the game running resource file according to the performance index to be tested to obtain a configured game running resource file;
the first acquisition unit is used for running the game based on the configured game running resource file and acquiring index data corresponding to the performance index to be tested of the game application to be tested based on the test identifier;
and the first generation unit is used for generating a performance test result of the game application to be tested according to the index data.
10. A computer device comprising a processor and a memory, the memory having stored therein a computer program, the processor executing the performance test method of any of claims 1 to 8 when calling the computer program in the memory.
11. A storage medium storing a computer program to be loaded by a processor to perform the performance testing method of any one of claims 1 to 8.
CN202311492189.6A 2023-11-10 2023-11-10 Performance test method, device, computer equipment and storage medium Active CN117271371B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311492189.6A CN117271371B (en) 2023-11-10 2023-11-10 Performance test method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311492189.6A CN117271371B (en) 2023-11-10 2023-11-10 Performance test method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117271371A true CN117271371A (en) 2023-12-22
CN117271371B CN117271371B (en) 2024-03-12

Family

ID=89208372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311492189.6A Active CN117271371B (en) 2023-11-10 2023-11-10 Performance test method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117271371B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106267822A (en) * 2016-08-18 2017-01-04 网易(杭州)网络有限公司 The method of testing of game performance and device
CN106802856A (en) * 2015-11-26 2017-06-06 腾讯科技(深圳)有限公司 The performance test methods of game application, server and game application client
CN107368410A (en) * 2017-06-14 2017-11-21 腾讯科技(深圳)有限公司 The performance test methods and device of game engine, storage medium and electronic installation
CN110262976A (en) * 2019-06-21 2019-09-20 深圳市腾讯网域计算机网络有限公司 Analytic method, device, equipment and the storage medium of game resource file
US20200327047A1 (en) * 2019-04-12 2020-10-15 GameDriver, Inc. Video game testing and automation framework
CN113656276A (en) * 2021-08-26 2021-11-16 深圳市腾讯网络信息技术有限公司 Equipment performance detection method and related device for game program
CN115512025A (en) * 2022-09-27 2022-12-23 北京字跳网络技术有限公司 Method and device for detecting model rendering performance, electronic device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106802856A (en) * 2015-11-26 2017-06-06 腾讯科技(深圳)有限公司 The performance test methods of game application, server and game application client
CN106267822A (en) * 2016-08-18 2017-01-04 网易(杭州)网络有限公司 The method of testing of game performance and device
CN107368410A (en) * 2017-06-14 2017-11-21 腾讯科技(深圳)有限公司 The performance test methods and device of game engine, storage medium and electronic installation
US20200327047A1 (en) * 2019-04-12 2020-10-15 GameDriver, Inc. Video game testing and automation framework
CN110262976A (en) * 2019-06-21 2019-09-20 深圳市腾讯网域计算机网络有限公司 Analytic method, device, equipment and the storage medium of game resource file
CN113656276A (en) * 2021-08-26 2021-11-16 深圳市腾讯网络信息技术有限公司 Equipment performance detection method and related device for game program
CN115512025A (en) * 2022-09-27 2022-12-23 北京字跳网络技术有限公司 Method and device for detecting model rendering performance, electronic device and storage medium

Also Published As

Publication number Publication date
CN117271371B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
CN112130837A (en) Code processing method and device and storage medium
CN111400186A (en) Performance test method and system
CN112115042A (en) Software testing method and system based on acquisition and playback
CN109672902A (en) A kind of video takes out frame method, device, electronic equipment and storage medium
CN110716848A (en) Data collection method and device, electronic equipment and storage medium
CN111954072B (en) Multimedia playing method, device, multimedia player and medium
CN114138674A (en) Automatic testing method and device and computer equipment
CN111298434B (en) Service processing method, device, equipment and storage medium
CN108287791A (en) The detection method and storage medium of the texture resource configuration of virtual reality software
CN107526623A (en) A kind of data processing method and device
CN117271371B (en) Performance test method, device, computer equipment and storage medium
CN104506661A (en) Automatic production method for remotely-configured usage scenario-based power consumption
CN114510394A (en) Server memory analysis method and device and computer readable storage medium
CN111290960B (en) Fluency detection method and device for application program, terminal and storage medium
CN107291619B (en) Memory occupation analysis method and device
CN114237916B (en) Data processing method and related equipment
CN112052158B (en) Art resource operation information acquisition method and device
CN110232026A (en) AssetBundle resource detection method and system
CN114880604A (en) Data processing method, data sending method, data acquiring method, data processing device, data sending device and data acquiring device
CN114706581A (en) Image analysis method, image analysis device, computer equipment and storage medium
CN115002011A (en) Flow bidirectional test method and device, electronic equipment and storage medium
CN113806231A (en) Code coverage rate analysis method, device, equipment and medium
CN110865937A (en) Application testing method and device and storage medium
CN108415825A (en) electronic device, test method and storage medium
CN111143182A (en) Method and device for analyzing process behaviors 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
GR01 Patent grant
GR01 Patent grant