program profiler configuration

本文介绍如何通过设置VC++6.0中的代码分析选项来提高程序性能。包括启用C/C++代码分析、使用性能向导及比较性能报告等步骤。通过对这些工具和技术的应用,可以有效定位并解决性能瓶颈。

image

1、设置“生成时启用C/C++代码分析”为“是”,如果不设置此项,程序速度将出乎你的意料……

image

2、点击“分析”->“启动性能向导”

image

3、在“性能资源管理器”中右键新建的性能报告节点,右键“启动并启用分析功能”。

image

虽然此处有“启用分析功能”,但如果在配置里面没有进行设置,第一次的测试报告结果将是不准确的。

4、选择两个性能报告(ctrl+鼠标),右键“比较性能报告”。

image

用性能报告将有助于提高程序的性能,并且快速定位问题所在,剩下的结果就是你自己需要多观察,分析性能报告所反映的问题了。

更多

VC++ 6.0详见这里>> http://neural.cs.nthu.edu.tw/jang/mir/technicalDocument/vc6_profile/index.htm

第三方工具>> http://www.semdesigns.com/Products/Profilers/CppProfiler.html

apply plugin: 'com.android.library' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) } android { ndkPath "C:/Program Files/Unity/Hub/Editor/2022.3.26f1c1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" compileSdkVersion 35 buildToolsVersion '32.0.0' compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } defaultConfig { minSdkVersion 22 targetSdkVersion 35 ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' } versionCode 1 versionName '1.0' consumerProguardFiles 'proguard-unity.txt' } lintOptions { abortOnError false } aaptOptions { noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ') ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" } packagingOptions { doNotStrip '*/armeabi-v7a/*.so' doNotStrip '*/arm64-v8a/*.so' } } def getSdkDir() { Properties local = new Properties() local.load(new FileInputStream("${rootDir}/local.properties")) return local.getProperty('sdk.dir') } def BuildIl2Cpp(String workingDir, String configuration, String architecture, String abi, String[] staticLibraries) { def commandLineArgs = [] commandLineArgs.add("--compile-cpp") commandLineArgs.add("--platform=Android") commandLineArgs.add("--architecture=" + architecture) commandLineArgs.add("--outputpath=" + workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.so") commandLineArgs.add("--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi) commandLineArgs.add("--incremental-g-c-time-slice=3") commandLineArgs.add("--configuration=" + configuration) commandLineArgs.add("--dotnetprofile=unityaot-linux") commandLineArgs.add("--profiler-report") commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_conv.traceevents") commandLineArgs.add("--print-command-line") commandLineArgs.add("--data-folder=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput/data") commandLineArgs.add("--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput") commandLineArgs.add("--cachedirectory=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_cache") commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory) staticLibraries.eachWithIndex {fileName, i-> commandLineArgs.add("--additional-libraries=" + workingDir + "/src/main/jniStaticLibs/" + abi + "/" + fileName) } def executableExtension = "" if (org.gradle.internal.os.OperatingSystem.current().isWindows()) { executableExtension = ".exe" commandLineArgs = commandLineArgs*.replace('\"', '\\\"') } exec { executable workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp" + executableExtension args commandLineArgs environment "ANDROID_SDK_ROOT", getSdkDir() } delete workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.sym.so" ant.move(file: workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so") } android { task BuildIl2CppTask { doLast { BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), 'Release', 'armv7', 'armeabi-v7a', [ ] as String[]); BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), 'Release', 'arm64', 'arm64-v8a', [ ] as String[]); } } afterEvaluate { if (project(':unityLibrary').tasks.findByName('mergeDebugJniLibFolders')) project(':unityLibrary').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask if (project(':unityLibrary').tasks.findByName('mergeReleaseJniLibFolders')) project(':unityLibrary').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask } sourceSets { main { jni.srcDirs = ["src/main/Il2CppOutputProject"] } } }
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值