বেঞ্চমার্ক
সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | প্রার্থী মুক্তি | বিটা রিলিজ | আলফা রিলিজ |
---|---|---|---|---|
9 এপ্রিল, 2025 | 1.3.4 | - | - | 1.4.0-আলফা11 |
নির্ভরতা ঘোষণা করা
বেঞ্চমার্কের উপর নির্ভরতা যোগ করতে, আপনাকে অবশ্যই আপনার প্রকল্পে Google Maven সংগ্রহস্থল যোগ করতে হবে। আরও তথ্যের জন্য Google এর Maven সংগ্রহস্থল পড়ুন।
ম্যাক্রোবেঞ্চমার্ক
আপনার প্রকল্পে ম্যাক্রোবেঞ্চমার্ক ব্যবহার করতে, আপনার macrobenchmark মডিউলের জন্য আপনার build.gradle
ফাইলে নিম্নলিখিত নির্ভরতা যোগ করুন:
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-macro-junit4:1.3.4" }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-macro-junit4:1.3.4") }
মাইক্রোবেঞ্চমার্ক
আপনার প্রোজেক্টে মাইক্রোবেঞ্চমার্ক ব্যবহার করতে, আপনার মাইক্রোবেঞ্চমার্ক মডিউলের জন্য আপনার build.gradle
ফাইলে নিম্নলিখিত নির্ভরতা যোগ করুন:
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-junit4:1.3.4" } android { ... defaultConfig { ... testInstrumentationRunner "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-junit4:1.3.4") } android { ... defaultConfig { ... testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
মাইক্রোবেঞ্চমার্ক লাইব্রেরি আপনার মাইক্রোবেঞ্চমার্ক মডিউলের সাথে ব্যবহার করার জন্য একটি গ্রেডল প্লাগইনও প্রদান করে। এই প্লাগইনটি মডিউলের জন্য বিল্ড কনফিগারেশন ডিফল্ট সেট করে, হোস্টে বেঞ্চমার্ক আউটপুট কপি সেট আপ করে এবং ./gradlew lockClocks
টাস্ক প্রদান করে।
প্লাগইন ব্যবহার করতে, আপনার শীর্ষ-স্তরের build.gradle
ফাইলে `plugins` ব্লকে নিম্নলিখিত লাইনটি অন্তর্ভুক্ত করুন:
গ্রোভি
plugins { id 'androidx.benchmark' version '1.3.4' apply false }
কোটলিন
plugins { id("androidx.benchmark") version "1.3.4" apply false }
তারপর প্লাগইনটি আপনার বেঞ্চমার্ক মডিউলের build.gradle
ফাইলে প্রয়োগ করুন
গ্রোভি
plugins { id 'androidx.benchmark' }
কোটলিন
plugins { id("androidx.benchmark") }
প্রতিক্রিয়া
আপনার প্রতিক্রিয়া জেটপ্যাককে আরও ভাল করতে সাহায্য করে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন বা এই লাইব্রেরির উন্নতির জন্য ধারনা পান তাহলে আমাদের জানান। আপনি একটি নতুন তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি দেখুন৷ আপনি তারকা বোতামে ক্লিক করে একটি বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ 1.4
সংস্করণ 1.4.0-alpha11
9 এপ্রিল, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha11
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha11-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
-
TraceProcessor
আর্গুমেন্ট টাইমআউট পরিবর্তন করা হয়েছে: জাভা কলার ব্যবহারযোগ্যতার জন্য টাইমআউটের সময়কাল। ( I9fbb5 ) -
TraceProcessor
কনস্ট্রাক্টরকে অভ্যন্তরীণ হিসাবে চিহ্নিত করুন। কলারদেরTraceProcessor.startServer
বাTraceProcessor.runServer
ব্যবহার করা উচিত। ( IA8c5b )
বাগ ফিক্স
-
MacrobenchmarkScope.killProcess
দিয়ে অ্যাপ্লিকেশনটি হত্যা করার সময়, নীরব ব্যর্থতা এবং টাইমআউট ত্রুটি রোধ করতে kill কমান্ডের ফলাফল যাচাই করুন। ( I84555 )
নির্ভরতা আপডেট
- এই লাইব্রেরিটি এখন কোটলিন 2.0 ভাষা স্তরকে লক্ষ্য করে এবং এর জন্য KGP 2.0.0 বা নতুন প্রয়োজন৷ ( আইডিবি৬বি৫ )
সংস্করণ 1.4.0-আলফা10
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha10
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha10-এ এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
-
TraceProcessor
সার্ভার লোড এবং অনুসন্ধানের জন্য ডিফল্ট টাইমআউট 120 সেকেন্ডে বৃদ্ধি করা হয়েছে (আগে 60/30 থেকে), এবং উভয়কেই একটি টাইমআউট প্যারামিটার দিয়ে কনফিগারযোগ্য করে তুলেছে। ( ifec87 )
বাগ ফিক্স
-
profileinstaller
ছাড়া একটি অ্যাপের প্রোফাইল বেঞ্চমার্কিং বা ক্যাপচার করার সময় ঘটতে পারে এমন কয়েকটি সমস্যা সমাধান করা হয়েছে এবং এতেBroadcastReciever
অন্তর্ভুক্ত রয়েছে। এটি শুধুমাত্র রুটেড ডিভাইসে চালানোকে প্রভাবিত করে। ( Ied308 )
সংস্করণ 1.4.0-alpha09
12 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha09
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha09-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- কাস্টম লাইফসাইকেলের সাথে সহজে ব্যবহারের জন্য ক্লোজযোগ্য হ্যান্ডেল সহ
TraceProcessor
এবং সেশন API যোগ করা হয়েছে। এটি সহজ Coroutine এবং Java API ব্যবহার সক্ষম করার দিকে একটি পদক্ষেপ।TraceProcessor.runServer {}
-এ এক্সটেনশন ফাংশনগুলি এখন পরীক্ষামূলক হিসাবে চিহ্নিত করা হয়েছে, কারণ সেগুলি সরানোর সম্ভাবনা রয়েছে এবং ভবিষ্যতে অ-পরীক্ষামূলক করা হবে৷ ( I358b4 )
বাগ ফিক্স
-
pgrep
টয়বক্সে পরিবর্তনের কারণে ফিক্সড বেঞ্চমার্ক এবং বেসলাইন প্রোফাইল ক্যাপচার API 36 এর সাথে কাজ করছে না যা এখন সম্পূর্ণ কমান্ড লাইন প্রিন্ট করতে-a
প্রয়োজন। ( আইডিসি৯৯১ ) - নতুন API স্তরে ট্রেসে ডেটা ক্ষতির ঝুঁকি কমাতে ডিফল্ট ট্রেসিং কনফিগারেশন ফিল্টার করুন। ( I54e8a )
- পরীক্ষামূলক
androidx.benchmark.killExistingPerfettoRecordings
ইন্সট্রুমেন্টেশন আর্গুমেন্ট যোগ করা হয়েছে, যা আগে থেকে বিদ্যমান পারফেটো ট্রেস ক্যাপচার চালিয়ে যাওয়ার অনুমতি দিতেfalse
সেট করা যেতে পারে। ডিফল্টরূপে ডিভাইসে বিদ্যমান পারফেটো ট্রেস ক্যাপচারগুলি হস্তক্ষেপ রোধ করতে মেরে ফেলা হয়। ( I02a3c ) - JSON ক্ষেত্র
context.osCodenameAbbreviated
এখন API 35 এবং তার উপরে প্রকাশিত OS সংস্করণগুলির জন্যREL
হবে, কারণ অ-সংখ্যাসূচক কোড নামগুলি আর অন্তর্নিহিত প্ল্যাটফর্ম দ্বারা সমর্থিত নয়৷ ( Ib17fd ) -
FrameTimingMetric
ক্র্যাশ ফিক্স করে যখন পুনরায় সিঙ্ক করা ফ্রেমগুলি ঘটে। ( I7c6f4 , b/394610806 ) -
FrameTimingQuery
এর মূল থ্রেডের স্ট্যাক ফ্রেমের উপরেChoreographer#doFrame
আর ধরে নেওয়া উচিত নয়। ( Iee0e0 , b/340206285 )
সংস্করণ 1.4.0-alpha08
ফেব্রুয়ারি 12, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha08
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha08-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
-
TraceProcessor.runSession()
এক্সটেনশন APIগুলিকে পরীক্ষামূলক হতে সরানো হয়েছে, কারণ তারা সম্ভবত Android এ কংক্রিট কনস্ট্রাক্টর হতে চলেছে৷ ( Ib0528 , b/393640753 ) - স্টার্টআপ ইনসাইটের বেশিরভাগ বাস্তবায়ন এখন সর্বজনীন/পরীক্ষামূলক, এবং
TraceProcessor
আর্টিফ্যাক্টে যানStartupInsights
দেখুন। ( I0aa00 ) -
BenchmarkRule.runWithTimingDisabled {}
এর পক্ষেBenchmarkRule.runWithMeasurementDisabled {}
বর্জন করুন, যা আচরণটিকে আরও স্পষ্টভাবে বর্ণনা করে - সমস্ত মেট্রিক্স পজ করা হয়েছে৷ অতিরিক্তভাবে,MicrobenchmarkScope
সুপারক্লাসটি প্রকাশ করুন যেহেতু অ্যাক্সেস ওপেন করার জন্যrunWithMeasurementDisabled
ফাংশনটি পুনরায় ঘোষণা করা সম্ভব নয়, যেহেতু এটি ইনলাইন। ( I9e23b , b/389149423 , b/149979716 ) - বেঞ্চমার্ক লাইব্রেরি Kotlin 2.0 এ সরানো হয়েছে। ( I9d1e0 )
-
androidx.benchmark.startupProfiles.enable
ইনস্ট্রুমেন্টেশন আর্গুমেন্ট সরানো হয়েছে। এটি আর উপযোগী নয়, কারণ এটিBaselineProfileRule.collect()
এincludeInStartupProfile
arg দ্বারা নিয়ন্ত্রিত হতে পারে। ( I39eb4 )
বাগ ফিক্স
- প্রফাইলিংয়ের সময় বলা মাইক্রোবেঞ্চমার্ক অভ্যন্তরীণ ফাংশনগুলির পরিমাণ হ্রাস করা হয়েছে যেমন পদ্ধতির চিহ্নগুলিকে আরও স্পষ্ট করতে ( Ifaed8 )
- ক্র্যাশের জন্য অনুমানমূলক সমাধান: '[
ProcessPid(processName=perfetto, pid=...)
] থামাতে ব্যর্থ হয়েছে'। এখন বেঞ্চমার্ক ক্র্যাশ হওয়ার পরিবর্তে একটি বার্তা লগ করবে যখন একটি ব্যাকগ্রাউন্ড পারফেটো প্রক্রিয়া বেঞ্চমার্ক চালানোর আগে বন্ধ করা যাবে না। ( I37d3e , b/323601788 ) - 'প্রত্যাশিত
pm dump-profiles
stdout' লেবেল দিয়েIllegalStateExceptions
ঠিক করুন যা অত্যধিক কঠোর আউটপুট ফরম্যাট চেকের কারণে হয়েছিল। ( I358dc )
সংস্করণ 1.4.0-alpha07
জানুয়ারী 29, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha07
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha07-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
-
BaselineProfileRule
এখন একটিcollectWithResults(...)
API প্রবর্তন করে যা গণনা করা প্রোফাইলগুলির পাথগুলির একটি তালিকা অন্তর্ভুক্ত করে। ( I056f8 ) -
androidx.benchmark.measureRepeatedOnMainThread.throwOnDeadline
ইন্সট্রুমেন্টেশন আর্গুমেন্ট যোগ করা হয়েছে, যা স্থানীয় পরীক্ষার জন্যmeasureRepeatedOnMainThread
থ্রেডের সময়সীমার আচরণকে নিষ্ক্রিয় করতে মিথ্যাতে সেট করা যেতে পারে। অন্যথায় সুপারিশ করা হয় না, কারণ এটি পরীক্ষার সময় ANR-এর সম্ভাবনা বাড়ায়। ( Idbeec , b/353226476 )
এপিআই পরিবর্তন
-
MicrobenchmarkConfig
কনস্ট্রাক্টরে@JvmOverloads
যোগ করা হয়েছে। ( I13fd3 ) - রিফ্যাক্টর করা
BenchmarkRule
কোরোটিনের উপরে তৈরি করা হবে এবং আরও ভালyield()
আচরণ সমর্থন করবে। এই রিফ্যাক্টরটি বেশ কয়েকটি পরীক্ষামূলকBenchmarkState
এপিআই সরিয়ে দিয়েছে, কিন্তু প্রয়োজন অনুসারে প্রতিস্থাপনের দ্বারা অনুসরণ করা হবে। উপরন্তু, আচরণ স্পষ্ট করতেrunWithMeasurementDisabled
যোগ করা হয়েছে (সমস্ত পরিমাপ বিরাম দেওয়া হয়েছে)। ভবিষ্যতে,runWithTimingDisabled
বাতিল করা হবে। ( I19837 , b/389149423 , b/311242861 ) - একটি নতুন
androidx.benchmark:benchmark-traceprocessor
artifact-এPerfettoTraceProcessor
কেTraceProcessor
এ সরান এবং এর অধিকাংশ API-কে অ-পরীক্ষামূলক করুন৷ যেকোনো কাস্টমTraceMetric
বা ট্রেস থেকে পড়ার যেকোনো কিছুর জন্য নতুনTraceProcessor
আমদানিতে আপডেট করতে হবে। নতুনTraceProcessor
এপিআই পুরানোটির মতোই কাজ করে, তবে এটি একটি স্বতন্ত্র ইন্টারফেস লাইব্রেরি (রুম থেকেandroidx.sqlite
স্তরের সাথে কিছুটা সাদৃশ্যপূর্ণ) ম্যাক্রোবেঞ্চমার্কে তৈরি একটি অ্যান্ড্রয়েড-নির্দিষ্ট বাস্তবায়ন সহ। নতুন আর্টিফ্যাক্টটি JVM-এও ব্যবহার করা যেতে পারে, তবে বর্তমানে আপনাকেTraceProcessor
বাইনারিটির নিজস্ব অনুলিপি শুরু করতে হবে এবং এটিতে সংযোগ করার জন্য একটি পোর্ট অফার করতে হবে। ( I3a767 , I62563 , b/381134564 )
বাগ ফিক্স
-
MacrobenchmarkScope.startActivityAndWait
লক্ষ্য প্রক্রিয়া চালু করতে ব্যর্থ হলে আরও অস্পষ্ট 'অ্যাক্টিভিটি লঞ্চ সমাপ্তি নিশ্চিত করতে অক্ষম' বার্তার পরিবর্তে ( I3539b ) - Kotlin নমুনাগুলিতে বেশ কয়েকটি সিনট্যাক্স ত্রুটি সংশোধন করা হয়েছে, এবং বেশ কয়েকটি Java / build.gradle নমুনায় সিনট্যাক্স হাইলাইট করা হয়েছে৷ ( Ib3808 )
- স্পষ্ট করা
ArtMetric
এবংCaptureInfo
প্যারামিটার ডক্স। ( I96e60 )
সংস্করণ 1.4.0-alpha06
11 ডিসেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha06
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha06-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
-
PerfettoTraceProcessor.Session.query()
এ@Language("sql")
এর ব্যবহার সরানো হয়েছে, কারণ স্টুডিও হাইলাইটিং/পার্সিং নষ্ট হয়ে গেছে। ( আইডিসি২এফএ , বি/৩৭৭৭৩৩৩৯৮ )
বাগ ফিক্স
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin ডেভেলপারদের সঠিক ব্যবহার প্রয়োগ করতে নিম্নলিখিত কম্পাইলার আর্গুমেন্ট ব্যবহার করা উচিত:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I46810 , b/326456246 ) - ক্লাস লোড রিপোর্ট করার জন্য
ArtMetric
সংশোধন করা হয়েছে (init নয়), এবং রানটাইম আচরণ স্পষ্ট করতে উন্নত ডক্স। ( I9915c ) - অ্যান্ড্রয়েড মাল্টিইউজারে, শুধুমাত্র রুট করা ডিভাইসে রুট হিসেবে কমান্ড চালান। ( I88b44 )
সংস্করণ 1.4.0-alpha05
13 নভেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha05
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha05-এ এই কমিট রয়েছে।
বাগ ফিক্স
- API 34+-এ একটি সমস্যা সমাধান করা হয়েছে যেখানে
CompilationMode.None()
অসামঞ্জস্যপূর্ণ কর্মক্ষমতা প্রাথমিক, সবচেয়ে খারাপ কেস কর্মক্ষমতার প্রতিনিধিত্ব করবে না। এটি একটি প্ল্যাটফর্ম পরিবর্তনের চারপাশে কাজ করে যা ART-এর সংকলন অবস্থাকে প্রথম লঞ্চের পরপরই আংশিকভাবে অ্যাপগুলি (শুধুমাত্র ক্লাস লোডিংকে প্রভাবিত করে) কম্পাইল করতেverify
দেয়। ( IE48d0 ) - স্থির সমস্যা যেখানে (বিশেষত সংক্ষিপ্ত) ট্রেসগুলি ক্যাপচার করা যেতে পারে যা বিল্ট-ইন ম্যাক্রোবেঞ্চমার্ক মেট্রিক্স থেকে পরিমাপের রিপোর্ট করবে না, কারণ পারফেটো ট্রেসের মধ্যে প্রক্রিয়ার নামটি কাটা হয়েছে৷ এখন ম্যাক্রোবেঞ্চমার্ক প্রত্যাশিত প্যাকেজের নাম ছাড়াও সমস্ত বিল্ট-ইন কোয়েরিতে ছেঁটে ফেলা প্যাকেজের নাম খোঁজার মাধ্যমে এই সমস্যাটির চারপাশে কাজ করে। মনে রাখবেন যে কাস্টম
TraceMetric
বাস্তবায়ন বাPerfettoSession.query
এর অন্যান্য সরাসরি কলকারীরা একটি Perfetto ক্যোয়ারীতেprocess.name LIKE "$packageName"
(process.name LIKE "$packageName" OR process.name LIKE "$(packageName.takeLast(15))")
পরিবর্তন করে একই আচরণ বাস্তবায়ন করতে পারে। ( I5bf01 , b/377565760 )
সংস্করণ 1.4.0-alpha04
অক্টোবর 30, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha04
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha04-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- (পরীক্ষামূলক) বেসলাইন প্রোফাইল জেনারেশন সক্ষম করুন এবং সেকেন্ডারি ব্যবহারকারীর জন্য ইনস্টল করা অ্যাপগুলিতে বেঞ্চমার্কিং, উদাহরণস্বরূপ হেডলেস অ্যান্ড্রয়েড অটো ডিভাইসে যেকোনো অ্যাপ। এই সমর্থনটি কিছু পরিস্থিতিতে পরীক্ষা করা হয়েছে, তবে এটি আপনার জন্য কাজ না করলে একটি বাগ দিয়ে আমাদের জানান। ( I9fcbe , b/356684617 , b/373641155 )
বাগ ফিক্স
-
isProfileable
এখন সর্বদা বেঞ্চমার্ক বিল্ডগুলিতে ওভাররাইড করা হয় এবংisDebuggable
ও এখন বেঞ্চমার্ক এবংnonMinified
(বেসলাইন প্রোফাইল ক্যাপচার) উভয় বিল্ডে ওভাররাইড করা হয়। ( I487fa , b/369213505 ) - API 28-এর আগে কিছু শারীরিক ডিভাইসে সংকলন শনাক্তকরণের সমাধান করে - json
context.compilationMode
, সেইসাথেandroidx.benchmark.requireAot=true
(যা আর ভুলভাবে নিক্ষেপ করে না) এর আচরণকে প্রভাবিত করে ( Ic3e08 , b/374362482 ) -
CpuEventCounter
মেট্রিক্সে, অবৈধ পরিমাপ পরিলক্ষিত হলে ফেলে দিন (যেমন নির্দেশাবলী/cpucycles==0) ( I8c503 )
সংস্করণ 1.4.0-alpha03
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha03
প্রকাশিত হয়েছে। 1.4.0-alpha03 সংস্করণে এই কমিট রয়েছে।
এপিআই পরিবর্তন
- ম্যাক্রোবেঞ্চমার্ক :
ArtMetric
যোগ করে, যা প্রোফাইল কভারেজ বা সাধারণ Android RunTime কর্মক্ষমতা পরিদর্শন করতে ব্যবহার করা যেতে পারে। JIT এর সংখ্যা এবং মোট সময়কাল ক্যাপচার করে, ক্লাস ইনিট (যেখানে উপলব্ধ), এবং ক্লাস যাচাইকরণ। অতিরিক্তভাবে,CaptureInfo
পরিবর্তন করে ডিফল্ট সহ ঐচ্ছিক ART মেইনলাইন সংস্করণ অন্তর্ভুক্ত করে। ( I930f7 ) - একটি প্রদত্ত বেঞ্চমার্ক রানের মধ্যে স্থিতিশীলতা দেখাতে বেঞ্চমার্ক JSON আউটপুটে
coefficientOfVariation
যোগ করুন। ( Ib14ea )
বাগ ফিক্স
- AVD ডিভাইসে স্পেস থাকলে
CollectBaselineProfileTask
ফিক্সড। ( IA0225 , b/371642809 ) -
StartupMode.COLD
ব্যতিক্রম থেকে ত্রুটির জন্য অনুমানমূলক সমাধান:Package <packagename> must not be running prior to cold start!
. এখন,MacrobenchmarkScope.killProcess()
(প্রতিটি পুনরাবৃত্তির আগে একটি রান সহ, যাStartupMode.COLD
আচরণ বাস্তবায়নের জন্য ব্যবহৃত হয়) অ্যাপটির সমস্ত প্রক্রিয়া চলা বন্ধ হয়ে গেছে তা যাচাই করার জন্য অপেক্ষা করবে। ( I60aa6 , b/351582215 ) - স্থির সমস্যা যেখানে UNLOCKED_ ত্রুটি কিছু রুট করা এমুলেটরগুলিতে প্রদর্শিত হবে৷ ( Ic5117 )
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin ডেভেলপারদের সঠিক ব্যবহার প্রয়োগ করতে নিম্নলিখিত কম্পাইলার আর্গুমেন্ট ব্যবহার করা উচিত:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I7104f , b/326456246 )
সংস্করণ 1.4.0-alpha02
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha02
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha02-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- Gradle টাস্কগুলিকে
lockClocks
এবংunlockClocks
বেঞ্চমার্ক প্রকল্পগুলিতে স্থানান্তরিত করা হয়েছে, শীর্ষ স্তরে উপলব্ধ না হয়ে। এই পরিবর্তনটি প্রয়োজনীয় ছিল কারণ দুর্ভাগ্যবশত প্রকল্পের বিচ্ছিন্নতা না ভেঙে শীর্ষ স্তরের ক্রিয়া হিসাবে নিবন্ধন করার কোন উপায় নেই। ( I02b8f , b/363325823 )
বাগ ফিক্স
-
BaselineProfileRule
এখন মাল্টি-প্রসেস অ্যাপ্লিকেশানগুলির জন্য প্রোফাইলগুলি সংগ্রহ করে ব্লকের শেষে প্রতিটি চলমান প্রক্রিয়াকে ডাম্প করার জন্য সিগন্যাল করে। যদি একটি প্রোফাইল ভিত্তিক সংকলন সফলভাবে সম্প্রচার করার জন্য একটি প্রক্রিয়া খুঁজে না পায়, তবে সংকলনটি ব্যর্থ হবে, কারণ এটির মধ্যে প্রোফাইল ডেটা থাকা অপ্রত্যাশিত। অতিরিক্তভাবে, ডাম্প অপেক্ষার সময়কাল নিয়ন্ত্রণ করার জন্য একটি উপকরণ যুক্তি যোগ করা হয়েছে:androidx.benchmark.saveProfileWaitMillis
( I0f519 , b/366231469 ) - বেঞ্চমার্ক
1.3.2
থেকে : ফিক্সড ফায়ারবেস টেস্ট ল্যাব (FTL) বেসলাইন প্রোফাইল গ্রেডল প্লাগইন থেকে বেসলাইন প্রোফাইল বা ম্যাক্রোবেঞ্চমার্ক ফলাফল ফাইলগুলি টেনে আনতে অক্ষম। ( I2f678 , b/285187547 )
FTL ব্যবহার করতে প্লাগইন ব্লকের বেসলাইন প্রোফাইল মডিউলে প্লাগইন প্রয়োগ করুন, এর সাথে:
plugins {
...
id("com.google.firebase.testlab")
}
এবং তারপর এর সাথে ফায়ারবেস টেস্ট ল্যাব কনফিগার করুন:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
এছাড়াও তৈরি করা FTL ডিভাইসটিকে বেসলাইন প্রোফাইল এক্সটেনশনে যুক্ত করতে হবে:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.4.0-alpha01
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha01
প্রকাশিত হয়েছে। সংস্করণ 1.4.0-alpha01-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য - অ্যাপ স্টার্টআপ অন্তর্দৃষ্টি
- অ্যাপ স্টার্টআপ অন্তর্দৃষ্টির প্রাথমিক সংস্করণ ম্যাক্রোবেঞ্চমার্কে সক্ষম করা যেতে পারে। ( 09fae38 )
একটি স্টার্টআপ বেঞ্চমার্ক সক্ষম করতে:
@Test
fun startup {
macrobenchmarkRule.measureRepeated(
…
packageName = "com.example.my.application.id"
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
compilationMode = CompilationMode.None(),
experimentalConfig = ExperimentalConfig(startupInsightsConfig = StartupInsightsConfig(isEnabled = true))
) {
scope.startActivityAndWait(...)
}
}
তারপরে আপনার স্টার্টআপ বেঞ্চমার্ক চালানো সাধারণ সমস্যাগুলি সন্ধান করতে ট্রেস বিশ্লেষণ করবে এবং বেঞ্চমার্ক ট্যাবে স্টুডিও পরীক্ষার আউটপুটে মেট্রিক্সের পরে সেগুলি মুদ্রণ করবে, যেমন:
StartupBenchmark_startup[startup=COLD,compilationMode=None]
├── Metrics
│ ├── timeToFullDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
│ └── timeToInitialDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
├── App Startup Insights
│ ├── App in debuggable mode (expected: false)
│ │ └── seen in iterations: 0(true) 1(true) 2(true) 3(true) 4(true) 5(true) 6(true) 7(true) 8(true) 9(true)
│ ├── Potential CPU contention with another process (expected: < 100000000ns)
│ │ └── seen in iterations: 4(105022546ns)
│ └── Main Thread - Binder transactions blocked (expected: false)
│ └── seen in iterations: 7(true)
└── Traces
└── Iteration 0 1 2 3 4 5 6 7 8 9
ডকুমেন্টেশনের উন্নতি এবং অনুসরণ করার জন্য এক্সটেনসিবিলিটি সহ এই বৈশিষ্ট্যটি এখনও একটি কাজ চলছে, তবে প্রতিক্রিয়া স্বাগত জানাই।
নতুন বৈশিষ্ট্য
- সমস্ত বেসলাইন প্রোফাইল সতর্কতা দমন করতে gradle প্রপার্টি
androidx.baselineprofile.suppressWarnings
যোগ করা হয়েছে। ( 314153a ) - মাইক্রোবেঞ্চ মেট্রিক্স এখন কাউন্টার হিসাবে পারফেটো ট্রেসে প্রদর্শিত হয়। ( 3214854 )
- জিট অক্ষম করার জন্য পরীক্ষামূলক স্ক্রিপ্ট যোগ করুন (রুট/ রানটাইম রিস্টার্ট প্রয়োজন), এবং ডিভাইস পারফ/টেস্ট স্টেট রিসেট করুন। এগুলি বর্তমানে গ্রেডল টাস্ক হিসাবে প্রকাশিত হয় না। ( 7c3732b )
- এমুলেটরে চলাকালীন পরীক্ষাগুলি এড়িয়ে যাওয়ার জন্য বেঞ্চমার্ক যুক্তি যোগ করা হয়েছে৷
automaticGenerationDuring
বিল্ড সক্ষম হলে, বেঞ্চমার্কগুলি বেসলাইন প্রোফাইল জেনারেশনও ট্রিগার করবে। এমুলেটর ব্যবহার করা হলে এটি ব্যর্থ হবে। নতুন আর্গুমেন্টskipBenchmarksOnEmulator
দিয়ে আমরা পরিবর্তে পরীক্ষাটি এড়িয়ে যেতে পারি। ( 0c2ddcd ) - API 23+ ( 2550048 ) এ চালানোর জন্য পারফ ইভেন্ট সক্ষম লজিক পরিবর্তন করুন
এপিআই পরিবর্তন
-
MacrobenchmarkRule.measureRepeated()
এ বিদ্যমান পরীক্ষামূলকPerfettoConfig
আর্গুমেন্ট নতুনExperimentalConfig
অবজেক্টে সরানো হয়েছে।
বাগ ফিক্স
-
lockClocks.sh
পুনরায় চেষ্টার সংখ্যা বাড়ান ( 99e9dac ) - বিদ্যমান থাকলে
nonMinified
এবং বেঞ্চমার্ক বিল্ড প্রকার তৈরি করবেন না। একটি বাগের কারণে, এমনকি যদিnonMinified
এবং বেঞ্চমার্ক বিল্ড প্রকারগুলি বিদ্যমান থাকে, সেগুলি পুনরায় তৈরি করা হবে। ( e75f0a5 ) -
TraceSectionMetric
ফলাফল থেকে নন-টার্মিনেটিং স্লাইস উপেক্ষা করুন। ( a927d20 ) -
sdk_
উপসর্গ বিবেচনা করার জন্য উন্নত এমুলেটর চেক করুন। ( 1587de8 ) -
FrameTimingGfxInfoMetric
এ সাফ করা অ-চলমান প্যাকেজগুলিকে বিবেচনা করুন৷ ( 35cc79c ) -
androidx.benchmark.cpuEventCounter
অ-নির্দেশনা ইভেন্টগুলির জন্য দুর্নীতিগ্রস্ত মান তৈরি করে তা ঠিক করুন। ( 06edd59 ) - মেট্রিক অগ্রাধিকার ক্রমকে সম্মান করতে
resumeTiming/runWithTimingDisabled
ঠিক করুন এবং উচ্চ অগ্রাধিকার মেট্রিক ফলাফলে নিম্ন অগ্রাধিকার মেট্রিক পজ/রিজুমের প্রভাব উল্লেখযোগ্যভাবে হ্রাস করুন। উদাহরণ স্বরূপ,cpuEventCounter.enable
ইন্সট্রুমেন্টেশন আর্গুমেন্টের মাধ্যমে cpu perf কাউন্টার ব্যবহার করলে, বিরতি/পুনরায় শুরু হলে টাইমএন আর উল্লেখযোগ্যভাবে হ্রাস পায় না। ( 5de0968 )
সংস্করণ 1.3
সংস্করণ 1.3.4
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.3.4
প্রকাশিত হয়েছে। সংস্করণ 1.3.4-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- বেঞ্চমার্ক বেসলাইন গ্রেডল প্লাগইনে ফিক্সড গ্রেডল প্রজেক্ট আইসোলেশন অসঙ্গতি। ( b/404523257 )
সংস্করণ 1.3.3
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.3
প্রকাশিত হয়েছে। সংস্করণ 1.3.3-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- AVD ডিভাইসে স্পেস থাকলে
CollectBaselineProfileTask
ফিক্সড ( Ia0225 , b/371642809 )
সংস্করণ 1.3.2
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.2
প্রকাশিত হয়েছে। সংস্করণ 1.3.2-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- ফিক্সড ফায়ারবেস টেস্ট ল্যাব (FTL) বেসলাইন প্রোফাইল গ্রেডল প্লাগইন থেকে বেসলাইন প্রোফাইল বা ম্যাক্রোবেঞ্চমার্ক ফলাফল ফাইলগুলি টেনে আনতে অক্ষম। ( I2f678 , b/285187547 )
FTL ব্যবহার করতে প্লাগইন ব্লকের বেসলাইন প্রোফাইল মডিউলে প্লাগইন প্রয়োগ করুন, এর সাথে:
plugins {
...
id("com.google.firebase.testlab")
}
এবং তারপর এর সাথে ফায়ারবেস টেস্ট ল্যাব কনফিগার করুন:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
এছাড়াও তৈরি করা FTL ডিভাইসটিকে বেসলাইন প্রোফাইল এক্সটেনশনে যুক্ত করতে হবে:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.3.1
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.3.1
প্রকাশিত হয়েছে। সংস্করণ 1.3.1-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- সমস্ত বেসলাইন প্রোফাইল সতর্কতা দমন করার জন্য গ্রেডল প্রপার্টি
androidx.baselineprofile.suppressWarnings
যোগ করা হয়েছে ( I7c36e , b/349646646 ) - স্থির বেসলাইন প্রোফাইল গ্র্যাডল প্লাগইন আগে থেকে বিদ্যমান
nonMinified…
এবংbenchmark…
যদি র্যাপার তৈরি না করে অ্যাপ দ্বারা তৈরি করা হয়। ( IA8934 , b/361370179 ) - স্থির
java.lang.AssertionError: ERRORS (not suppressed): EMULATOR
যখন এমুলেটরগুলিতেautomaticGenerationDuringBuild
সক্রিয় থাকে। পরীক্ষা এড়িয়ে যাওয়ার পরিবর্তে নতুন যুক্তি ব্যবহার করা হয়। ( if3f51 , b/355515798 ) - মাইক্রোবেঞ্চমার্ক মিনিফিকেশন - বেঞ্চমার্ক লাইব্রেরি প্রোগার্ডে
org.junit.runner.notification.RunListener
এর সাবক্লাস রাখুন ( Ic8ed5 , b/354264743 ) - অ-টার্মিনেটিং স্লাইস উপেক্ষা করতে
TraceSectionMetric
ঠিক করুন। পূর্বে এগুলিকে -1 সময়কাল হিসাবে বিবেচনা করা হত, যেমন যোগফলের সময় বা সর্বনিম্ন সময়কাল খুঁজে বের করার সময়। ( if74b7 ) -
FrameTimingGfxInfoMetric
এ একটি সমস্যা সমাধান করা হয়েছে যেখানে প্রক্রিয়াটি আগে থেকে চলমান না থাকলে মেট্রিক শুরু করা ক্র্যাশ হয়ে যাবে। ( I6e412 )
সংস্করণ 1.3.0
21 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-এ এই কমিট রয়েছে।
1.2.0 থেকে মাইক্রোবেঞ্চমার্কের পরিবর্তন
- বেশিরভাগ ডিভাইসে চলমান অবস্থায় মাইক্রোবেঞ্চমার্কে মেথড ট্রেসিং ডিফল্টভাবে চালু থাকে
- মেথড ট্রেসিং পরিমাপের পরে একটি পৃথক ফেজ হিসাবে চলে - এটি সঠিক পরিমাপ এবং পদ্ধতি ট্রেস উভয়ই একটি একক বেঞ্চমার্ক রান থেকে আউটপুট হতে সক্ষম করে
- কিছু অ্যান্ড্রয়েড ওএস এবং এআরটি সংস্করণে পদ্ধতির ট্রেসিং পরবর্তী পরিমাপের পর্যায়গুলিকে প্রভাবিত করবে - এই সংস্করণগুলিতে, পদ্ধতির ট্রেসিং ডিফল্টরূপে বন্ধ থাকে এবং স্টুডিও আউটপুটে একটি সতর্কতা প্রিন্ট করা হয়
- প্রধান থ্রেড বেঞ্চমার্ক এবং ANR
- অনেক সেকেন্ড চলার সময় ANR এড়াতে UI থ্রেড বেঞ্চমার্কের জন্য (যেমন যেগুলি রচনা/ভিউ UI-এর সাথে ইন্টারঅ্যাক্ট করে) এর জন্য
measureRepeatedOnMainThread
যোগ করা হয়েছে। - ANR এড়ানোর সময়সীমা অতিক্রম করার প্রত্যাশিত হলে পদ্ধতির চিহ্নগুলি বাদ দেওয়া হয়। এই আচরণটি নিষ্ক্রিয় করতে
androidx.benchmark.profiling.skipWhenDurationRisksAnr
মিথ্যাতে সেট করুন (CI রানের জন্য সুপারিশ করা হয় না, কারণ ANR দীর্ঘ CI রানে সমস্যা সৃষ্টি করতে পারে)।
- অনেক সেকেন্ড চলার সময় ANR এড়াতে UI থ্রেড বেঞ্চমার্কের জন্য (যেমন যেগুলি রচনা/ভিউ UI-এর সাথে ইন্টারঅ্যাক্ট করে) এর জন্য
- মিনিফিকেশন
- মাইক্রোবেঞ্চমার্কিং উন্নত করার জন্য এম্বেড করা প্রোগার্ড নিয়মগুলি মিনিফিকেশন সক্ষম করা আছে
- একটি লাইব্রেরি মডিউলে Minification/R8 এর জন্য AGP 8.3 প্রয়োজন এবং আপনার
build.gradle
এandroid.buildTypes.release.androidTest.enableMinification
এর মাধ্যমে সক্ষম করা যেতে পারে - পরীক্ষামূলক
BlackHole.consume()
API ডেড কোড নির্মূল রোধ করতে যোগ করা হয়েছে ( If6812 , b/286091643 )
- মেট্রিক্স
- পরীক্ষামূলক cpu ইভেন্ট কাউন্টার বৈশিষ্ট্য (
perf_event_open
থেকে মেট্রিক্স, যার জন্য প্ল্যাটফর্মের বেশিরভাগ সংস্করণে রুট প্রয়োজন),InstrumentationArgument
androidx.benchmark.cpuEventCounter.enable
এর মাধ্যমে অ্যাক্সেস (true
সেট করা যেতে পারে), এবংandroidx.benchmark.cpuEventCounter.events
(Instructions,CpuCycles
সেট করা যেতে পারে)। এটি কিছু ইউজারডিবাগ এমুলেটরগুলিতে সমর্থিত হওয়া উচিত, তবে সমস্ত উপলব্ধ এমুলেটরগুলিতে সমর্থন পরীক্ষা করা হয়নি
- পরীক্ষামূলক cpu ইভেন্ট কাউন্টার বৈশিষ্ট্য (
1.2.0 থেকে MACROবেঞ্চমার্ক পরিবর্তন হয়েছে
- ম্যাক্রোবেঞ্চমার্কের জন্য মেথড ট্রেসিং ওভারহল।
- এখন মেথড ট্রেসগুলি
measureBlock
ব্লকের সময়কালের জন্য স্কোপ করা হয়েছে, এবং প্রক্রিয়াটি একাধিকবার শুরু হলে একাধিক সেশন ক্যাপচার করতে পারে। - পূর্বে, মেথড ট্রেসিং শুধুমাত্র
StartupMode.COLD
বেঞ্চমার্কের জন্য কাজ করবে, এবংmeasureBlocks
জন্য কিছুই ক্যাপচার করবে যা টার্গেট প্রসেস রিস্টার্ট করেনি - স্থির পদ্ধতির ট্রেসগুলি ম্যাক্রোবেঞ্চমার্কে ফ্লাশ করে, যাতে পদ্ধতির ট্রেসগুলি সম্পূর্ণরূপে ক্যাপচার করা এবং বৈধ হওয়া উচিত, এমনকি ধীর ডিভাইসেও। ( I6349a , b/329904950 )
- এখন মেথড ট্রেসগুলি
- পৃথক
warmUp
পুনরাবৃত্তির সময় সঠিকভাবে ART প্রোফাইল ডাম্প করুন যখন প্রক্রিয়াটি মারা যায় তাইCompilationMode.Partial(warmup=N)
পরিমাপ আরও সঠিক। ( I17923 ) - ড্রপ Shader সম্প্রচার ব্যর্থতা বার্তা
- শেডার সম্প্রচার ব্যর্থতার বার্তা ড্রপ করতে ডিবাগিং পরামর্শ যোগ করা হয়েছে
-
ProfileInstaller
1.3 ছাড়া অ্যাপস বেঞ্চমার্ক করার সময় শেডার ড্রপিং আচরণ ওভাররাইড করার জন্য দুটি ইন্সট্রুমেন্টেশন আর্গুমেন্ট যোগ করুন:-
androidx.benchmark.dropShaders.enable=true/false
: সমস্ত শেডার ড্রপিং (StartupMode.Cold
লঞ্চ সহ) এড়িয়ে যেতে ব্যবহার করা যেতে পারে, বিশেষ করে বেঞ্চমার্ক করার সময় অ্যাপগুলি যেগুলি এখনও প্রোফাইলইনস্টলার 1.3 ব্যবহার করে না -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: শেডার্স ড্রপ করার চেষ্টা করার সময় ব্যর্থতা সহ্য করতে ব্যবহার করা যেতে পারে, উদাহরণস্বরূপ যখন প্রোফাইলইনস্টলার 1.3 ( I4f573 ) ছাড়া অ্যাপের বেঞ্চমার্কিং
-
- পরীক্ষামূলক
MacrobenchmarkRule#measureRepeated
variant যোগ করা হয়েছে যা সম্পূর্ণ কাস্টমাইজড Perfetto ট্রেস রেকর্ডিংয়ের জন্য একটি কাস্টমPerfettoConfig
নেয়। মনে রাখবেন যে ভুলভাবে কনফিগার করা কনফিগারের কারণে বিল্ট ইন মেট্রিক ক্লাস ব্যর্থ হতে পারে। ( Idfd3d , b/309841164 , b/304038384 ) - হস্তক্ষেপ কমাতে ম্যাক্রোবেঞ্চমার্ক চালানোর আগে ব্যাকগ্রাউন্ড ডেক্সপট কাজগুলি বাতিল করুন। ( I989ed )
- ম্যাক্রোবেঞ্চমার্ক এখন একটি ART প্রোফাইল ফ্লাশ করার লক্ষ্য অ্যাপ্লিকেশনটির জন্য 1 সেকেন্ডের জন্য অপেক্ষা করে (আগে এটি 500 ms এর জন্য অপেক্ষা করত)। ( I85a50 , b/316082056 )
- TraceSectionMetric ওভারহল
- দ্রষ্টব্য : নীচের
TraceSectionMetric
পরিবর্তনগুলি CI ব্যবহারের আউটপুটগুলিকে প্রভাবিত করতে পারে এবং বিচ্ছিন্নতা তৈরি করতে পারে, বা পার্সিং ভেঙে দিতে পারে - যোগফল এখন ডিফল্ট, কারণ এই মেট্রিকের বেশির ভাগ ব্যবহার বারবার ইভেন্টের জন্য হয় এবং প্রথমে এই ক্ষেত্রে ডেটা বাতিল করা হবে
- আরও উপলভ্য মোড সহ আরও কাস্টমাইজযোগ্য হতে পরিবর্তিত হয়েছে
- মোডের নামগুলি এখন মেট্রিক আউটপুট নামে এম্বেড করা হয়েছে (স্টুডিও এবং JSON-এ)
- এখন
Trace.{begin|end}AsyncSection
।
- দ্রষ্টব্য : নীচের
- মেট্রিক্স
- পাওয়ার -
PowerMetric.deviceSupportsHighPrecisionTracking
,PowerMetric.deviceBatteryHasMinimumCharge()
এবংPowerMetric.deviceSupportsPowerEnergy()
যোগ করা হয়েছে -
Metric.getResult
নাম পরিবর্তন করেgetMeasurements
সাথে মেলে রিটার্ন টাইপ - সমস্ত স্টার্টআপ সনাক্তকরণ ব্যর্থতায় log.w/ ব্যতিক্রম লেবেল যোগ করা হয়েছে। এটি বর্তমান আচরণ পরিবর্তন করে না (তাই কিছু ত্রুটি নিক্ষেপ করে, এবং অন্যরা নীরবে স্টার্টআপ সনাক্ত করতে ব্যর্থ হয়), এটি আরও বোধগম্য করে তোলে। সাধারণত যেগুলি
Log.w()
এবং স্টার্টআপ মেট্রিক্স রিপোর্ট করতে ব্যর্থ হয় সেগুলি হল যেখানে নন-ফ্রেম ইভেন্টগুলি অনুপস্থিত, ব্যতিক্রমগুলি ছুঁড়ে দেওয়া হয় যখন স্টার্টআপ শনাক্ত করা হয় ফ্রেম টাইমিং তথ্য (UI/RT স্লাইস থেকে) ছাড়া৷ ( Id240f , b/329145809 ) -
FrameTimingMetric
এframeCount
পরিমাপ যোগ করা হয়েছে এমন পরিস্থিতির আবিষ্কারে সাহায্য করার জন্য যেখানে পরিমাপ পরিবর্তিত হয় কারণ উত্পাদিত ফ্রেমের সংখ্যা পরিবর্তিত হয় (নতুন অ্যানিমেশন যোগ করা হয়েছে, অবৈধতা সংক্রান্ত সমস্যাগুলি সংশোধন করা হয়েছে)। ( I1e5aa ) - স্পষ্ট করা হয়েছে যে ডক্সে উপলব্ধ হলে ট্র্যাকিংয়ের জন্য
frameOverrunMs
পছন্দের মেট্রিক এবং কেন। ( I18749 , b/329478323 ) - সমস্যার সমাধান করে যেখানে ট্রেসের শুরুতে এবং শেষের শেষ না হওয়া ফ্রেমগুলিকে একসাথে যুক্ত করা যেতে পারে, যা একটি একক অত্যন্ত দীর্ঘ ফ্রেম হিসাবে ভুলভাবে রিপোর্ট করবে। ( I39353 , b/322232828 )
-
FrameTimingMetric
ত্রুটি উন্নত করুন যখন ফ্রেম তৈরি করা হয় না, এবং সমস্যা নির্ণয়ে সহায়তা করার জন্য মেট্রিক পার্সিং ব্যর্থ হলে সর্বদা ট্রেস লিঙ্ক আউটপুট করুন। ( I956b9 ) -
FrameTimingMetric
এ স্থির ক্র্যাশ ফ্রেম আইডি পার্স করতে ব্যর্থ হয়েছে, বিশেষ করে নির্দিষ্ট কিছু OEM ডিভাইসে। ( IA24bc , b/303823815 , b/306235276 ) -
FrameMetrics
চেকের কঠোরতা শিথিল করা হয়েছে এবং ত্রুটির বার্তাগুলিতে আরও বিশদ যোগ করা হয়েছে। ( ইয়াদেদে )
- পাওয়ার -
বেসলাইন প্রোফাইল ক্যাপচার / গ্রেডল প্লাগইন 1.2.0 থেকে পরিবর্তিত হয়েছে
- AGP-এর সর্বাধিক প্রস্তাবিত সংস্করণ 9.0.0-alpha01-এ বৃদ্ধি করা হয়েছে।
- নিশ্চিত করুন
mergeArtProfile
এবংmergeStartupProfile
কাজগুলি সর্বদা বেসলাইন প্রোফাইল তৈরির জন্য অপেক্ষা করে৷ ( I623d6 , b/343086054 ) - একটি বেসলাইন প্রোফাইল সফলভাবে তৈরি করা হলে যা পরিবর্তিত হয়েছে তার একটি সারাংশ আউটপুট করবে ( I824c8 , b/269484510 )
- সতর্কতা নিষ্ক্রিয় করতে DSL যোগ করা হয়েছে ( Ic4deb , b/331237001 )
-
automaticGenerationDuringBuild
বন্ধ থাকলে বেঞ্চমার্কগুলি জেনারেট করা বেসলাইন প্রোফাইলগুলি ব্যবহার করে তা নিশ্চিত করুন ( Ic144f , b/333024280 ) - একটি
nonMinified
বা বেঞ্চমার্ক বিল্ড টাইপ কাস্টমাইজ করার সময় বেসলাইন প্রোফাইল জেনারেশন এবং বেঞ্চমার্কিং সক্ষম করতেBaselineProfile
গ্রেডল প্লাগইন সম্পত্তি ওভাররাইডগুলি ঠিক করুন। ( Ib8f05 , b/324837887 ) - AGP 8.3.0-alpha15 এর আগে AAR-এ লাইব্রেরি বেসলাইন প্রোফাইল অন্তর্ভুক্ত করার জন্য ঠিক করুন। ( I1d2af , b/313992099 )
- জেনারেশন টাস্কের শেষে বেসলাইন এবং স্টার্টআপ প্রোফাইল আউটপুট ইউআরএল ফিক্সড। ( I802e5 , b/313976958 )
1.2.0 থেকে অন্যান্য উল্লেখযোগ্য পরিবর্তন
- ট্রেস ক্যাপচার
- EXITCODE 2 ত্রুটি হ্রাস করা হয়েছে যখন একটি ত্রুটি থেকে লগ করা সতর্কতা পর্যন্ত perfetto শুরু করার সময়
- বেঞ্চমার্কে ডিফল্টরূপে AIDL ট্রেসিং সক্ষম করুন (এপিআই 28 প্রয়োজন) ( Ia0af2 , b/341852305 )
- বেঞ্চমার্কে ডিফল্টরূপে পোর্টার ট্যাগ ট্রেসিং সক্ষম করুন। এটি ক্যাপচার করে, উদাহরণস্বরূপ, wakelock ট্রেসপয়েন্ট। ( ICfe44 , b/286551983 )
- ধীরগতির ডিভাইসগুলিতে ট্রেসিং শুরু করার সময় ক্র্যাশ এড়াতে বর্ধিত ট্রেস ক্যাপচার শুরুর সময়সীমা ( I98841 , b/329145808 )
- JSON, textproto এবং প্রোটো বাইনারি (আনডিকোডেড) ভেরিয়েন্ট সহ পাবলিক API
PerfettoTraceProcessor.Session.queryMetrics
API যোগ করা হয়েছে। এগুলি আপনাকেTraceProcessor
( I54d7f , b/304038382 )-এ অন্তর্নির্মিত মেট্রিকগুলি জিজ্ঞাসা করার অনুমতি দেয় - ট্রেসের শুরুতে ডেটা হারিয়ে যাওয়ার ঝুঁকি কমাতে পারফেটো ট্রেস রেকর্ডে ব্লক করা শুরু সক্ষম করুন। শুধুমাত্র API 33+ এ সমর্থিত। ( Ie6e41 , b/310760059 )
- JSON আউটপুট
- JSON আউটপুটে বেঞ্চমার্ক প্রসঙ্গে অতিরিক্ত তথ্য যোগ করা হয়েছে:
-
context.artMainlineVersion
- আর্ট মেইনলাইন মডিউলের পূর্ণসংখ্যা সংস্করণ (যদি ডিভাইসে থাকে,-1
অন্যথায়) -
context.build.id
- android.os.Build.ID এর সমান -
context.build.version.codename
- android.os.Build.VERSION.CODENAME এর সমান -
context.build.version.abbreviatedCodename
- প্রাক-রিলিজ কোডনামের প্রথম অক্ষরের সাথে মিলে যায় ( রিলিজ বিল্ড সহ)
-
- প্রোফাইলিং ট্রেস (যেমন পারফেটো, মেথড ট্রেস) ( I05ddd , b/332604449 ) এর চারপাশে সহজ টুলিংয়ের জন্য JSON আউটপুটে
profilerOutput
তালিকা যোগ করা হয়েছে - বেঞ্চমার্ক মডিউলগুলিতে যখন Android টেস্ট অর্কেস্ট্রেটর ব্যবহার করা হয় তখন একটি সতর্কতা যোগ করা হয়েছে, কারণ এটি প্রতি-মডিউল আউটপুট JSON ফাইলগুলিকে বারবার ওভাররাইট করবে৷ ( IA1af6 , b/286899049 )
- ফাইলের নাম 200 অক্ষরের বেশি হলে ফেলুন যাতে ফাইল লেখার সময় বা পোস্ট-প্রসেসিং করার সময় অস্পষ্ট ক্র্যাশ এড়াতে হয়। ( I4a5ab )
- JSON আউটপুটে বেঞ্চমার্ক প্রসঙ্গে অতিরিক্ত তথ্য যোগ করা হয়েছে:
সংস্করণ 1.3.0-rc01
7 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0-rc01
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-rc01-এ এই কমিট রয়েছে।
বাগ ফিক্স
-
androidx.benchmark.cpuEventCounter
অ-নির্দেশনামূলক ইভেন্টগুলির জন্য দুর্নীতিগ্রস্ত মান তৈরি করে ( I7386a , b/286306579 ) ঠিক করুন - মেট্রিক অগ্রাধিকার ক্রমকে সম্মান করতে
resumeTiming
/runWithTimingDisabled
ঠিক করুন এবং উচ্চ অগ্রাধিকার মেট্রিক ফলাফলে নিম্ন অগ্রাধিকার মেট্রিক পজ/রিজুমের প্রভাব উল্লেখযোগ্যভাবে কমিয়ে দিন। উদাহরণ স্বরূপ,cpuEventCounter.enable
ইন্সট্রুমেন্টেশন আর্গুমেন্টের মাধ্যমে cpu perf কাউন্টার ব্যবহার করলে, বিরতি/পুনরায় শুরু হলে টাইমএন আর উল্লেখযোগ্যভাবে হ্রাস পায় না। ( I39c2e , b/286306579 , b/307445225 ) - স্ট্যাক স্যাম্পলিং এর সম্ভাবনা হ্রাস করা হয়েছে যার ফলে মেইন থ্রেডের হার্ড টাইমআউট স্ট্যাক স্যাম্পলিং কনভার্সনকে প্রধান থ্রেডের বাইরে সরিয়ে দিয়ে
measureRepeatedOnMainThread
আঘাত করা হতে পারে। ( I487a8 , b/342237318 ) - নতুন প্ল্যাটফর্ম API-এ অ্যাক্সেসের ম্যানুয়াল রূপরেখা সরানো হয়েছে যেহেতু AGP 7.3 বা তার পরে (যেমন R8 সংস্করণ 3.3) এবং AGP 8.1 বা তার পরবর্তী (যেমন D8 সংস্করণ 8.1) ব্যবহার করার সময় R8 ব্যবহার করার সময় এটি স্বয়ংক্রিয়ভাবে API মডেলিংয়ের মাধ্যমে ঘটে। যে সকল ক্লায়েন্ট AGP ব্যবহার করছেন না তাদের D8 সংস্করণ 8.1 বা তার পরবর্তী সংস্করণে আপডেট করার পরামর্শ দেওয়া হচ্ছে। আরো বিস্তারিত জানার জন্য এই নিবন্ধটি দেখুন. ( I9496c , b/345472586 )
- instr arg হিসাবে প্যাকেজের নাম পাঠাতে agp সংস্করণ চেক যোগ করা হয়েছে। AGP 8.4.0 এর পূর্বে লক্ষ্য অ্যাপ প্যাকেজের নাম ইন্সট্রুমেন্টেশন আর্গুমেন্টের মাধ্যমে ইন্সট্রুমেন্টেশন অ্যাপে পাঠানো যাবে না। ( 0c72a3f )
সংস্করণ 1.3.0-beta02
10 জুলাই, 2024
androidx.benchmark:benchmark-*:1.3.0-beta02
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-beta02-এ এই কমিট রয়েছে।
বাগ ফিক্স
- একটি সতর্কতা লগ করার জন্য Perfetto শুরু করার সময় EXITCODE
2
সুন্দরভাবে পরিচালনা করুন, কিন্তু এগিয়ে যান।
সংস্করণ 1.3.0-beta01
জুন 12, 2024
androidx.benchmark:benchmark-*:1.3.0-beta01
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-beta01-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- সামঞ্জস্যের জন্য
MethodTracing.affectsMeasurementOnThisDevice
AFFECTS_MEASUREMENT_ON_THIS_DEVICE
এ পুনঃনামকরণ করা হয়েছে। ( আই১বিডিএফএ ) - মাইক্রোবেঞ্চমার্কে ডেড কোড নির্মূল রোধ করতে পরীক্ষামূলক
BlackHole.consume()
api যোগ করা হয়েছে। ( if6812 , b/286091643 ) - মাইক্রোবেঞ্চমার্ক এখন সঠিকভাবে নিক্ষেপ করবে যাতে মেথড ট্রেসিং পরিমাপের সাথে হস্তক্ষেপ না হয়। এটি কিছু ডিভাইসে ঘটে যখন মেথড ট্রেসিং জোরপূর্বক চালু করা হয় (ইনস্ট্রুমেন্টেশন আর্গস বা
MicrobenchmarkConfig
এর মাধ্যমে), এবং যদি মেথড ট্রেস করার পরে একটি পরিমাপ করার চেষ্টা করা হয়। প্রভাবিত ডিভাইসগুলি API 26-30 বা নির্দিষ্ট ART মেইনলাইন মডিউল সংস্করণ চালাচ্ছে যা এই হস্তক্ষেপ দ্বারা প্রভাবিত হয়েছে এবংProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice
এর মাধ্যমে রানটাইমে সনাক্ত করা যেতে পারে। ( Iafb92 , b/303660864 )
বাগ ফিক্স
- বাম্পড ম্যাক্স এজিপি সংস্করণ 9.0.0-আলফা01-এ সুপারিশ করা হয়েছে। ( I5bbb0 )
- বেঞ্চমার্ক প্রসঙ্গে সংকলন মোড যোগ করা হয়েছে ( If5612 , b/325512900 )
- ডিফল্টরূপে AIDL ট্রেসিং সক্ষম করুন (এপিআই 28 প্রয়োজন) ( Ia0af2 , b/341852305 )
- JSON আউটপুটে বেঞ্চমার্ক প্রসঙ্গে অতিরিক্ত তথ্য যোগ করা হয়েছে:
-
context.artMainlineVersion
- আর্ট মেইনলাইন মডিউলের পূর্ণসংখ্যা সংস্করণ (যদি ডিভাইসে থাকে, -1 অন্যথায়) -
context.build.id
-android.os.Build.ID
সমান -
context.build.version.codename
-android.os.Build.VERSION.CODENAME
এর সমান -
context.build.version.abbreviatedCodename
- প্রাক-রিলিজ কোডনামের প্রথম অক্ষরের সাথে মিলে যায় (এমনকি রিলিজ বিল্ডেও )
-
-
androidx.benchmark.profiling.sampleDurationSeconds
( Ib1d53 ) কে সম্মান করার জন্যStackSampling
সংশোধন করে -
api()
হতে macro->সাধারণ নির্ভরতা পরিবর্তন করুন, যাতে এটি ব্যবহার করা সহজ যেমনPerfettoTrace
এবংPerfettoConfig
। ( Icdae3 , b/341851833 ) - নিশ্চিত করুন
mergeArtProfile
এবংmergeStartupProfile
কাজগুলি সর্বদা বেসলাইন প্রোফাইল তৈরির জন্য অপেক্ষা করে৷ ( I623d6 , b/343086054 ) - বৈকল্পিক সক্ষম করা উচিত কিনা তা সিদ্ধান্ত নেওয়ার সময় বৈকল্পিক সক্ষম অবস্থা বিবেচনা করুন৷ ( I5d19e , b/343249144 )
- পারফেটো ট্রেস প্রসেসরের জন্য বর্ধিত ডিফল্ট শুরুর সময়সীমা। ( I87e8c , b/329145808 )
সংস্করণ 1.3.0-alpha05
14 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha05
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-alpha05-এ এই কমিট রয়েছে।
বাগ ফিক্স
- ম্যাক্রোবেঞ্চ মেট্রিক সমস্ত পুনরাবৃত্তির জন্য শূন্য মান প্রদান করলে স্পষ্ট ব্যতিক্রম ছুঁড়ে দিন ( Iab58f , b/314931695 )
- শ্রোতার নিয়ম এবং অন্যান্য পর্যবেক্ষণ করা সতর্কতা/ত্রুটির সমর্থন সহ মাইক্রোবেঞ্চ প্রোগার্ড নিয়মে অতিরিক্ত সমাধানের নিয়মগুলি যোগ করা হয়েছে। ( I14d8f , b/329126308 , b/339085669 )
- মেথড ট্রেসিং একটি ম্যাক্রোবেঞ্চমার্কের সময় একটি পৃথক ফেজ হিসাবে চলে এবং এটি আর পরিমাপকে প্রভাবিত করে না। ( if9a50 , b/285912360 , b/336588271 )
- শেডার সম্প্রচার ব্যর্থতার বার্তা ড্রপ করতে অতিরিক্ত ডিবাগিং পরামর্শ যোগ করা হয়েছে। ( I5efa6 , b/325502725 )
সংস্করণ 1.3.0-alpha04
1 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha04
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-alpha04-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- পরীক্ষামূলক
MacrobenchmarkRule#measureRepeated
variant যোগ করা হয়েছে যা সম্পূর্ণ কাস্টমাইজড Perfetto ট্রেস রেকর্ডিংয়ের জন্য একটি কাস্টমPerfettoConfig
নেয়। মনে রাখবেন যে ভুলভাবে কনফিগার করা কনফিগারের কারণে বিল্ট ইন মেট্রিক ক্লাস ব্যর্থ হতে পারে। ( Idfd3d , b/309841164 , b/304038384 ) - স্বচ্ছতার জন্য
PowerMetric.deviceSupportsPowerEnergy
এPowerMetric.deviceSupportsHighPrecisionTracking
এর নাম পরিবর্তন করুন ( I5b82f ) - ডিভাইস পাওয়ার পরিমাপের ক্ষমতার উপর ভিত্তি করে বেঞ্চমার্ক পরিবর্তন বা এড়িয়ে যাওয়া সক্ষম করতে
PowerMetric.deviceBatteryHasMinimumCharge()
এবংPowerMetric.deviceSupportsPowerEnergy()
যোগ করা হয়েছে। ( I6a591 , b/322121218 )
বাগ ফিক্স
- পূর্ববর্তী বেসলাইন প্রোফাইলের সাথে তুলনা যোগ করা হয়েছে ( I824c8 , b/269484510 )
- সতর্কতা নিষ্ক্রিয় করতে DSL যোগ করা হয়েছে ( Ic4deb , b/331237001 )
- বেঞ্চমার্ক ভেরিয়েন্ট অক্ষম করা হলে তথ্য লগে ব্যতিক্রম পরিবর্তন করা হয়েছে ( I8a517 , b/332772491 )
- একটি ম্যাক্রোবেঞ্চমার্কের জন্য পদ্ধতির ট্রেস ক্যাপচার করা সহজ করে তুলুন প্রকৃত
measureBlock()
এর সময়কাল পর্যন্ত। পূর্বে, এটি টার্গেট প্রসেস লঞ্চে শুরু হয়েছিল এবং শুধুমাত্র কোল্ড স্টার্ট সমর্থিত ছিল ( Iee85a , b/300651094 ) - যখন পারফেটো ট্রেস প্রসেসর শুরু হতে ধীর হয় তখন ক্র্যাশ হওয়া এড়িয়ে চলুন ( I98841 , b/329145808 )
সংস্করণ 1.3.0-alpha03
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha03
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-alpha03-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- JSON, textproto এবং প্রোটো বাইনারি (আনডিকোডেড) ভেরিয়েন্টের সাথে পাবলিক API
PerfettoTraceProcessor.Session.queryMetrics
API যোগ করে। এগুলি আপনাকে ট্রেসপ্রসেসর ( I54d7f , b/304038382 ) -এ অন্তর্নির্মিত মেট্রিকগুলি জিজ্ঞাসা করার অনুমতি দেয় - প্রোফাইলিং ট্রেসগুলির চারপাশে সহজ টুলিংয়ের জন্য JSON আউটপুটে
profilerOutput
যোগ করা হয়েছে (যেমন perfetto, পদ্ধতি ট্রেস)। ( I05ddd , b/332604449 ) - বেঞ্চমার্ক পারফেটো কনফিগারেশনে পাওয়ার ট্যাগ যোগ করা হয়েছে। এটি ক্যাপচার করে, উদাহরণস্বরূপ, wakelock ট্রেসপয়েন্ট। ( ICfe44 , b/286551983 )
- যোগ করা ইনস্ট আর্গুমেন্ট
androidx.benchmark.profiling.skipWhenDurationRisksAnr
, প্রত্যাশিত সময়কাল একটি ANR হতে পারে যখন পদ্ধতি ট্রেস এড়ানোর জন্য মিথ্যা সেট করা যেতে পারে - CI রান এড়ানোর জন্য দৃঢ়ভাবে সুপারিশ করা হয়। -
androidx.benchmark.profiling.perfCompare.enable
পরীক্ষামূলক যুক্তি যোগ করা হয়েছে, পরিমাপ এবং প্রোফাইলিং পর্যায়গুলির মধ্যে তুলনার সময় চালানোর জন্য এটিকে সত্য হিসাবে সেট করুন। যেমন পদ্ধতি ট্রেসিংয়ের ওভারহেড মূল্যায়ন করার ক্ষেত্রে দরকারী। ( I61fb4 , খ/329146942 )
এপিআই পরিবর্তন
- বিবৃতি ( i71f7b ) যখন বিচ্ছিন্ন না হয়ে ভবিষ্যতের সম্প্রসারণ সক্ষম করতে
TraceSectionMetric.Mode
সিলড ক্লাসে পরিবর্তিত হয়েছে - যুক্ত হওয়া
TraceSectionMetric.Mode.Average
এবং.Count
এবং পুনরায় অর্ডার করা আরগস তাই আরও সাধারণ আর্গুমেন্ট (মোড) এর আগে আরগ তালিকায় ছিল, প্যারামিটারের নামগুলি নির্দিষ্ট করার জন্য প্রয়োজনীয়তা হ্রাস করে। ( আইবিএফ 0 বি 0, বি/315830077 , বি/322167531 ) - রিটার্ন প্রকারের সাথে মেলে ( আই 42595 ) এর সাথে
Metric.getResult
getMeasurements
নামকরণ করা হয়েছে
বাগ ফিক্স
-
automaticGenerationDuringBuild
বিল্ড বন্ধ থাকাকালীন বেঞ্চমার্কগুলি উত্পন্ন বেসলাইন প্রোফাইলগুলি ব্যবহার করে তা নিশ্চিত করার জন্য ঠিক করুন ( আইসি 144 এফ , বি/333024280 ) - বেসলাইন প্রোফাইল জেনারেশন এবং বেঞ্চমার্কিং সক্ষম করতে
BaselineProfile
গ্রেডল প্লাগইন প্রপার্টি ওভাররাইডগুলি ফিক্স করুন যখন একটিnonMinified
বা বেঞ্চমার্ক বিল্ড টাইপটি কাস্টমাইজ করার সময়। ( আইবি 8 এফ 05 , বি/324837887 ) - স্থির পদ্ধতিগুলি ম্যাক্রোব্যাঞ্চমার্কে ফ্লাশ ট্রেসগুলি ট্রেসগুলি ফ্লাশ করে, যাতে সেই পদ্ধতির চিহ্নগুলি সম্পূর্ণরূপে ক্যাপচার এবং বৈধ হওয়া উচিত, এমনকি ধীর ডিভাইসেও। ( I6349a , খ/329904950 )
- ট্রেসের শুরুতে ডেটা অনুপস্থিত ডেটা ঝুঁকি হ্রাস করতে পারফেটো ট্রেস রেকর্ডে ব্লকিং শুরু সক্ষম করুন। কেবল এপিআই 33+ এ সমর্থিত। ( Ie6e41 , খ/310760059 )
- যখন অ্যান্ড্রয়েড টেস্ট অর্কেস্টেটর বেঞ্চমার্ক মডিউলগুলিতে ব্যবহৃত হয় তখন একটি সতর্কতা যুক্ত করা হয়েছে, কারণ এটি প্রতি-মডিউল আউটপুট জেএসএন ফাইলগুলি বারবার ওভাররাইট করা হবে। ( আইএ 1 এএফ 6 , বি/286899049 )
- ফোর্স ',' (কমা) স্টুডিও আউটপুটে ধারাবাহিকতার জন্য হাজার হাজার বিভাজক, ডিভাইস লোকেলকে উপেক্ষা করে ( i3e921 , খ/313496656 )
-
TraceSectionMetric
এখনTrace.{begin|end}AsyncSection
। ( I91b32 , খ/300434906 ) - সমস্ত স্টার্টআপ সনাক্তকরণ ব্যর্থতায় লগ.ডাব্লু / ব্যতিক্রম লেবেল যুক্ত করা হয়েছে। এটি বর্তমান আচরণ পরিবর্তন করে না (তাই কিছু ত্রুটি নিক্ষেপ করে এবং অন্যরা নিঃশব্দে স্টার্টআপটি সনাক্ত করতে ব্যর্থ হয়), কেবল এটি আরও বোধগম্য করে তোলে। সাধারণত যেগুলি
Log.w()
( আইডি 240 এফ , বি/329145809 ) - হস্তক্ষেপ হ্রাস করতে ম্যাক্রোব্যাঞ্চমার্ক চালানোর আগে ব্যাকগ্রাউন্ড ডেক্সপট কাজ বাতিল করুন। ( I989ed )
-
FrameTimingMetric
সাথেframeCount
পরিমাপ যুক্ত করা হয়েছে যেখানে পরিমাপের পরিবর্তন হয় কারণ উত্পাদিত ফ্রেমের সংখ্যা পরিবর্তিত হয়েছে (নতুন অ্যানিমেশন যুক্ত হয়েছে, অবৈধকরণ বিষয়গুলি স্থির)। ( I1e5aa ) - স্পষ্ট করে জানিয়েছেন যে
frameOverrunMs
হ'ল ডক্সে যখন পাওয়া যায় তখন ট্র্যাকিংয়ের জন্য পছন্দসই মেট্রিক। ( I18749 , খ/329478323 )
সংস্করণ 1.3.0-আলফা 02
20 মার্চ, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha02
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-ALPHA02 এ এই কমিটস রয়েছে।
নতুন বৈশিষ্ট্য
এম্বেডড প্রোগুয়ার্ড বিধিগুলির মাধ্যমে মাইক্রোব্যাঞ্চে পরীক্ষামূলক আর 8 সমর্থন। নোট করুন যে এই সমর্থনটি পরীক্ষামূলক, এবং লাইব্রেরি মডিউল পরীক্ষাগুলির মিনিফিকেশনটির জন্য এজিপি 8.3 প্রয়োজন। আপনার বেঞ্চমার্ক মডিউলটির
build.gradle
আর 8 মিনিফিকেশন/অপ্টিমাইজেশন সক্ষম করতে নিম্নলিখিতগুলি ব্যবহার করুন, যা কাজের চাপের উপর নির্ভর করে একটি উল্লেখযোগ্য পারফরম্যান্স বৃদ্ধির দিকে পরিচালিত করে। ( I738a3 , বি/184378053 )android { buildTypes.release.androidTest.enableMinification = true }
বাগ ফিক্স
- মাইক্রোব্যাঞ্চ আউটপুট থেকে পৃথক লাইনে থাকার সতর্কতা ট্রেসিং পদ্ধতিগুলি ফিক্স করে। ( I0455c , খ/328308833 )
সংস্করণ 1.3.0-আলফা 01
ফেব্রুয়ারি 21, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha01
প্রকাশিত হয়েছে। সংস্করণ 1.3.0-ALPHA01 এর মধ্যে এই কমিট রয়েছে।
এপিআই পরিবর্তন
- অপ্রয়োজনীয় শব্দ 'উচিত' এড়াতে
MicrobenchmarkConfig
বুলিয়ান পরামিতিগুলির নামকরণ করা হয়েছে ( আইএ 8 এফ 100 , বি/303387299 ) - যোগ করা
BenchmarkRule.measureRepeatedOnMainThread
যাতে প্রধান থ্রেড বেঞ্চমার্কস (যেমন, দৃশ্যগুলি স্পর্শ করে বা ইউআইএস রচনা করে) বিশেষত সিআইয়ের বৃহত স্যুটগুলির সময় এএনআরএস ট্রিগার এড়াতে পারে। ( I5c86d ) -
FrameTimingGfxInfoMetric
যুক্ত করা হয়েছে,FrameTimingMetric
একটি পরীক্ষামূলক বিকল্প বাস্তবায়ন যা পরিমাপের সাথে সরাসরি প্ল্যাটফর্ম থেকে আসে, যা পারফেটো ট্রেস থেকে বের না করে সরাসরি প্ল্যাটফর্ম থেকে আসে। ( আই 457 সিবি , বি/322232828 ) - স্বতন্ত্র
warmUp
পুনরাবৃত্তির সময় একটি আর্ট প্রোফাইল ডাম্প করার ক্ষমতা যুক্ত করুন। ( I17923 ) -
TraceSectionMetric
এপিআইতে বেশ কয়েকটি পরিবর্তন:-
Mode.Min
,Mode.Max
যুক্ত করুন - মেট্রিক লেবেল হিসাবে বিভাগের নাম ওভাররাইডে লেবেল আর্গুমেন্ট যুক্ত করুন
- মেট্রিক অর্থ স্পষ্ট করতে আউটপুটে মোডের নাম যুক্ত করা হয়েছে
- সংমিশ্রণে ডিফল্ট পরিবর্তিত হয়েছে, যেহেতু এই মেট্রিকের বেশিরভাগ ব্যবহার বারবার ইভেন্টগুলির জন্য সিআই ব্যবহারের এই পরিবর্তনগুলি সম্পর্কে সচেতন হন, কারণ এটি বিচ্ছিন্নতা তৈরি করতে পারে বা পার্সিং ভাঙতে পারে। ( আইসি 1 ই 82 , বি/301892382 , বি/301955938 )
-
বাগ ফিক্স
- বেসলাইন প্রোফাইল গ্রেডল প্লাগইনটিতে উন্নত ত্রুটি বার্তা নির্দিষ্ট পরিচালিত ডিভাইস বিদ্যমান না থাকলে ( আইডিয়া 2 বি, বি/313803289 )
- এজিপি 8.3.0-আলফা 15 ( আই 1 ডি 2 এএফ , বি/313992099 ) এর আগে এএআর-তে লাইব্রেরি বেসলাইন প্রোফাইলগুলি অন্তর্ভুক্ত করার জন্য ঠিক করুন
- প্রজন্মের টাস্কের শেষে স্থির বেসলাইন এবং স্টার্টআপ প্রোফাইল আউটপুট ইউআরএল ( i802e5 , বি/313976958 )
-
java.lang.IllegalStateException: Failed to stop [ProcessPid(processName=perfetto, pid=...)]
( আই 8 ডিসি 7 ডি , বি/323601788 ) -
ProfileInstaller
ছাড়াই বেঞ্চমার্কিং অ্যাপ্লিকেশনগুলি 1.3 ছাড়াই ওয়ার্কআরাউন্ড ক্র্যাশগুলিতে শেডার ড্রপিং আচরণকে ওভাররাইড করার জন্য দুটি উপকরণ যুক্তি যুক্ত করুন:-
androidx.benchmark.dropShaders.enable=true/false
: সমস্ত শেডার ড্রপিং এড়িয়ে যেতে ব্যবহার করা যেতে পারে (এটিStartupMode.Cold
করা হয়েছে। কোল্ড লঞ্চগুলিতে করা সহ), যখন প্রোফাইলইনস্টালার 1.3 ব্যবহার করে না এমন বেঞ্চমার্কিং অ্যাপ্লিকেশনগুলি যখন ইএসপি -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: শেডারগুলি ফেলে দেওয়ার চেষ্টা করার সময় ব্যর্থতা সহ্য করতে ব্যবহার করা যেতে পারে, উদাহরণস্বরূপ যখন প্রোফাইলইনস্টেলার ছাড়াই বেঞ্চমার্কিং অ্যাপ্লিকেশনগুলি 1.3 ( i4f573 )
-
- কয়েক সেকেন্ডের চেয়ে বেশি সময় নেওয়ার প্রত্যাশা করা হলে ইউআই থ্রেডে পদ্ধতি ট্রেসিং এড়িয়ে যান এবং নিক্ষেপ করার সময় ক্লিনআপ পদ্ধতির চিহ্নগুলি। ( I6e768 )
- ফাইলগুলি লেখার সময় বা পোস্ট-প্রসেসিং ফাইলগুলি যখন অস্পষ্ট ক্র্যাশগুলি এড়াতে ফাইলের নামগুলি 200 টি বেশি হয় তখন নিক্ষেপ করুন। ( I4a5ab )
- ট্রেসের শুরু এবং শেষে অবিচ্ছিন্ন ফ্রেমগুলি একসাথে যুক্ত করা যেতে পারে এমন সমস্যাগুলি সমাধান করে, যা একক অত্যন্ত দীর্ঘ ফ্রেম হিসাবে ভুলভাবে রিপোর্ট করবে। ( I39353 , খ/322232828 )
- ব্যবহারকারীর বিল্ডগুলিতে আর্ট প্রোফাইলগুলি সাফ করার জন্য এপিআই 30-33 এ কোনও প্যাকেজ পুনরায় ইনস্টল করার সময়-এপিআই 30+
--skip verification
ব্যবহার করুন। এটি বাইপাস খেলতে সহায়তা করে এমন সতর্কতাগুলি রক্ষা করতে সহায়তা করে যা কিছু শ্রেণীর ডিভাইসে ব্যর্থতা সৃষ্টি করে। ( আইসি 9 ই 36 ) - সিস্টেম ইউআই বা লঞ্চারের মতো সিস্টেম অ্যাপ্লিকেশন না থাকলে অ্যাপ্লিকেশনগুলিকে মারতে
am force-stop
ব্যবহার করুন। ( I5e028 ) - ম্যাক্রোব্যাঞ্চমার্ক এখন একটি আর্ট প্রোফাইল ফ্লাশ করার জন্য লক্ষ্য অ্যাপ্লিকেশনটির জন্য
1 second
জন্য অপেক্ষা করে (আগে এটি500 ms
জন্য অপেক্ষা করেছিল)। ( I85a50 , খ/316082056 ) - ফ্রেমগুলি উত্পাদিত না হলে
FrameTimingMetric
ত্রুটি উন্নত করুন এবং সমস্যা নির্ণয়ের ক্ষেত্রে সহায়তা করার জন্য মেট্রিক পার্সিংয়ে ব্যর্থ হওয়ার সময় সর্বদা ট্রেস করার জন্য আউটপুট লিঙ্ক করুন। ( I956b9 ) -
FrameTimingMetric
স্থির ক্র্যাশ ফ্রেম আইডি পার্স করতে ব্যর্থ হয়, বিশেষত নির্দিষ্ট কিছু ইএম ডিভাইসে। ( আইএ 24 বিবিসি , বি/303823815 , বি/306235276 ) -
FrameMetrics
চেকগুলির স্বাচ্ছন্দ্যময় কঠোরতা এবং ত্রুটি বার্তাগুলিতে আরও বিশদ যুক্ত করেছে। ( Iadede )
সংস্করণ 1.2
সংস্করণ 1.2.4
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.2.4
প্রকাশিত হয়েছে। সংস্করণ 1.2.4 এ এই কমিটস রয়েছে।
বাগ ফিক্স
- বেসলাইন প্রোফাইল এসআরসিএসইটি ফিক্স করে বেঞ্চমার্ক ভেরিয়েন্টগুলিতে সেট আপ করা হচ্ছে না। এছাড়াও একটি বিজ্ঞপ্তি নির্ভরতা সৃষ্টি করে লাইব্রেরিতে
automaticGenerationDuringBuild
ঠিক করে। ( I28ab7 , খ/333024280 ) - সিস্টেম ইউআই বা লঞ্চারের মতো সিস্টেম অ্যাপ্লিকেশন না থাকলে অ্যাপ্লিকেশনগুলিকে মারতে
am force-stop
ব্যবহার করুন। এটিStartupMode.COLD
Fix প্রক্রিয়া কারণে কিল পুরোপুরি সফল হয় না। ( I5e028 )
সংস্করণ 1.2.3
24 জানুয়ারী, 2024
androidx.benchmark:benchmark-*:1.2.3
প্রকাশিত হয়েছে। সংস্করণ 1.2.3 এ এই কমিটস রয়েছে।
বাগ ফিক্স
- যখন এজিপি সংস্করণ 8.3.0 বা তার বেশি হয় তখন বেসলাইন প্রোফাইল গ্রেডল প্লাগইন থেকে ব্যতিক্রম সরানো।
- এজিপি 8.3.0-আলফা 15 এর আগে এএআর-তে লাইব্রেরি বেসলাইন প্রোফাইলগুলি অন্তর্ভুক্ত করার জন্য ঠিক করুন।
সংস্করণ 1.2.2
ডিসেম্বর 1, 2023
androidx.benchmark:benchmark-*:1.2.2
প্রকাশিত হয়েছে। সংস্করণ 1.2.2 এ এই কমিটস রয়েছে।
বেসলাইন প্রোফাইল
- এক্সিকিউশন লগগুলি স্থানীয় ফাইল ইউআরআই ( এওএসপি/2843918 , এওএসপি/28536665 , বি/313976958 ) হিসাবে বেসলাইন প্রোফাইল আউটপুট ফাইল পাথ প্রদর্শন করবে
সংস্করণ 1.2.1
15 নভেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.1
প্রকাশিত হয়েছে। সংস্করণ 1.2.1 এ এই কমিটস রয়েছে।
নতুন বৈশিষ্ট্য
- উন্নত ত্রুটি বার্তা যখন ব্যবহারকারী পরীক্ষার রূপগুলি অক্ষম করে ( বি/307478189 )
- টেস্ট রান ইন্টিগ্রেশন ( বি/309805233 ), ( বি/309116324 ) হিসাবে সমর্থন করার জন্য বৈশিষ্ট্য যুক্ত করা হয়েছে
সংস্করণ 1.2.0
18 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0
প্রকাশিত হয়েছে। সংস্করণ 1.2.0 এ এই কমিটস রয়েছে।
1.1.0 থেকে গুরুত্বপূর্ণ পরিবর্তন
বেসলাইন প্রোফাইল
- নতুন বেসলাইন প্রোফাইল গ্রেডল প্লাগইন স্বয়ংক্রিয়ভাবে ক্যাপচারিং এবং আপনার পরীক্ষায় বেসলাইন প্রোফাইলগুলি সহ ওয়ার্কফ্লো তৈরি করে।
-
BaselineProfileRule.collect
এখন স্থিতিশীল, পূর্ববর্তী পরীক্ষামূলকBaselineProfileRule.collectBaselineProfile
একটি প্রবাহিত এবং সরলীকৃত সংস্করণ।- কেবল
packageName
নির্দিষ্ট করুন এবং আপনার অ্যাপ্লিকেশনটি চালনা করুন
- কেবল
- বেসলাইন প্রোফাইলগুলি উত্পন্ন গ্রন্থাগারগুলির জন্য, আপনি এখন কোডে উত্পন্ন নিয়মগুলি ফিল্টার করতে পারেন (
BaselineProfileRule.collect
আর্গুমেন্ট), অথবা আরও সহজভাবে গ্রেড প্লাগইনে - সংশোধন করে
- অ্যান্ড্রয়েড ইউ+ এ স্থির বেসলাইন প্রোফাইল সংগ্রহ ( আইডি 1392 , বি/277645214 )
ম্যাক্রোব্যাঞ্চমার্ক
- সংকলন
- ম্যাক্রোব্যাঞ্চমার্ক এখন প্রতিটি সংকলনের জন্য সম্পূর্ণরূপে সংকলন অবস্থার পুরোপুরি পুনরায় সেট করে - এটি অ্যান্ড্রয়েড 14 এর আগে এপিকে পুনরায় ইনস্টল করা প্রয়োজন, সুতরাং অ্যান্ড্রয়েড 14+ এ বেঞ্চমার্কিংকে দৃ strongly ়ভাবে সুপারিশ করা হয় যদি আপনি যা পরিমাপ করা হচ্ছে তাতে রাষ্ট্রীয় (ব্যবহারকারী লগইনের মতো) বজায় রাখতে চান।
- আপনি অ্যাপ্লিকেশন সংকলনকে আলাদাভাবে নিয়ন্ত্রণ করে এবং
CompilationMode.Ignore()
বা ইনস্ট্রুমেন্টেশন আর্গুমেন্টের সাথে সংকলন এড়িয়ে যাওয়ার মাধ্যমেও এর চারপাশে কাজ করতে পারেন
উপকরণ যুক্তি
-
androidx.benchmark.dryRunMode.enable
ইনস্ট্রুমেন্টেশন আর্গুমেন্টের জন্য সমর্থন, (ইতিমধ্যে মাইক্রোব্যাঞ্চমার্কে উপলব্ধ) দ্রুত বৈধতা রানের জন্য (যেমন বেঞ্চমার্ক তৈরি করার সময়, বা প্রেসবিমিটে) -
androidx.benchmark.profiling.mode=StackSampling
এবংMethodTracing
জন্য সমর্থন। - রানটাইম ফিল্টারিং বেসলাইন প্রোফাইল বনাম ম্যাক্রোব্যাঞ্চমার্ক বিধি পরীক্ষার অনুমতি দেওয়ার জন্য
androidx.benchmark.enabledRules
যুক্ত করা হয়েছে - যুক্ত হওয়া
androidx.benchmark.perfettoSdkTracing.enable
ট্রেসিং-পারফিটো দিয়ে ট্রেসিং সক্ষম করার জন্য সক্ষম যুক্তি, যেমন কমপোজ রিকম্পজেশন ট্রেসিং। মনে রাখবেন যে যখনStartupMode.COLD
সাথে ব্যবহার করা হয়, তখন অ্যাপ স্টার্টআপের সময় ট্রেসিং লাইব্রেরি লোড এবং সক্ষম করা হওয়ায় সময়টি উল্লেখযোগ্যভাবে প্রভাবিত হবে।
-
প্রয়োজনীয়তা
- ম্যাক্রোব্যাঞ্চমার্কের এখন প্রোফাইল ক্যাপচার / রিসেট সক্ষম করতে এবং শেডার ক্যাশে ক্লিয়ারিং সক্ষম করতে টার্গেট অ্যাপ্লিকেশনটিতে
ProfileInstaller
1.3.0 বা তার বেশি প্রয়োজন।
- ম্যাক্রোব্যাঞ্চমার্কের এখন প্রোফাইল ক্যাপচার / রিসেট সক্ষম করতে এবং শেডার ক্যাশে ক্লিয়ারিং সক্ষম করতে টার্গেট অ্যাপ্লিকেশনটিতে
নতুন পরীক্ষামূলক মেট্রিক এপিআই
- যুক্ত পরীক্ষামূলক
TraceSectionMetric
যুক্ত করা হয়েছে, যা আপনার অ্যাপ্লিকেশনটিতেtrace("") {}
blocks ব্লকগুলি থেকে সহজ সময় বের করার অনুমতি দেয় বা পারফেটোTraceProcessor
সম্পূর্ণ ক্যোয়ারী সক্ষমতা অর্জনের জন্য ট্রেসমেট্রিক । - পাওয়ার ব্যবহারের তথ্য ক্যাপচার করতে পরীক্ষামূলক
PowerMetric
যুক্ত করা হয়েছে - পৃষ্ঠার ত্রুটিগুলি গণনা করতে পরীক্ষামূলক
MemoryCountersMetric
যুক্ত করা হয়েছে - যুক্ত পরীক্ষামূলক
PerfettoTraceProcessor
এপিআই যুক্ত করা হয়েছে, যা সিস্টেমের চিহ্নগুলি থেকে মেট্রিকগুলি বের করার জন্য অভ্যন্তরীণভাবে ব্যবহৃত হয় (ওরফে পারফেটো ট্রেস)
- যুক্ত পরীক্ষামূলক
সংশোধন করে
- একাধিক এপিকে (যেমন অ্যাপ বান্ডিল থেকে) ইনস্টল করা একটি অ্যাপ্লিকেশন থেকে প্রোফাইলগুলি ইনস্টল বা আহরণ করার সময় স্থির ক্র্যাশগুলি।
- ফিক্সড
FrameTimingMetric
অসামঞ্জস্য ফ্রেম আইডিগুলির সাথে ফ্রেমগুলি উপেক্ষা করে (সাধারণত, এপিআই 31+ এ রিপল চলাকালীন ফ্রেম) ( আই 747 ডি 2 , বি/279088460 ) - ট্রেসগুলিতে স্থির পার্সিং ত্রুটিগুলি> 64 এমবি ( আইইএফ 831 , বি/269949822 )
- যখন ডিভাইস (বিশেষত এমুলেটর) ওএস চিত্রটি ট্রেসিং বা সংকলনের জন্য সঠিকভাবে কনফিগার করা হয়নি তখন স্পষ্ট ত্রুটিগুলি
- ব্যাটারি ছাড়াই ডিভাইসের জন্য ব্যাটারি স্তর চেক এড়িয়ে যান (মাইক্রো এবং ম্যাক্রো)
- অবৈধ আউটপুট ডিরেক্টরিগুলির জন্য আরও স্পষ্ট ত্রুটি সহ এবং নিরাপদ ডিফল্টগুলির সাথে উন্নত ফাইল আউটপুট উন্নত
- ধারাবাহিকভাবে শেডার ক্যাশে ফেলে দিয়ে
StartupMode.COLD
উন্নত স্থায়িত্ব (MacrobenchmarkScope.dropShaderCache
এর মাধ্যমেও উন্মুক্ত) -
startActivityAndWait
জন্য স্থির লিনব্যাক ফ্যালব্যাক।
মাইক্রোব্যাঞ্চমার্ক
- বৈশিষ্ট্য
- অন্যান্য মেট্রিকের পরে প্রোফাইলিং একটি পৃথক পর্যায়ে স্থানান্তরিত করা হয়েছিল, সুতরাং একটি পরীক্ষার রান সঠিক সময় এবং প্রোফাইলিং ফলাফল উভয়ই প্রদর্শন করতে পারে।
- পরীক্ষামূলক API
- কাস্টম মেট্রিকগুলি সংজ্ঞায়িত করার জন্য এবং ট্রেসিং এবং প্রোফাইলিং কনফিগার করার জন্য পরীক্ষামূলক
MicrobenchmarkConfig
এপিআই যুক্ত করা হয়েছে। পদ্ধতির ট্রেসগুলি ক্যাপচার করতে বা ট্রেসপয়েন্টগুলি ক্যাপচার করতে ব্যবহার করা যেতে পারে (তবে ওভারহেড ট্রেসিং সম্পর্কে সচেতন হতে হবে)। - জুনিট ছাড়াই
BenchmarkRule
থেকে পৃথকভাবেBenchmarkState
নিয়ন্ত্রণের জন্য পরীক্ষামূলক এপিআই যুক্ত করা হয়েছে - বেঞ্চমার্ক এপিআই থেকে পৃথক কাস্টম কনফিগারেশন সহ পারফেটো ট্রেস ক্যাপচার সক্ষম করতে পরীক্ষামূলক
PerfettoTrace
রেকর্ড যুক্ত করা হয়েছে।
- কাস্টম মেট্রিকগুলি সংজ্ঞায়িত করার জন্য এবং ট্রেসিং এবং প্রোফাইলিং কনফিগার করার জন্য পরীক্ষামূলক
- সংশোধন করে
- অ্যান্ড্রয়েড স্টুডিও বেঞ্চমার্ক আউটপুটে শীর্ষস্থানীয় হোয়াইটস্পেসগুলি নিখোঁজ।
- সমস্যাটি সমাধান করুন যেখানে সতর্কতাগুলি অ্যান্ড্রয়েড স্টুডিও বেঞ্চমার্ক আউটপুটে মুদ্রণ করতে ব্যর্থ হতে পারে।
- অ্যান্ড্রয়েড 13 (এপিআই 33) এবং উচ্চতর উপর স্থির
SampledProfiling
ক্র্যাশ। -
IsolationActivity
এবং পারফেটো ট্রেসিং (পুরানো ওএস সংস্করণগুলিতে 10x দ্রুত শুকনো রান মোড পর্যন্ত) এড়িয়ে যাওয়া দ্বারাdryRunMode
ব্যাপকভাবে উন্নত পারফরম্যান্স।
সংস্করণ 1.2.0-আরসি 02
6 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc02
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আরসি 02 এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
-
BaselineProfile
প্লাগইন ফাইল অনুলিপি করার জন্য আর বেঞ্চমার্ক ফাইল আউটপুট ঠিক করুন। ফাইলগুলি তৈরি করা হয়েছিল এবং ডিভাইসটি অনুলিপি করা হয়েছিল, তবে এর নামকরণ করা হয়েছিল যে গ্রেডল প্লাগইন সেগুলি দেখতে পাবে না। ( আই 8 ডিবিসিসি , বি/303034735 , বি/2964533339 ) - ম্যাক্রোব্যাঞ্চমার্ক মডিউল থেকে লক্ষ্য অ্যাপ্লিকেশনটিতে ইনজেকশনের সময় স্পষ্ট
tracing-perfetto
লোডিং ত্রুটি বার্তাগুলি।
সংস্করণ 1.2.0-আরসি 01
20 সেপ্টেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc01
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আরসি 01 এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- একটি ব্যতিক্রম (প্রতিকারের নির্দেশাবলী সহ) এখন নিক্ষেপ করা হয় যখন পারফেটো এসডিকে ট্রেসিং কোনও বেঞ্চমার্কে শুরু করতে ব্যর্থ হয়। ( I6c878 , খ/286228781 )
- আর্ট পদ্ধতি ট্রেস রূপান্তর করার সময় ওম ক্র্যাশটি ঠিক করুন -> পারফেটো ফর্ম্যাট। ( আই 106 বিডি , বি/296905344 )
- (ম্যাক্রোব্যাঞ্চমার্ক) স্টুডিও টেস্ট আউটপুটে লিঙ্ক করা হলে এবং ডিভাইস/হোস্টে অনন্য হওয়ার জন্য ফাইলের নামগুলি ট্রেসিং ট্রেসিং ট্রেসিং লেবেলটি স্পষ্ট করে দেওয়া হয়েছে, সুতরাং একাধিক বেঞ্চমার্ক চালানো হলে সেগুলি ওভাররাইট করা হবে না। ( I08e65 , খ/285912360 )
- বেসলাইন প্রোফাইল ক্যাপচার করার সময় ডিভাইসটি জাগ্রত রয়েছে তা নিশ্চিত করে। ( I503fc )
সংস্করণ 1.2.0-BETA05
30 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta05
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-BETA05 এর মধ্যে এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- বেসলাইন প্রোফাইল গ্রেডল প্লাগইন এখন অ্যান্ড্রয়েড গ্রেডল প্লাগইন 8.3 সমর্থন করে। ( এওএসপি/2715214 )
সংস্করণ 1.2.0-BETA04
23 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta04
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-BETA04 এর মধ্যে এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- বেসলাইন প্রোফাইল গ্রেডল প্লাগইন এখন অ্যান্ড্রয়েড গ্রেডল প্লাগইন 8.3 সমর্থন করে। ( এওএসপি/2715214 )
বাগ ফিক্স
- আউটপুট ফাইলের নামগুলি আরও স্যানিটাইজ করে, আউটপুট ফাইলের নামগুলিতে '=' এবং ':' এড়িয়ে যাওয়া ফাইলগুলি (বিশেষত প্যারামিটারাইজড পরীক্ষাগুলি থেকে) লেখার / সরানো এবং টানতে ব্যর্থতাগুলি সমাধান করুন। ( I759d8 )
সংস্করণ 1.2.0-BETA03
9 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta03
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-BETA03 এ এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
- ফিল্টার
TraceSectionMetric
কেবলমাত্র লক্ষ্য প্যাকেজে ডিফল্টরূপে যুক্ত করা হয়েছে ( আইএ 219 বি, বি/292208786 )
বাগ ফিক্স
-
fullTracing.enable
instractation আর্গুমেন্টের নামকরণperfettoSdkTracing.enable
fullTracing.enable
ফ্যালব্যাক হিসাবে কাজ চালিয়ে যাবে। ( I7cc00 ) - বেঞ্চমার্ক লাইব্রেরি অভ্যন্তরীণ ট্রেসপয়েন্টগুলি (মাইক্রোব্যাঞ্চমার্ক লুপ/ফেজ ট্রেসিং সহ) এখন স্টুডিও সিস্টেম ট্রেস ভিউয়ারে প্রদর্শিত হবে এবং পারফেটোতে সঠিক প্রক্রিয়াটির অধীনে বাসা বাঁধবে। ( I6b2e7 , বি/293510459 )
- এপিআই 31+ এ ম্যাক্রোব্যাঞ্চমার্কটি-অ-প্রফিলেবল ত্রুটি অপসারণ করা হয়েছে এবং ইঞ্জিন/ইউজারডিবাগ রুটযুক্ত ডিভাইসগুলিতে প্রোফাইলযোগ্য চেক এড়িয়ে যান। ( I2abac , খ/291722507 )
- ডেক্স লেআউট অপ্টিমাইজেশন ব্যবহার করার সময়, স্টার্টআপ প্রোফাইল বিধিগুলি এখন বেসলাইন প্রোফাইল বিধি হিসাবেও বিবেচিত হয়। ( এওএসপি/2684246 , বি/293889189 )
সংস্করণ 1.2.0-BETA02
জুলাই 26, 2023
androidx.benchmark:benchmark-*:1.2.0-beta02
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-BETA02 এ এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
- মাইক্রোব্যাঞ্চ কাস্টম মেট্রিক এবং কনফিগারেশনের জন্য পরীক্ষামূলক এপিআই যুক্ত করা হয়েছে (যেমন প্রোফাইলার এবং ট্রেসিং)। ( I86101 , বি/291820856 )
বাগ ফিক্স
- ম্যাক্রোব্যাঞ্চে ত্রুটি প্রতিবেদন ত্রুটি যখন ট্রেসিংয়ের জন্য ওএস ভুল কনফিগার করা হয়, যেমনটি সম্প্রতি এপিআই 26/28 এআরএম 64 এমুলেটরগুলিতে স্থির করা হয়েছিল। ( I0a328 , খ/282191686 )
- এমুলেটর আপডেট করার পরামর্শ দেওয়ার জন্য সংকলন পুনরায় সেট করতে ব্যর্থতায় বিশদ যুক্ত করা হয়েছে, কারণ কিছু এমুলেটর সম্প্রতি এই সমস্যাটি স্থির করেছে। ( I8c815 , খ/282191686 )
-
androidx.test.uiautomator:uiautomator:2.2.0
implementation
নির্ভরতার পরিবর্তে একটিapi
। ( I1981e )
সংস্করণ 1.2.0-BETA01
18 জুলাই, 2023
androidx.benchmark:benchmark-*:1.2.0-beta01
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-BETA01 এর মধ্যে এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- স্টুডিওতে কখনও কখনও বেঞ্চমার্ক আউটপুটে দমন করা সতর্কতাগুলি ঠিক করুন এবং স্টুডিওতে প্রদর্শিত না হওয়া বেঞ্চমার্ক আউটপুট থেকে ওয়ার্কআউটআউন্ড লিডিং হোয়াইটস্পেসগুলি ( আইএ 61 ডি 0 , বি/227205461 , বি/286306579 , বি/285912360 )
-
FrameTimingMetric
জন্য স্থির মন্তব্য। সাবমেট্রিকের নামframeDurationCpuMs
। ( আইবি 097 এফ , বি/288830934 )।
সংস্করণ 1.2.0-আলফা 16
জুন 21, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha16
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA16 এর মধ্যে এই কমিট রয়েছে।
এপিআই পরিবর্তন
-
BaselineProfileRule.collectBaselineProfile()
এপিআই নামকরণ করা হয়েছেBaselineProfileRule.collect()
এ নামকরণ করা হয়েছে। ( I4b665 )
বাগ ফিক্স
-
androidx.benchmark.profiling.mode = MethodTracing
এর জন্য ম্যাক্রোব্যাঞ্চমার্ক সমর্থন সমর্থন। ( I7ad37 , খ/285912360 ) - মাইক্রোব্যাঞ্চমার্ক প্রোফাইলিং একটি পৃথক পর্যায়ে চলে গেছে, সুতরাং এটি প্রতিস্থাপনের পরিবর্তে পরিমাপের পরে ক্রম অনুসারে ঘটে।
MethodTracing
ট্রেস বিভাগগুলিও এখন উপস্থিত থাকলে ক্যাপচারড পারফেটো ট্রেসে অন্তর্ভুক্ত রয়েছে। ( I9f657 , খ/285014599 ) -
Mode.Sum
সহTraceSectionMetric
গণনা পরিমাপ যুক্ত করুন। ( আইসি 121 এ , বি/264398606 )
সংস্করণ 1.2.0-আলফা 15
7 জুন, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha15
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আলফা 15 এ এই কমিটস রয়েছে।
নতুন বৈশিষ্ট্য
- লক্ষ্য প্রয়োগের মেমরি ব্যবহার ট্র্যাক করার জন্য পরীক্ষামূলক
MemoryUsageMetric
যুক্ত করা হয়েছে। ( I56453 , খ/133147125 , বি/281749311 ) -
PerfettoTrace.record
( আইএফ 9 ডি 75 , বি/280460183 ) সহ সম্পূর্ণ কাস্টম পারফেটো কনফিগারেশনগুলির জন্য সমর্থন যুক্ত করুন - বেসলাইন প্রোফাইল প্রজন্ম এড়িয়ে যেতে সম্পত্তি যুক্ত করা হয়েছে। ব্যবহার
./gradlew assemble -Pandroidx.baselineprofile.skipgeneration
( I37fda , খ/283447020 )
এপিআই পরিবর্তন
-
collectBaselineProfile
এপিআই সর্বদা স্থিতিশীল বেসলাইন প্রোফাইল তৈরি করে।collectStableBaselineProfile
এপিআই সরানো হয়েছে এবং পরিবর্তেcollectBaselineProfile
ব্যবহার করা উচিত। ( I17262 , খ/281078707 ) -
BaselineProfileRule
filterPredicate
আরগকে নন-নুলে পরিবর্তিত হয়েছে, সমতুল্য ডিফল্ট মান সহ যাতে ডিফল্ট ফিল্টার আচরণ ডক্সে আরও স্পষ্ট হয়। ( I3816e )
বাগ ফিক্স
- পারফরম্যান্সকে উল্লেখযোগ্যভাবে উন্নত করতে
dryRunMode
IsolationActivity
এবং পারফেটো ট্রেসিং অক্ষম করুন, কারণ এগুলি রানটাইমের সংখ্যাগরিষ্ঠ ছিল। ( Ie4f7d ) - ইনস্ট্রুমেন্টেশন টেস্ট আর্গুমেন্টস
androidx.benchmark.profiling.mode=StackSampling
এবংandroidx.benchmark.profiling.sampleFrequency
ব্যবহার করে ম্যাক্রোব্যাঞ্চমার্কগুলিতে কল স্ট্যাক স্যাম্পলিংয়ের জন্য সমর্থন। ( আই 1 ডি 13 বি, বি/282188489 ) - অ্যান্ড্রয়েড ইউ (এপিআই 34), পাশাপাশি এমুলেটরগুলিতে শেডারগুলি ফেলে দেওয়ার সময় ফিক্স ক্র্যাশগুলি। ( I031ca , খ/274314544 )
সংস্করণ 1.2.0-আলফা 14
3 মে, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha14
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আলফা 14 এ এই কমিটস রয়েছে।
বাগ ফিক্স
- বেমানান ফ্রেম আইডি সহ ফ্রেমগুলি উপেক্ষা করে
FrameTimingMetric
ঠিক করুন। এটি সাম্প্রতিক প্ল্যাটফর্ম সংস্করণগুলিতে (এপিআই 31+) কিছু অ্যানিমেশনগুলির কারণ হতে পারে যখনRenderThread
অ্যানিমেটিং ছিল (যেমন একটি রিপল চলাকালীন)। ( I747d2 , বি/279088460 ) - ফিক্সড ট্রেস প্রসেসর 64 এমবি এর চেয়ে বড় ট্রেসগুলির জন্য পার্সিং। ( আইইএফ 831 , বি/269949822 )
- অ্যান্ড্রয়েডে স্থির বেসলাইন প্রোফাইল প্রজন্ম ইউ ব্যর্থ হচ্ছে কারণ
pm dump-profiles
কমান্ডের বিভিন্ন আউটপুট। ( আইডি 1392 , বি/277645214 ) - স্ট্রিংগুলি সঠিকভাবে তুলনা করতে জিপিইউ ক্লক লকিং স্ক্রিপ্টটি ঠিক করুন ( i53e54 , বি/213935715 )
সংস্করণ 1.2.0-আলফা 13
5 এপ্রিল, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha13
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আলফা 13 এ এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
- আসন্ন স্টার্টআপ প্রোফাইল বৈশিষ্ট্যটিকে সমর্থন করার জন্য বেসলাইন প্রোফাইল তৈরি করার সময় প্রোফাইল টাইপ প্যারামিটার যুক্ত করা হয়েছে ( আইই 20 ডি 7 , বি/275093123 )
- পারফেটো ট্রেসের সামগ্রীর ভিত্তিতে সম্পূর্ণ কাস্টম মেট্রিকগুলি সংজ্ঞায়িত করার জন্য নতুন পরীক্ষামূলক
TraceMetric
এপিআই যুক্ত করা হয়েছে। ( I4ce31 , খ/219851406 ) - একটি বেঞ্চমার্কের সময় পৃষ্ঠা ত্রুটিগুলির সংখ্যা নির্ধারণ করতে একটি পরীক্ষামূলক মেট্রিক যুক্ত করুন। ( I48db0 )
সংস্করণ 1.2.0-আলফা 12
22 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha12
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আলফা 12 এ এই কমিটগুলি রয়েছে।
নতুন বৈশিষ্ট্য
- নতুন বেসলাইন প্রোফাইল গ্রেডল প্লাগইনটি আলফা সংস্করণে প্রকাশিত হয়েছে, এটি একটি বেসলাইন প্রোফাইল তৈরি করা এবং বিকাশকারী কর্মপ্রবাহকে সহজতর করে তোলে।
এপিআই পরিবর্তন
- এপিআই 21 এবং 22 এ পারফেটো ট্রেসিং সমর্থন সরানো হয়েছে, যার মধ্যে মাইক্রোব্যাঞ্চমার্ক এবং পরীক্ষামূলক
PerfettoTrace
এপিআই উভয়ই অন্তর্ভুক্ত রয়েছে। এই সংস্করণটির আগে,UiAutomation
সংযোগগুলি কিছু ডিভাইসে অবিশ্বাস্য ছিল। ( I78e8c ) - পার্সিং ট্রেস সামগ্রী সক্ষম করতে
PerfettoTraceProcessor
জন্য পাবলিক পরীক্ষামূলক এপিআই যুক্ত করা হয়েছে। এটি পারফেটো ট্রেস ডেটার উপর ভিত্তি করে সম্পূর্ণ কাস্টম মেট্রিকগুলির দিকে এক ধাপ। ( I2659e , বি/219851406 )
সংস্করণ 1.2.0-আলফা 11
8 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha11
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আলফা 11 এ এই কমিটস রয়েছে।
বাগ ফিক্স
- একাধিক এপিকে সহ একটি অ্যাপ্লিকেশন বান্ডিল থেকে প্রোফাইলগুলি পুনরায় ইনস্টল করা বা আহরণ করার সময়
MacrobenchmarkRule
এবংBaselineProfileRule
স্থির ক্র্যাশগুলি। ( I0d8c8 , বি/270587281 )
সংস্করণ 1.2.0-আলফা 10
22 ফেব্রুয়ারি, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha10
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-আলফা 10 এ এই কমিটগুলি রয়েছে।
নতুন বৈশিষ্ট্য
- অ্যান্ড্রয়েড 14+ এ, ম্যাক্রোব্যাঞ্চমার্ক আর একটি নতুন প্ল্যাটফর্ম বৈশিষ্ট্যের জন্য ধন্যবাদ সংকলন অবস্থার পুনরায় সেট করতে লক্ষ্য অ্যাপ্লিকেশনগুলিকে পুনরায় ইনস্টল করে না। পূর্বে একটি মূল ডিভাইস থাকা বা প্রতিটি বেঞ্চমার্ক চালানোর আগে সমস্ত অ্যাপ্লিকেশন স্টেট (যেমন ব্যবহারকারী লগইন) অপসারণ করা দরকার ছিল। ( I9b08c , খ/249143766 )
বাগ ফিক্স
- সংকলন স্কিপিংয়ের কারণে খালি প্রোফাইলের সাথে আর ক্র্যাশ করতে
DryRunMode
ঠিক করুন। পরিবর্তে, এটি একটি একক পুনরাবৃত্তি চালায় এবং কিছু ক্যাপচার হয়েছে তা নিশ্চিত করার জন্য প্রোফাইলটি বের করে। ( I2f05d , খ/266403227 ) - পুরানো এপিআই স্তরে পাওয়ারস্ট্যাটস উপস্থিতি পরীক্ষা করার সময়
PowerMetric
ক্র্যাশটি ঠিক করুন। ( 5FAAF9 , খ/268253898 )
সংস্করণ 1.2.0-আলফা 09
11 জানুয়ারী, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha09
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA09 এ এই কমিটস রয়েছে।
বাগ ফিক্স
- সমস্ত মানদণ্ড / বেসলাইন প্রোফাইল প্রজন্মকে অক্ষম করতে
androidx.benchmark.enabledRules
ইন্সট্রুমেন্টেশন আরগেNone
পাস করতে সক্ষম নয়। ( আই 3 ডি 7 এফডি , বি/258671856 ) - অ্যাপ্লিকেশন মডিউলগুলিতে
PerfettoTrace
ক্যাপচারটি ঠিক করুন (অর্থাত্ অ-স্ব-ইন্সট্রুমেন্টিং টেস্ট এপিকস) ( আই 12 সিএফসি ) - স্টুডিও আউটপুটে স্থির বেসলাইন প্রোফাইল এডিবি টান আর্গুমেন্ট অর্ডার ( আই 958 ডি 1 , বি/261781624 )
- আর্ম এমুলেটর এপিআই 33 এখন ম্যাক্রোব্যাঞ্চমার্ক চালানোর চেষ্টা করার সময় সঠিকভাবে স্বীকৃত এবং সতর্কতাটি সঠিকভাবে মুদ্রণ করবে। ( 69133 বি, বি/262209591 )
- ম্যাক্রোব্যাঞ্চমার্কে ব্যাটারি ছাড়াই ডিভাইসগুলিতে ব্যাটারি স্তর চেক করুন ( ফে 4114 , বি/232448937 )
সংস্করণ 1.2.0-আলফা 08
7 ডিসেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha08
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA08 এ এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
- পরীক্ষার আচরণ এবং কর্মক্ষমতা পরিদর্শন করতে পরীক্ষার অংশ হিসাবে পারফেটো ট্রেসগুলি (সিস্টেম ট্রেস হিসাবেও পরিচিত) ক্যাপচার করতে পরীক্ষামূলক নতুন এপিআইএস
PerfettoTrace.record {}
এবংPerfettoTraceRule
যুক্ত করা হয়েছে। ( I3ba16 ) -
BaselineProfileRule
এখন প্যাকেজ উপসর্গগুলির তালিকার পরিবর্তে একটি ফিল্টার প্রেডিকেট গ্রহণ করে। এটি ফিল্টারিংয়ের উপর পরীক্ষাটি সম্পূর্ণ নিয়ন্ত্রণ দেয়। ( I93240 ) - একটি পরীক্ষামূলক এপিআই
BaselineProfileRule.collectStableBaselineProfile
যুক্ত করুন oll ( I923f3 ) -
BaselineProfileRule
ব্যবহার করে বেসলাইন প্রোফাইলগুলি তৈরি করার সময় একটি আউটপুট ফাইলের নাম উপসর্গ নির্দিষ্ট করার ক্ষমতা যুক্ত করুন। ( I7b59f , খ/260318655 )
বাগ ফিক্স
- ফাইল আউটপুট লেখার সুরক্ষা উন্নত করুন, যা আউটপুট ফাইলগুলিকে নিঃশব্দে লিখিত / সংযুক্ত না করা থেকে বিরত রাখতে হবে, বিশেষত এপিআই 21/22 এ। ( আইএফ 8 সি 44 , বি/227510293 )
- ফাইলটি সঠিকভাবে তৈরি করতে এবং স্থাপন করতে
simpleperf
ট্রেস আউটপুট ঠিক করুন। এটি আরও সাধারণভাবে সমস্যাগুলি ঠিক করা উচিত যেখানে কোনও ফাইল ব্যর্থভাবে গ্রেড দ্বারা টানা হয়। ( আই 12 এ 1 সি , বি/259424099 ) - প্রোফাইলইনস্টলার ত্রুটি বার্তা প্রিন্ট করা উন্নত করুন যখন প্রোফাইলইনস্টলার খুব পুরানো হয়। এটি এখন আপনাকে এপিআই 31 -এ বেসলাইন প্রোফাইলগুলি পরিমাপের জন্য প্রোফাইলইনস্টলার সংস্করণ (1.2.1) আপডেট করতে বলে, এটি সমর্থিত নয় বলে পরিবর্তে। ( আইএ 517 এফ , বি/253519888 )
- বেশ কয়েকটি শেল কমান্ড ব্যর্থতা ওনারার বার্তা প্রিন্ট করুন এপিআই <= 23, ব্যর্থ পারফেটো ক্যাপচার বাইনারি সেটআপ এবং ট্রেস ক্যাপচার ব্যর্থতা সহ ( আইবি 6 বি 87, বি/258863685 )
- সময়ের সাথে সাথে পরিবর্তিত হওয়ার সাথে সাথে পরিবর্তনের সংখ্যা হ্রাস করতে স্বয়ংক্রিয়ভাবে উত্পন্ন প্রোফাইল বিধিগুলি বাছাই করুন (উত্স নিয়ন্ত্রণে প্রোফাইল নিয়মগুলি পরীক্ষা করার সময়)। ( Ie2509 )
- অ্যান্ড্রয়েড 13 (এপিআই 33) এর নীচে আনরোটেড বিল্ডগুলিতে স্থির ক্র্যাশটি
Expected no stderr from echo 3 > /proc/sys/vm/drop_caches
( আই 6 সি 245 , বি/259508183 ) থেকে কোনও স্টেরার আশা করা যায় না
জ্ঞাত সমস্যাগুলি - MacrobenchmarkScope.dropShaderCache()
প্রোফাইলইনস্টলার ম্যানিফেস্টে অনুপস্থিত সম্প্রচার রেজিস্ট্রিটির কারণে ক্র্যাশ হতে পারে, যা এখনও প্রকাশিত হয়নি। ( আই 5 সি 728 , বি/258619948 ) profileinstaller:1.3.0-alpha02
, আপনার অ্যাপ্লিকেশনটির (আপনার বেঞ্চমার্কের নয়) অ্যান্ড্রয়েডম্যানিফেস্ট.এক্সএমএলগুলিতে নিম্নলিখিতগুলি যুক্ত করুন:
<!-- workaround bug in profileinstaller 1.3.0-alpha02, remove when updating to alpha03+ -->
<receiver
android:name="androidx.profileinstaller.ProfileInstallReceiver"
android:permission="android.permission.DUMP"
android:exported="true">
<intent-filter>
<action android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
</intent-filter>
</receiver>
সংস্করণ 1.2.0-Alpha07
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha07
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA07 এর মধ্যে এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
- ম্যাক্রোব্যাঞ্চমার্কগুলিতে শক্তি এবং শক্তি পরিমাপের জন্য
PowerMetric
এপিআই যুক্ত করে। ( Ife601 , খ/220183779 ) - ফিক্সড
MacrobenchmarkScope.dropShaderCache()
আসলে শেডার ক্যাশে ফেলে দিতে। এটিStartupMode.COLD
বেঞ্চমার্কগুলি থেকে প্রায় 20 মিমি শব্দগুলি সরিয়ে দেয়, কারণ শেডারগুলি এখন ধারাবাহিকভাবে প্রতিটি পুনরাবৃত্তি সাফ করে দেয়। পূর্বে, ওয়ার্মআপ পুনরাবৃত্তি ব্যবহার করেPartial
সংকলনটি ভুলভাবে দ্রুত সংখ্যার প্রতিবেদন করবে, কারণ ওয়ার্মআপের সময় শেডার ক্যাচিং হওয়ার সম্ভাবনা বেশি ছিল। এই ফিক্সের জন্য হয় একটি মূলযুক্ত ডিভাইস, বাprofileinstaller:1.3.0-alpha02
।ProfileInstaller
লাইব্রেরির এপিআই পরিবর্তনের জন্য, দয়া করে প্রোফাইলইনস্টলার 1.30-আলফা 02 পৃষ্ঠাটি দেখুন। ( আইএ 5171 , বি/231455742 ) - একই লেবেল সহ একাধিক ট্রেস বিভাগে ব্যয় করা মোট সময়ের পরিমাপের অনুমতি দিয়ে
TraceSectionMode("label", Mode.Sum)
যুক্ত করা হয়েছে। উদাহরণস্বরূপ,TraceSectionMetric("inflate", Mode.Sum)
মুদ্রাস্ফীতিতে ব্যয় করা ম্যাক্রোব্যাঞ্চমার্কে মোট সময়ের জন্য একটি মেট্রিকinflateMs
প্রতিবেদন করবে। এছাড়াও এপিআই 29 প্রয়োজনীয়তা সরানো হয়েছে, কারণTraceSectionMetric
androidx.tracing.Trace
সাথে একসাথে কাজ করে যা লক্ষ্য অ্যাপের মধ্যেforceEnableAppTracing
ব্যবহার সহ এপিআই স্তরগুলিতে ফিরে আসে। ( আইডি 7 বি 68 , বি/231455742 )
বাগ ফিক্স
- সমস্ত আউটপুট/ত্রুটিগুলি বৈধ করে সমস্ত অভ্যন্তরীণ শেল কমান্ডের উন্নত সুরক্ষা। ( I5984d , খ/255402908 , বি/253094958 )
- বেসলাইন প্রোফাইল
adb pull
কমান্ডে ডিভাইসটি নির্দিষ্ট করুন, যাতে একাধিক ডিভাইস সংযুক্ত থাকলে (এক এমুলেটর পর্যন্ত) ( আই 6AC6C , বি/2233359380 ) যদি পুল কমান্ডটি কেবল অনুলিপি করা যায় - যদি ম্যাক্রোব্যাঞ্চমার্ক টেস্ট এপিকে স্ব-ইন্সট্রুমেন্টিং হিসাবে সেট আপ না করা হয় তবে ত্রুটি যুক্ত করুন। এই ত্রুটিটি লক্ষ্য অ্যাপের প্রক্রিয়াটির মধ্যে থেকে ম্যাক্রোব্যাঞ্চমার্কিংকে বাধা দেয়। প্রক্রিয়াধীন, ম্যাক্রোব্যাঞ্চ অ্যাপ্লিকেশনটি সংকলন/হত্যা/ঠান্ডা শুরু করতে বা তার নিজস্ব অনুমতিগুলি নিয়ন্ত্রণ করতে সক্ষম হবে না ( আই 4279 বি )
-
measureRepeated()
এ একটি সমস্যা স্থির করে যেখানেStartupMode.COLD
setupBlock
পরে লক্ষ্য প্রক্রিয়াটিকে হত্যা করবে না। এখন অ্যাপ্লিকেশনটির সাথে ইন্টারঅ্যাক্ট করাsetupBlock
অ্যাপ প্রক্রিয়াটি চলবে না এবং একটি অবৈধ ঠান্ডা শুরু পরিমাপ করবে না। ( I8ebb7 )
সংস্করণ 1.2.0-আলফা 06
24 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha06
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA06 এর মধ্যে এই কমিট রয়েছে।
এপিআই পরিবর্তন
-
BaselineProfileRule
আর অ্যান্ড্রয়েড 13 (এপিআই 33) এর মূলের প্রয়োজন হয় না এবং এটি আর পরীক্ষামূলক নয়। ( আই 0 এ 7 ডি , বি/250083467 , বি/253094958 )- এই পরিবর্তনটি কীভাবে কোনও অ্যাপ্লিকেশন থেকে প্রোফাইলগুলি আনরোটেড ডিভাইসে ডিস্কে ফ্লাশ করা হয় তাও সংশোধন করে তবে লক্ষ্য অ্যাপের প্রোফাইল ইনস্টলার নির্ভরতা আপডেট করার প্রয়োজন।
-
BaselineProfileRule
বাCompilationMode.Partial(warmupIterations)
একটি আনরোটেড ডিভাইসে ব্যবহার করতে, আপনাকে অবশ্যইandroidx.profileinstaller.profileinstaller:1.3.0-alpha01
ব্যবহার করতে আপনার লক্ষ্য অ্যাপটি আপডেট করতে হবে। এটি ডিস্কে প্রোফাইলটি সঠিকভাবে ফ্লাশ করতে সক্ষম করে, যাতে এটি সংকলন/নিষ্কাশন করা যায়।
বাগ ফিক্স
- এপিআই 33+ এ
SampledProfiling
ক্র্যাশ ফিক্স। ( I40743 , খ/236109374 )
সংস্করণ 1.2.0-আলফা 05
5 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha05
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA05 এর মধ্যে এই কমিট রয়েছে।
বাগ ফিক্স
- স্টুডিও সিস্টেমে ফ্রেম ব্রেকডাউন ফিক্স করুন বেঞ্চমার্ক ক্যাপচারিত ট্রেসগুলির জন্য ভিউয়ার ট্রেস ভিউয়ার ( আই 3 এফ 3 এএ , বি/239677443 )
-
FrameTimingMetric
সঠিকFrameOverrun
29 এর পরিবর্তে এপিআই 31 প্রয়োজন হিসাবে তালিকাভুক্ত করতে ( i716dd , খ/220702554 ) -
BaselineProfileRule
পুনরাবৃত্তি সেট করুন এবং টার্গেট প্যাকেজটি ইনস্টল না করা থাকলে (ম্যাক্রোব্যাঞ্চমার্ক্রুলের জন্য ইতিমধ্যে সম্পন্ন হয়েছিল) স্পষ্টভাবে নিক্ষেপ করুন। ( আইসি 09 এ 3 , বি/227991471 )
সংস্করণ 1.2.0-আলফা 04
21শে সেপ্টেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha04
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA04 এর মধ্যে এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
দ্রুত স্থানীয় বিকাশের জন্য ম্যাক্রোব্যাঞ্চমার্কে (ইতিমধ্যে মাইক্রোতে উপলভ্য)
dryRunMode.enable
জন্য সমর্থন যুক্ত করুন এবং অ্যাপ্লিকেশন অটোমেশনকে বৈধকরণ (যেমন প্রেসবিমিট)। এটি 1 এর পুনরাবৃত্তিগুলিকে ওভাররাইড করে, সংকলন এড়িয়ে যায়, সমস্ত কনফিগারেশন ত্রুটি দমন করে এবং পরিমাপ অক্ষম করে J জসন ফাইল আউটপুট। ( আইবি 51 বি 4 , বি/175149857 )গ্রেড কমান্ড লাইনে:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.dryRunMode.enable=true
বিল্ড.গ্রাডলে:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.dryRunMode.enable', 'true' } }
বাগ ফিক্স
- ফিক্সড
StartupTimingMetric
জন্য আরMacrobenchmarkScope.startActivityAndWait()
এর মাধ্যমে আর পরিমাপের ক্রিয়াকলাপগুলি চালু করার প্রয়োজন নেই। এর অর্থ মেট্রিক ইজি বিজ্ঞপ্তি,Context.startActivity()
, ইন-অ্যাপ্লিকেশন ক্রিয়াকলাপ ভিত্তিক নেভিগেশন বা শেল কমান্ডগুলি থেকে লঞ্চগুলি বেছে নিতে পারে। ( আইএ 2 ডি 6 , বি/245414235 ) - বাগটি ঠিক করুন যেখানে
startActivityAndWait
ওয়েট ফ্রেম সনাক্তকরণের কঠোরতা হ্রাস করে এমুলেটরগুলিতে লঞ্চ সমাপ্তির জন্য অপেক্ষা করার সময়সীমা সময়আউট করবে। ( আইবিই 2 সি 6, বি/244594339 , বি/228946895 )
সংস্করণ 1.2.0-Alpha03
7 সেপ্টেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha03
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA03 এ এই কমিটগুলি রয়েছে।
নতুন বৈশিষ্ট্য
-
BenchmarkState
স্বাধীনভাবে ব্যবহারের জন্য পরীক্ষামূলক এপিআই যুক্ত করা হয়েছে,BenchmarkRule
/JUnit4
থেকে পৃথক। ( আইডি 478 এফ , বি/228489614 )
বাগ ফিক্স
-
startActivityAndWait
জন্য লিনব্যাক ফ্যালব্যাক যুক্ত করা হয়েছে। ( 01 এড 77 , বি/242899915 )
সংস্করণ 1.2.0-আলফা 02
24 আগস্ট, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha02
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA02 এ এই কমিটগুলি রয়েছে।
এপিআই পরিবর্তন
- বেসলাইন প্রোফাইল প্রজন্মের সময় ব্যতীত, এমনকি শিকড় থাকা অবস্থায়ও
MacrobenchmarkScope.killProcess()
এর জন্যam force stop
ডিফল্ট। এটি একটি al চ্ছিক বুলিয়ান আর্গুমেন্ট দিয়ে ওভাররাইড করা যেতে পারে। ( 02CCE9 , খ/241214097 )
বাগ ফিক্স
- সিস্টেম অ্যাপ্লিকেশনগুলির জন্য বেসলাইন প্রোফাইল প্রজন্মকে সমর্থন করুন। ( I900b8 , খ/241214097 )
- আনরোটেড ডিভাইসগুলিতে ওডিপিএম পাওয়ার মেট্রিকগুলির জন্য চেকিং সমর্থন করুন। ( A38C78 , বি/229623230 )
সংস্করণ 1.2.0-Alpha01
জুলাই 27, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha01
প্রকাশিত হয়েছে। সংস্করণ 1.2.0-ALPHA01 এর মধ্যে এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- নতুন ট্রেসিং-পারফেটো-কমন উপাদানটি একটি অ্যাপ্লিকেশনটিতে পারফেটো এসডিকে ট্রেসিং সক্ষম করতে টুলিংকে অনুমতি দেয় যা এটি প্রকাশ করে ( i2cc7f )
ফিল্টারিং ম্যাক্রোব্যাঞ্চমার্ককে কেবল বেঞ্চমার্কগুলিতে চালিত করে বা কেবল বেসলাইন প্রোফাইল প্রজন্মের জন্য সক্ষম করতে
androidx.benchmark.enabledRules
ইন্সট্রুমেন্ট আর্গুমেন্ট যুক্ত করা হয়েছে। কেবলমাত্র এক ধরণের পরীক্ষা চালানোর জন্য 'ম্যাক্রোব্যাঞ্চমার্ক', বা 'বেসলাইনপ্রোফাইল' এ পাস করুন, যেমন কোনও এমুলেটরটিতে কেবলBaselineProfiles
তৈরি করার সময়। কমা-বিচ্ছিন্ন তালিকাও সমর্থিত। ( I756b7 , বি/230371561 )যেমন আপনার ম্যাক্রোব্যাঞ্চমার্কের বিল্ড.গ্র্যাডল:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
বা গ্রেডল কমান্ড লাইন থেকে:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
এপিআই পরিবর্তন
- বেঞ্চমার্কগুলিতে শক্তি এবং পাওয়ার কাজগুলি পরিমাপের জন্য নতুন
PowerMetric
যুক্ত করা হয়েছে। ( I9f39b , খ/220183779 ) - প্রোফাইল রিসেট এবং সংকলন এড়াতে একটি নতুন সংকলন মোড
CompilationMode.Ignore
যুক্ত করা হয়েছে। ( আইবিবিসিএফ 8 , বি/230453509 ) - প্যাকেজের নাম অনুসারে আউটপুট ফাইল ফিল্টার করতে
BaselineProfileRule#collectBaselineProfile
জন্য একটি নতুন প্যারামিটার যুক্ত করা হয়েছে ( আইএফ 7338 , বি/220146561 ) - পাওয়ার ড্রেন পরিমাপ করতে বিকাশকারীকে ডিভাইস স্রাব করতে সক্ষম করে। ( I6a6cb )
-
MacrobenchmarkScope
শেডার ক্যাশে সাফ করার ক্ষমতা যুক্ত করেছে। ( I32122 ) - বিকাশকারীকে মেট্রিক টাইপ এবং বিশদ পছন্দসই সাবসিস্টেম বিভাগগুলির প্রদর্শন কনফিগার করতে সক্ষম করে। ( I810c9 )
- পূর্বে একটি অসমর্থিত ডিভাইসে চালিত হলে একটি
UnsupportedOperationException
বেঞ্চমার্কে ফেলে দেওয়া হয়েছিল। এখন ইউওই কেবল তখনই ঘটে যদি মেট্রিকটি অসমর্থিত ডিভাইসে (যেমন:PowerMetric.configure
) ব্যবহার করা হয়। ( I5cf20 , খ/227229375 ) - ম্যাক্রোব্যাঞ্চমার্কগুলিতে প্রতিটি সিস্টেম বিভাগে মোট শক্তি এবং শক্তি পরিমাপের জন্য
TotalPowerMetric
এবংTotalEnergyMetric
যুক্ত করা হয়েছে। ( আই 3 বি 26 বি, বি/224557371 )
বাগ ফিক্স
- এমন একটি সমস্যা স্থির করা হয়েছে যেখানে সংকলিত পদ্ধতিগুলি আনরোটেড বিল্ডগুলিতে প্রতিটি ম্যাক্রোব্যাঞ্চমার্কের মধ্যে সঠিকভাবে পুনরায় সেট করা হচ্ছে না। দুর্ভাগ্যক্রমে এটির প্রতিটি পুনরাবৃত্তিটি পুনরায় ইনস্টল করা দরকার, যা প্রতিটি ম্যাক্রোব্যাঞ্চমার্কের জন্য অ্যাপ্লিকেশন ডেটা সাফ করবে। ( I31c74 , বি/230665435 )
- এপিআই 21/22 এ ট্রেস রেকর্ডিং ক্র্যাশ ফিক্স করুন ( আইএফ 7 এফডি 6 , বি/227509388 , বি/227510293 , বি/227512788 )
- স্টার্টআপ ম্যাক্রোব্যাঞ্চমার্কগুলিতে 'কোনও মেট্রিকগুলি পড়তে অক্ষম' ঠিক করার জন্য ওভারহল অ্যাক্টিভিটি লঞ্চ সমাপ্তি সনাক্তকরণ। ( আইএ 517 সি )
সংস্করণ 1.1.1
সংস্করণ 1.1.1
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.1.1
প্রকাশিত হয়েছে। সংস্করণ 1.1.1 এ এই কমিটস রয়েছে।
বাগ ফিক্স
- ফিক্সস
android.system.ErrnoException: open failed: EACCES
। এটি1.2.0-alpha01
থেকে একটি ফিক্সের চেরি-পিক। ( এওএসপি/2072249 )
সংস্করণ 1.1.0
সংস্করণ 1.1.0
15 জুন, 2022
androidx.benchmark:benchmark-*:1.1.0
প্রকাশিত হয়েছে। সংস্করণ 1.1.0 এ এই কমিটস রয়েছে।
- এই সংস্করণটি
androidx.benchmark:benchmark-*:1.1.0-rc03
এর অনুরূপ।
1.0.0 সাল থেকে গুরুত্বপূর্ণ পরিবর্তন
Support for Jetpack Macrobenchmarks, which allows you to measure whole-app interactions like startup and scrolling , provides the ability to capture traces & measure trace sections .
Support for Baseline Profiles
-
CompilationMode.Partial
to measure the effectiveness of Baseline Profiles. -
@BaselineProfileRule
to automatically generate Baseline profiles for a given critical user journey.
-
Support for Allocation metrics & profiling during Microbenchmark runs.
Version 1.1.0-rc03
জুন 1, 2022
androidx.benchmark:benchmark-*:1.1.0-rc03
is released. Version 1.1.0-rc03 contains these commits.
বাগ ফিক্স
Avoid reinstalling the target package on every benchmark iteration. ( aosp/2093027 , b/231976084 )
Remove the
300ms
delay frompressHome()
. ( aosp/2086030 , b/231322975 )Improve Macrobenchmark iteration speed by optimizing Shell commands used under the hood. ( aosp/2086023 , b/231323582 )
Support for Managed Gradle Devices when generating Baseline Profiles with Macrobenchmarks. ( aosp/2062228 , b/228926421 )
Version 1.1.0-rc02
11 মে, 2022
androidx.benchmark:benchmark-*:1.1.0-rc02
is released. Version 1.1.0-rc02 contains these commits.
- Note that this release includes a behavior change, as apps are now fully reinstalled in between each benchmark to ensure accurate measurements.
Bug Fixes/Behavior Changes
Fixed an issue where app compilation was not correctly reset between macrobenchmarks, and not reset at all on unrooted builds. This fixes many cases where running multiple tests would result in
CompilationMode
having little to no effect on measurements. To workaround this problem, the target app is now fully reinstalling each test method, which will clear application data between each macrobenchmark. ( I31c74 , b/230665435 )As this prevents apps from setting up state before tests, it is now possible to skip compilation / reinstallation to enable working around this. You can for example fully compile the target with a shell command
cmd package compile -f -m speed <package>
, and then bypass macrobenchmark's compilation step.Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.compilation.enabled, 'false' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.compilation.enabled=false
Made it possible to share a module between macrobenchmarks and baseline profile generating tests by adding
androidx.benchmark.enabledRules
instrumentation argument. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when generatingBaselineProfiles
on an emulator. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
Version 1.1.0-rc01
20 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-rc01
is released. Version 1.1.0-rc01 contains these commits.
বাগ ফিক্স
- Baseline profile output links in Android Studio now use a unique file name. This way the output always reflects the latest results of using a
BaselineProfileRule
. ( aosp/2057008 , b/228203086 )
Version 1.1.0-beta06
6 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-beta06
is released. Version 1.1.0-beta06 contains these commits.
বাগ ফিক্স
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
- Fix startup metrics for Macrobenchmarks when
CompilationMode.None()
is used. Before this change,CompilationMode.Partial()
would appear to be slower thanCompilation.None()
. ( 611ac9 ).
Version 1.1.0-beta05
23 মার্চ, 2022
androidx.benchmark:benchmark-*:1.1.0-beta05
is released. Version 1.1.0-beta05 contains these commits.
বাগ ফিক্স
- Kill package after skipping profile installation when using
CompilationMode.None
. ( aosp/1991373 ) - Fixed an issue where Macrobenchmarks is unable to collect startup metrics when using
StartupMode.COLD
. ( aosp/2012227 b/218668335 )
Version 1.1.0-beta04
23 ফেব্রুয়ারি, 2022
androidx.benchmark:benchmark-*:1.1.0-beta04
is released. Version 1.1.0-beta04 contains these commits.
বাগ ফিক্স
Fix missing metrics on Android 10, and
NoSuchElementException
caused by process names not being captured correctly in traces. ( Ib4c17 , b/218668335 )Use
PowerManager
for thermal throttling detection on Q (API 29) and higher. This significantly reduces frequency of false positives in thermal throttling detection (benchmark retry after 90 second cooldown), and speeds up benchmarks significantly on user builds. It also provides throttle detection even when clocks are locked (if they're locked too high for the device's physical environment). ( I9c027 , b/217497678 , b/131755853 )Filter simpleperf sampled profiling to
measureRepeated
thread only to simplify inspection ( Ic3e12 , b/217501939 )Support metrics from named UI subprocesses in multi-process apps ( Ice6c0 , b/215988434 )
Filter Baseline Profile rules to target Android 9 (SDK 28). aosp/1980331 b/216508418
Skip Profile Installation when using
Compilation.None()
. Additionally, report warnings when the app is using an older version ofandroidx.profileinstaller
and Android Gradle Plugin. aosp/1977029
Version 1.1.0-beta03
ফেব্রুয়ারী 9, 2022
androidx.benchmark:benchmark-*:1.1.0-beta03
is released. Version 1.1.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added
AudioUnderrunMetric
into macrobenchmark library under experimental flag to allow detection of audio underruns ( Ib5972 ) BaselineProfileRule
no longer accepts asetup
block as this functioned the same as theprofileBlock
. ( Ic7dfe , b/215536447 )যেমন
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, setupBlock = { startActivityAndWait() }, profileBlock = { // ... } ) }
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, profileBlock = { startActivityAndWait() // ... } ) }
বাগ ফিক্স
- Fixed issue where microbench profiler traces would fail to be updated in subsequent runs when linked in Studio output ( I5ae4d , b/214917025 )
- Prevent compilation shell commands on API 23 ( Ice380 )
- Renamed
FrameCpuTime
->FrameDurationCpu
,FrameUiTime
->FrameDurationUi
to clarify these are durations, not timestamps, and to match prefixes. ( I0eba3 , b/216337830 )
Version 1.1.0-beta02
জানুয়ারী 26, 2022
androidx.benchmark:benchmark-*:1.1.0-beta02
is released. Version 1.1.0-beta02 contains these commits.
বাগ ফিক্স
- Microbenchmark Stack Sampling / Method Tracing Profile results are now linked in Studio output, similar to other profiling outputs, and do not suppress the allocation metric. ( Idcb65 , b/214440748 , b/214253245 )
- BaselineProfileRule now prints the
adb pull
command in logcat and Studio output for pulling generated BaselineProfile text file. ( f08811 )
Version 1.1.0-beta01
জানুয়ারী 12, 2022
androidx.benchmark:benchmark-*:1.1.0-beta01
is released. Version 1.1.0-beta01 contains these commits.
বাগ ফিক্স
- Fixes profiler argument enable being ignored. ( I37373 , b/210619998 )
- Removed deprecated
CompliationModes
( I98186 , b/213467659 ) - Switched baseline profile arg of
CompilationMode.Partial
to enum for clarity. ( Id67ea )
Version 1.1.0-alpha13
15 ডিসেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha13
is released. Version 1.1.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Add low-overhead System Tracing to microbench output on Android Q (API 29+). Note that this does not currently capture custom tracing (via
android.os.Trace
orandroidx.tracing
Jetpack APIs) to avoid affecting results. This tracing should be useful in diagnosing instability, especially from sources outside the benchmark. ( I298be , b/205636583 , b/145598917 ) - Clarify
CompilationModes
into three classes - Full, None, Partial. Previously they were inconsistently named after compilation arguments (which we now treat as implementation details) and features. This makes the tradeoffs, potential combinations, and behavior across platform versions more clear. ( I3d7bf , b/207132597 ) - Setup and measure are now always in pairs, in order. You can now query the package name and iteration (though the iteration may be
null
in certain warmup scenarios). ( Id3b68 , b/208357448 , b/208369635 )
বাগ ফিক্স
- Fixed
CompilationMode.Speed
incorrectly treated asNone
( I01137 )
Version 1.1.0-alpha12
নভেম্বর 17, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha12
is released. Version 1.1.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- Add experimental TraceSectionMetric for custom trace-based timing measurements. ( I99db1 , b/204572664 )
বাগ ফিক্স
- Wake device each iteration, to ensure UI can be tested - requires lockscreen is disabled. ( Ibfa28 , b/180963442 )
- Fixes multiple crashes in StackSampling profiling mode on emulators and non-rooted devices ( Icdbda , b/202719335 )
- Removed 0.5 second sleep at the end of each iteration - if you see missing metrics with this change, please file a bug. ( Iff6aa )
- Reduce chances of dropped data, and lower memory overhead from tracing ( Id2544 , b/199324831 , b/204448861 )
- Reduce trace size by ~40% by switching to compact sched storage format. ( Id5fb6 , b/199324831 )
- Updated implementations of startup metrics to always end at end of renderthread. This will be more contistent across platform versions, and more closely map to in-app measurements. ( Ic6b55 )
Version 1.1.0-alpha11
3 নভেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha11
is released. Version 1.1.0-alpha11 contains these commits.
এপিআই পরিবর্তন
- Macrobenchmark now has a
minSdkVersion
of23
. ( If2655 ) - Adds a new experimental
BaselineProfileRule
which is capable of generating baseline profiles for app's critical user journey. Detailed documentation to follow. ( Ibbefa , b/203692160 ) - Removes measureRepeated interface variant, which was added for java callers, as it caused ambiguity in completing/resolving the method. Java callers will again need to return Unit.Instance from measureRepeated. If this is an inconvenience, please file a bug, we can revisit this in a future version. ( Ifb23e , b/204331495 )
Version 1.1.0-alpha10
27 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha10
is released. Version 1.1.0-alpha10 contains these commits.
এপিআই পরিবর্তন
- Backport StartupTimingMetric to work back to API 23. This new implementation also better handles reportFullyDrawn() to wait until corresponding content has been rendered. ( If3ac9 , b/183129298 )
- Added JvmOverloads to multiple MacrobenchmarkScope methods for Java callers. ( I644fe , b/184546459 )
- Provide alternative MacrobenchmarkRule.measureRepeated function that uses a
Consumer<MacrobenchmarkScope>
for idiomatic usage in Java language. ( If74ab , b/184546459 )
বাগ ফিক্স
- Fix for traces not starting early enough, and missing metric data. This is expected to fix "Unable to read any metrics during benchmark" exceptions that were caused by the library itself. ( I6dfcb , b/193827052 , b/200302931 )
- FrameNegativeSlack has been renamed to FrameOverrun to clarify its meaning - how much the frame went over its time budget. ( I6c2aa , b/203008701 )
Version 1.1.0-alpha09
13 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha09
is released. Version 1.1.0-alpha09 contains these commits.
বাগ ফিক্স
- Support dropping Kernel page cache without root on API 31/S+, which will increase accuracy of StartupMode.COLD launches. ( Iecfdb , b/200160030 )
Version 1.1.0-alpha08
সেপ্টেম্বর 29, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha08
is released. Version 1.1.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- Enable scrolling macrobenchmarks to run back to API 23 ( If39c2 , b/183129298 )
- Add new type of sampled metric to UI and JSON output, focused on percentiles of multiple samples per iteration. ( I56247 , b/199940612 )
- Switch to floating point metrics throughout the benchmark libraries (truncated in the Studio UI). ( I69249 , b/197008210 )
Version 1.1.0-alpha07
1 সেপ্টেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha07
is released. Version 1.1.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Raised min API to 21 to reflect the intended lowest API level to be supported in the future. Current min API supported continues to be conveyed via RequiredApi(), and is currently 29 ( I440d6 , b/183129298 )
বাগ ফিক্স
- Fixes
ProfileInstaller
to make it easier for apps using baseline profiles to run MacroBenchmarks usingCompilationMode.BaselineProfile
. ( I42657 , b/196074999 ) NOTE: requires also updating toandroidx.profileinstaller:profileinstaller:1.1.0-alpha04
or greater. -
StartupMode.COLD
+CompilationMode.None
benchmarks are now more stable. ( I770cd , b/196074999 )
Version 1.1.0-alpha06
18 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha06
is released. Version 1.1.0-alpha06 contains these commits.
এপিআই পরিবর্তন
- Added
androidx.benchmark.iterations
instrumentation argument to allow manual overriding of iteration count when testing/profiling locally. ( 6188be , b/194137879 )
বাগ ফিক্স
- Switched to Simpleperf as default sampling profiler on API 29+. ( Ic4b34 , b/158303822 )
পরিচিত সমস্যা
-
CompilationMode.BaselineProfile
is a work in progress. Avoid using it to determine how good a profile is for now.
Version 1.1.0-alpha05
4 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha05
is released. Version 1.1.0-alpha05 contains these commits.
1.1.0-alpha04
was cancelled before release due to a sporatic crash. b/193827052
এপিআই পরিবর্তন
- Switched startActivityAndWait to invoke launch via
am start
, which reduces the time of each measurement iteration by approximately 5 seconds, at the cost of no longer supporting intent parcelables. ( I5a6f5 , b/192009149
বাগ ফিক্স
- Reduce aggressiveness of thermal throttle detection, and recompute baseline if throttles are detected frequently. ( I7327b )
- Fixes FrameTimingMetric to work on Android S beta ( Ib60cc , b/193260119 )
- Use an
EmptyActivity
to bring the target app out of a force-stopped state to better supportCompilationMode.BaselineProfile
. ( Id7cac , b/192084204 ) - Changed trace file extension to
.perfetto-trace
to match platform standard. ( I4c236 , b/174663039 ) - StartupTimingMetric now outputs the "fullyDrawnMs" metric to measure time until your application has completed rendering. To define this metric for your app, call Activity.reportFullyDrawn when your initial content is ready, such as when your initial list items are loaded from DB or network. (reportFullyDrawn method available without build version checks on ComponentActivity). Note that your test must run long enough to capture the metric (startActivityAndWait doesn't wait for reportFullyDrawn). ( If1141 , b/179176560 )
- Reduce cost of appending Ui metadata to traces by 50+ ms ( Ic8390 , b/193923003 )
- Drastically increased polling frequency when stopping tracing, which can reduce eg startup benchmark runtime by 30+% ( Idfbc1 , b/193723768 )
Version 1.1.0-alpha03
16 জুন, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha03
is released. Version 1.1.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added a new
CompilationMode.BaselineProfile
to support profiles installed using the Jetpack ProfileInstaller library . ( aosp/1720930 )
বাগ ফিক্স
The sample Gradle code for suppressing benchmark errors has been updated to use a non-deprecated API with a syntax that also supports .gradle.kts users.
যেমন,
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"
Version 1.1.0-alpha02
18 মে, 2021
Benchmark version 1.1.0-alpha02 brings a big component to benchmarking - Macrobenchmark. In addition to benchmark allowing you to measure CPU loops, macrobenchmark allows you to measure whole-app interactions like startup and scrolling, and capture traces. For more information see the library documentation .
androidx.benchmark:benchmark-*:1.1.0-alpha02
is released. Version 1.1.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
Macrobenchmark artifacts added ( androidx.benchmark:benchmark-macro-junit4
and androidx.benchmark:benchmark-macro
)
- Capture startup, scrolling/animation performance metrics from your app, locally or in CI
- Capture and inspect traces from within Android Studio
বাগ ফিক্স
- Workaround shell permissions issue with output directory on Android 12 (Note - may require updating Android Gradle Plugin to 7.0.0 canary and Android Studio to Arctic Fox (2020.3.1), to continue capturing output files on affected devices). ( Icb039 )
- Support configuration caching in BenchmarkPlugin ( 6be1c1 , b/159804788 )
- Simplified file output - on by default, in a directory that doesn't require
requestLegacyExternalStorage=true
( 8b5a4d , b/172376362 ) - Fixes library printing logcat warnings about not finding JIT thread on platform versions where it is not present. ( I9cc63 , b/161847393 )
- Fix for reading device max frequency. ( I55c7a )
Version 1.1.0-alpha01
জুন 10, 2020
androidx.benchmark:benchmark-common:1.1.0-alpha01
, androidx.benchmark:benchmark-gradle-plugin:1.1.0-alpha01
, and androidx.benchmark:benchmark-junit4:1.1.0-alpha01
are released. Version 1.1.0-alpha01 contains these commits.
New Features of 1.1
- Allocation Metric - Benchmarks now run an additional phase after warmup and timing, capturing allocation counts. Allocations can cause performance problems on older versions of the platform (140ns in O became 8ns in M - measured on Nexus5X, with locked clocks). This metric is displayed in Android Studio console output, as well as in the
- Profiling support - You can now capture profiling data for a benchmark run, to inspect why your code may be running slowly. Benchmark supports capturing either method tracing, or method sampling from ART. These files can be inspected with the Profiler inside Android Studio using File > Open .
- The Benchmark Gradle plugin now provides defaults for simpler setup:
-
testBuildType
is set to release by default, to avoid using dependencies with code coverage built-in. The release buildType is also configured as the default buildType, which allows Android Studio to automatically select the correct build variant when opening a project for the first time. ( b/138808399 ) -
signingConfig.debug
is used as the default signing config ( b/153583269 )
-
** Bug Fixes **
- Significantly reduced the warmup transition overhead, where the first measurement for each benchmark was artificially higher than others. This issue was more pronounced in very small benchmarks (1 microsecond or less). ( b/142058671 )
- Fixed
InstrumentationResultParser
error printed for each benchmark when running from command line. ( I64988 , b/154248456 )
পরিচিত সমস্যা
- Command line, gradle invocations of Benchmark do not print out results directly. You can work around this by either running through Studio, or parsing the JSON output file for results.
- Benchmark reporting fails to pull the report from devices that have an app installed with an applicationId ending with either “android” or “download” (case insensitive). Users hitting this issue should upgrade the Android Gradle Plugin to 4.2-alpha01 or later.
সংস্করণ 1.0.0
Benchmark Version 1.0.0
নভেম্বর 20, 2019
androidx.benchmark:benchmark-common:1.0.0
, androidx.benchmark:benchmark-gradle-plugin:1.0.0
, and androidx.benchmark:benchmark-junit4:1.0.0
are released with no changes from 1.0.0-rc01. Version 1.0.0 contains these commits .
Major features of 1.0.0
The Benchmark library allows you to write performance benchmarks of app code and get results quickly.
It prevents build and runtime configuration issues and stabilizes device performance to ensure that measurements are accurate and consistent. Run the benchmarks directly in Android Studio , or in Continuous Integration to observe code performance over time, and to prevent regressions.
প্রধান বৈশিষ্ট্য অন্তর্ভুক্ত:
- Clock stabilization
- Automatic thread prioritization
- Support for UI performance testing, such as in the RecyclerView Sample
- JIT-aware warmup and looping
- JSON benchmark output for post-processing
Version 1.0.0-rc01
23 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-rc01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-rc01
, and androidx.benchmark:benchmark-junit4:1.0.0-rc01
are released. Version 1.0.0-rc01 contains these commits .
নতুন বৈশিষ্ট্য
- Added systrace tracing to benchmarks
বাগ ফিক্স
- Fixed metric instability issue where JIT wouldn't finish before warm up due to deprioritization ( b/140773023 )
- Unified JSON output directory across Android Gradle Plugin 3.5 and 3.6
Version 1.0.0-beta01
9 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-beta01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-beta01
, and androidx.benchmark:benchmark-junit4:1.0.0-beta01
are released. Version 1.0.0-beta01 contains these commits .
নতুন বৈশিষ্ট্য
- Run garbage collection before each warmup to reduce memory pressure from one benchmark to leak to the next ( b/140895105 )
বাগ ফিক্স
- Added
androidx.annotation:android-experimental-lint
dependency, so that Java code will correctly produce lint errors when experimental API is not used, similar to what is provided by the Kotlin experimental annotation for Kotlin callers. - Now correctly detects usage of
additionalTestOutputDir
instrumentation argument for output in Android Gradle Plugin 3.6, to know when AGP will handle data copy. - Fix undetected clock frequency in JSON to correctly print
-1
( b/141945670 ).
Version 1.0.0-alpha06
সেপ্টেম্বর 18, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha06
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha06
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha06
are released. Version 1.0.0-alpha06 contains these commits .
নতুন বৈশিষ্ট্য
- Added a check for incorrectly using the old package for the test runner, which now provides a more-helpful error message
API changes
- The experimental annotation
ExperimentalAnnotationReport
is now correctly public. Usage of the experimental BenchmarkState#report API now requires this annotation
Version 1.0.0-alpha05
5 সেপ্টেম্বর, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha05
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha05
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha05
are released. The commits included in this version can be found here .
API changes
-
BenchmarkState.reportData
API is now marked experimental
বাগ ফিক্স
- Fix for the clock-locking script, which would fail on devices that were either missing the
cut
orexpr
shell utilities. - Fixed an issue with
./gradlew lockClocks
task that would hang on devices that were rooted with an older version of the su utility, which did not support the-c
flag.
Version 1.0.0-alpha04
7 আগস্ট, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha04
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha04
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha04
are released. The commits included in this version can be found here .
New documentation has also been added for how to use the Benchmark library without Gradle, both for usage with different build systems (such as Bazel or Buck), and when running in CI. For more information, see Build benchmarks without Gradle and Run benchmarks in Continuous Integration .
নতুন বৈশিষ্ট্য
- গ্রেডল প্লাগইন
- Now automatically disables test coverage, and sets the
AndroidBenchmarkRunner
by default ( b/138374050 ) - Added support for new AGP-based data copy, when running benchmarks and when using AGP 3.6+
- Now automatically disables test coverage, and sets the
- JSON format additions
- Output total benchmark test run time ( b/133147694 )
-
@Parameterized
benchmarks that use a name string (for example@Parameters(name = "size={0},depth={1}")
) now output parameter names and values per benchmark in the JSON output ( b/132578772 )
- Dry Run mode ( b/138785848 )
- Added a "dry run" mode for running each benchmark loop only once, to check for errors/crashes without capturing measurements. This can be useful eg for, for example, quickly running benchmarks in presubmit to check that they're not broken.
API changes
- Module structure has changed, splitting the library ( b/138451391 )
-
benchmark:benchmark-junit4
contains classes with JUnit dependency:AndroidBenchmarkRunner
, andBenchmarkRule
, both of which have moved into theandroidx.benchmark.junit4
package -
benchmark:benchmark-common
contains the rest of the logic, including the BenchmarkState API - This split will allow the library to support benchmarking without JUnit4 APIs in the future
-
- Configuration warnings are now treated as errors, and will crash the test ( b/137653596 )
- This is done to further encourage accurate measurements, especially in CI
- These errors can be reduced back to warnings with an instrumentation argument. For example:
-e androidx.benchmark.suppressErrors "DEBUGGABLE,LOW_BATTERY"
বাগ ফিক্স
- Errors when writing to external storage on Q devices provide more-descriptive messages, with suggestions of how to resolve the issue
- Screens are automatically turned on during benchmark runs, instead of failing when the screen is off
External contributions
- Thanks to Sergey Zakharov for contributing JSON output improvements and the fix for screen off issues!
Version 1.0.0-alpha03
জুলাই 2, 2019
androidx.benchmark:benchmark:1.0.0-alpha03
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha03
are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Expose sleep duration due to thermal throttling per benchmark in the full JSON report
বাগ ফিক্স
- The Gradle plugin should no longer be required to be applied after Android plugins and the Android block
- Adds support for benchmark reports on Android 10 devices using scoped storage
Version 1.0.0-alpha02
জুন 6, 2019
androidx.benchmark:1.0.0-alpha02
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha02
are released. The commits included in this version can be found here .
Note that we are treating the JSON schema as an API. We plan to follow the same stability constraints as other APIs: stable (with very rare exceptions) once in beta, and fixed in final release, with only additions in minor releases and changes/removals in major releases.
API changes
Overhauled JSON schema. Further changes to the JSON schema are likely to be limited to additions:
- Reorganized the result object structure to support additional metric groups in the future ( b/132713021 )
- Added test run context information, such as device and build info and whether clocks are locked, to the top-level object ( b/132711920 )
- Time metric names now have 'ns' in their name ( b/132714527 )
- Additional stats added per reported metric (maximum, median, minimum), and removed simplified 'nanos' summary stat ( b/132713851 )
Removed XML output ( b/132714414 )
Thermal throttle detection removed from
BenchmarkState.reportData
API ( b/132887006 )
বাগ ফিক্স
- Fixed
./gradlew lockClocks
not sticking on some recent OS devices ( b/133424037 ) - Throttling detection disabled for emulator ( b/132880807 )
Version 1.0.0-alpha01
7 মে, 2019
androidx.benchmark:benchmark:1.0.0-alpha01
is released. The commits included in this version are available here .
বেঞ্চমার্ক
সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | প্রার্থী মুক্তি | বিটা রিলিজ | আলফা রিলিজ |
---|---|---|---|---|
9 এপ্রিল, 2025 | 1.3.4 | - | - | 1.4.0-alpha11 |
নির্ভরতা ঘোষণা করা
To add a dependency on Benchmark, you must add the Google Maven repository to your project. আরও তথ্যের জন্য Google এর Maven সংগ্রহস্থল পড়ুন।
Macrobenchmark
To use Macrobenchmark in your project, add the following dependencies to your build.gradle
file for your macrobenchmark module :
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-macro-junit4:1.3.4" }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-macro-junit4:1.3.4") }
Microbenchmark
To use Microbenchmark in your project, add the following dependencies to your build.gradle
file for your microbenchmark module :
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-junit4:1.3.4" } android { ... defaultConfig { ... testInstrumentationRunner "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-junit4:1.3.4") } android { ... defaultConfig { ... testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
মাইক্রোবেঞ্চমার্ক লাইব্রেরি আপনার মাইক্রোবেঞ্চমার্ক মডিউলের সাথে ব্যবহার করার জন্য একটি গ্রেডল প্লাগইনও প্রদান করে। এই প্লাগইনটি মডিউলের জন্য বিল্ড কনফিগারেশন ডিফল্ট সেট করে, হোস্টে বেঞ্চমার্ক আউটপুট কপি সেট আপ করে এবং ./gradlew lockClocks
টাস্ক প্রদান করে।
প্লাগইন ব্যবহার করতে, আপনার শীর্ষ-স্তরের build.gradle
ফাইলে `plugins` ব্লকে নিম্নলিখিত লাইনটি অন্তর্ভুক্ত করুন:
গ্রোভি
plugins { id 'androidx.benchmark' version '1.3.4' apply false }
কোটলিন
plugins { id("androidx.benchmark") version "1.3.4" apply false }
তারপর প্লাগইনটি আপনার বেঞ্চমার্ক মডিউলের build.gradle
ফাইলে প্রয়োগ করুন
গ্রোভি
plugins { id 'androidx.benchmark' }
কোটলিন
plugins { id("androidx.benchmark") }
প্রতিক্রিয়া
আপনার প্রতিক্রিয়া জেটপ্যাককে আরও ভাল করতে সাহায্য করে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন বা এই লাইব্রেরির উন্নতির জন্য ধারনা পান তাহলে আমাদের জানান। আপনি একটি নতুন তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি দেখুন৷ আপনি তারকা বোতামে ক্লিক করে একটি বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ 1.4
Version 1.4.0-alpha11
9 এপ্রিল, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha11
is released. Version 1.4.0-alpha11 contains these commits .
এপিআই পরিবর্তন
- Changed
TraceProcessor
's argument timeout: Duration to timeoutMs long for Java caller usability. ( I9fbb5 ) - Mark
TraceProcessor
constructor as internal. Callers should useTraceProcessor.startServer
orTraceProcessor.runServer
. ( Ia8c5b )
বাগ ফিক্স
- When killing the application with
MacrobenchmarkScope.killProcess
, validate the kill command results to prevent silent failure, and timeout error. ( I84555 )
নির্ভরতা আপডেট
- This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer. ( Idb6b5 )
Version 1.4.0-alpha10
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha10
is released. Version 1.4.0-alpha10 contains these commits .
এপিআই পরিবর্তন
- Increased default timeout for
TraceProcessor
server load and querying to 120 seconds (from 60/30 previously), and made both configurable with one timeout parameter. ( Ifec87 )
বাগ ফিক্স
- Fixed a few issues that would occur when benchmarking or capturing profiles of an app without
profileinstaller
, and it's includedBroadcastReciever
. This only affects runs on rooted devices. ( Ied308 )
Version 1.4.0-alpha09
12 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha09
is released. Version 1.4.0-alpha09 contains these commits .
এপিআই পরিবর্তন
- Added
TraceProcessor
and Session API with closable Handles, for easier usage with custom lifecycles. This is also a step towards enabling easier Coroutine and Java API usage. The extension functions toTraceProcessor.runServer {}
are now marked experimental, as they're likely to move, and be made non-experimental in the future. ( I358b4 )
বাগ ফিক্স
- Fixed Benchmark and Baseline Profile capture not working with API 36 due to a change in
pgrep
toybox that now requires-a
to print the full command line. ( Idc991 ) - Filter default tracing config to reduce risk of data loss in traces on newer API levels. ( I54e8a )
- Added experimental
androidx.benchmark.killExistingPerfettoRecordings
instrumentation argument, which can be set tofalse
to allow pre existing perfetto trace capture to continue. By default pre existing perfetto trace captures on device are killed to prevent interference. ( I02a3c ) - The JSON field
context.osCodenameAbbreviated
will now beREL
for released OS versions at and above API 35, as non-numeric code names are no longer supported by the underlying platform. ( Ib17fd ) - Fixes crash in
FrameTimingMetric
when resynced frames occur. ( I7c6f4 , b/394610806 ) - No longer assume
Choreographer#doFrame
is the top of the stack frame on the main thread forFrameTimingQuery
. ( Iee0e0 , b/340206285 )
Version 1.4.0-alpha08
ফেব্রুয়ারি 12, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha08
is released. Version 1.4.0-alpha08 contains these commits .
এপিআই পরিবর্তন
- Moved
TraceProcessor.runSession()
extension APIs to be experimental, as they are likely to move to be concrete constructors eventually on Android. ( Ib0528 , b/393640753 ) - Most of the implementation of Startup Insights are now public/experimental, and move to the
TraceProcessor
artifact SeeStartupInsights
. ( I0aa00 ) - Deprecate
BenchmarkRule.runWithTimingDisabled {}
in favor ofBenchmarkRule.runWithMeasurementDisabled {}
, which more clearly describes the behavior - all metrics are paused. Additionally, expose theMicrobenchmarkScope
superclass since redeclaring therunWithMeasurementDisabled
function to open access isn't possible, since it's inline. ( I9e23b , b/389149423 , b/149979716 ) - Benchmark libraries have moved to Kotlin 2.0. ( I9d1e0 )
- Removed
androidx.benchmark.startupProfiles.enable
instrumentation argument. It is no longer useful, as it can be controlled byincludeInStartupProfile
arg inBaselineProfileRule.collect()
. ( I39eb4 )
বাগ ফিক্স
- Reduced the amount of Microbenchmark internal functions called during profiling to make eg Method traces more clear ( Ifaed8 )
- Speculative fix for crashes: 'Failed to stop [
ProcessPid(processName=perfetto, pid=...)
]'. Now Benchmark will log a message instead of crashing when a background Perfetto process isn't able to be stopped before running the benchmark. ( I37d3e , b/323601788 ) - Fix
IllegalStateExceptions
with 'Expectedpm dump-profiles
stdout' label that were caused by overly strict output format check. ( I358dc )
Version 1.4.0-alpha07
জানুয়ারী 29, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha07
is released. Version 1.4.0-alpha07 contains these commits .
নতুন বৈশিষ্ট্য
-
BaselineProfileRule
now introduces acollectWithResults(...)
API which includes a list of paths to the computed profiles. ( I056f8 ) - Added
androidx.benchmark.measureRepeatedOnMainThread.throwOnDeadline
instrumentation argument, which can be set to false to disable the throw on deadline behavior ofmeasureRepeatedOnMainThread
for local testing. Not otherwise recommended, as this increases the likelihood of ANRs during tests. ( Idbeec , b/353226476 )
এপিআই পরিবর্তন
- Added
@JvmOverloads
toMicrobenchmarkConfig
constructor. ( I13fd3 ) - Refactored
BenchmarkRule
to be built on top of coroutines, and support betteryield()
behavior. This refactor removed several experimentalBenchmarkState
APIs, but will be followed by replacements as needed. Additionally, addedrunWithMeasurementDisabled
to clarify behavior (all measurement is paused). In the future,runWithTimingDisabled
will be deprecated. ( I19837 , b/389149423 , b/311242861 ) - Move
PerfettoTraceProcessor
toTraceProcessor
in a newandroidx.benchmark:benchmark-traceprocessor
artifact, and make most of its API non-experimental. Any customTraceMetric
or anything reading from traces will need to update to the newTraceProcessor
import. The newTraceProcessor
API works exactly like the old one, but is a standalone interface library (somewhat analogous to theandroidx.sqlite
layer from Room) with an Android-specific implementation built into macrobenchmark. The new artifact can be used on JVM as well, but currently you'll need to start your own copy of theTraceProcessor
binary and offer a port to connect to it on. ( I3a767 , I62563 , b/381134564 )
বাগ ফিক্স
- Throw a clearer error message when
MacrobenchmarkScope.startActivityAndWait
fails to launch the target process (potentially due to a crash in the target process), instead of the more ambiguous 'Unable to confirm activity launch completion' message ( I3539b ) - Fixed several syntax errors in Kotlin samples, and syntax highlighting in several Java / build.gradle samples. ( Ib3808 )
- Clarified
ArtMetric
andCaptureInfo
parameter docs. ( I96e60 )
Version 1.4.0-alpha06
11 ডিসেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha06
is released. Version 1.4.0-alpha06 contains these commits .
এপিআই পরিবর্তন
- Removed usage of
@Language("sql")
inPerfettoTraceProcessor.Session.query()
, as Studio highlighting/parsing is broken. ( Idc2fa , b/377733398 )
বাগ ফিক্স
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I46810 , b/326456246 ) - Corrected
ArtMetric
to report class load (not init), and improved docs to clarify runtime behavior. ( I9915c ) - On Android Multiuser, execute commands as root only on rooted devices. ( I88b44 )
সংস্করণ 1.4.0-আলফা 05
13 নভেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha05
is released. Version 1.4.0-alpha05 contains these commits .
বাগ ফিক্স
- Fixed an issue on API 34+ where
CompilationMode.None()
would have inconsistent performance not representative of initial, worst case performance. This works around a platform change which allows ART's compilation stateverify
to partially compile apps (only affecting class loading) shortly after first launch. ( Ie48d0 ) - Fixed issue where (especially short) traces could be captured that wouldn't report measurement from built-in Macrobenchmark Metrics, due to the process name being truncated within the Perfetto trace. Now macrobenchmark works around this issue by looking for the truncated package name in all built-in queries, in addition to the expected package name. Note that custom
TraceMetric
implementations or other direct callers ofPerfettoSession.query
can implement this same behavior by changingprocess.name LIKE "$packageName"
in a Perfetto query to instead be(process.name LIKE "$packageName" OR process.name LIKE "$(packageName.takeLast(15))")
. ( I5bf01 , b/377565760 )
সংস্করণ 1.4.0-আলফা 04
অক্টোবর 30, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha04
is released. Version 1.4.0-alpha04 contains these commits .
নতুন বৈশিষ্ট্য
- (Experimental) Enable Baseline Profile generation, and benchmarking on apps installed to a secondary user, for example any app on headless Android Auto devices. This support has been tested in some scenarios, but let us know with a bug if it doesn't work for you. ( I9fcbe , b/356684617 , b/373641155 )
বাগ ফিক্স
-
isProfileable
is now always overridden in benchmark builds, andisDebuggable
is also now always overridden in both benchmark andnonMinified
(baseline profile capture) builds. ( I487fa , b/369213505 ) - Fixes compilation detection on some physical devices prior to API 28 - affects json
context.compilationMode
, as well as behavior ofandroidx.benchmark.requireAot=true
(which no longer incorrectly throws) ( Ic3e08 , b/374362482 ) - In
CpuEventCounter
metrics, throw if invalid measurements are observed (eg instructions/cpucycles==0) ( I8c503 )
সংস্করণ 1.4.0-আলফা 03
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha03
is released. Version 1.4.0-alpha03 contains these commits .
এপিআই পরিবর্তন
- Macrobenchmark : Adds
ArtMetric
, which can be used to inspect profile coverage or general Android RunTime performance. Captures number and total duration of JIT, class init (where available), and class verification. Additionally, changesCaptureInfo
to include optional ART mainline version with default. ( I930f7 ) - Add
coefficientOfVariation
to Benchmark JSON output to show stability within a given benchmark run. ( Ib14ea )
বাগ ফিক্স
- Fixed
CollectBaselineProfileTask
when AVD device has spaces in it. ( Ia0225 , b/371642809 ) - Speculative fix for errors from
StartupMode.COLD
exceptions:Package <packagename> must not be running prior to cold start!
. Now,MacrobenchmarkScope.killProcess()
(including the one run before each iteration, used to implementStartupMode.COLD
behavior) will wait to verify that the app's processes have all stopped running. ( I60aa6 , b/351582215 ) - Fixed issue where UNLOCKED_ error would show up on some rooted emulators. ( Ic5117 )
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I7104f , b/326456246 )
সংস্করণ 1.4.0-আলফা 02
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha02
is released. Version 1.4.0-alpha02 contains these commits .
এপিআই পরিবর্তন
- Moved Gradle tasks
lockClocks
andunlockClocks
to be on benchmark projects, instead of available at the top level. This change was necessary as there is unfortunately no way to register these as top level actions without breaking project isolation. ( I02b8f , b/363325823 )
বাগ ফিক্স
-
BaselineProfileRule
now collects profiles for multi-process apps by signaling each running process at the end of the block to dump profiles. If a profile based compilation never successfully finds a process to broadcast to, the compilation will fail, as it's unexpected to have profile data within. Additionally, added an instrumentation argument to control dump wait duration:androidx.benchmark.saveProfileWaitMillis
( I0f519 , b/366231469 ) - From Benchmark
1.3.2
: Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. ( I2f678 , b/285187547 )
To use FTL apply the plugin to the baseline profile module in the plugin block, with:
plugins {
...
id("com.google.firebase.testlab")
}
and then configure firebase test lab with:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
Also the created FTL device needs to be added to the baseline profile extension:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.4.0-আলফা 01
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha01
is released. Version 1.4.0-alpha01 contains these commits .
New Feature - App Startup Insights
- Initial version of app startup insights can be enabled in Macrobenchmark. ( 09fae38 )
To enable in a startup benchmark:
@Test
fun startup {
macrobenchmarkRule.measureRepeated(
…
packageName = "com.example.my.application.id"
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
compilationMode = CompilationMode.None(),
experimentalConfig = ExperimentalConfig(startupInsightsConfig = StartupInsightsConfig(isEnabled = true))
) {
scope.startActivityAndWait(...)
}
}
Then running your startup benchmark will analyze the trace to look for common problems, and print them after metrics to Studio test output in the benchmark tab, eg:
StartupBenchmark_startup[startup=COLD,compilationMode=None]
├── Metrics
│ ├── timeToFullDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
│ └── timeToInitialDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
├── App Startup Insights
│ ├── App in debuggable mode (expected: false)
│ │ └── seen in iterations: 0(true) 1(true) 2(true) 3(true) 4(true) 5(true) 6(true) 7(true) 8(true) 9(true)
│ ├── Potential CPU contention with another process (expected: < 100000000ns)
│ │ └── seen in iterations: 4(105022546ns)
│ └── Main Thread - Binder transactions blocked (expected: false)
│ └── seen in iterations: 7(true)
└── Traces
└── Iteration 0 1 2 3 4 5 6 7 8 9
This feature is still a work-in-progress, with improvements to documentation and extensibility to follow, but feedback is welcome.
নতুন বৈশিষ্ট্য
- Added gradle property
androidx.baselineprofile.suppressWarnings
to suppress all baseline profile warnings. ( 314153a ) - Microbench metrics are now displayed in Perfetto traces as counters. ( 3214854 )
- Add experimental scripts for disabling jit (requires root / runtime restart), and resetting device perf/test state. These are not currently published as gradle tasks. ( 7c3732b )
- Added benchmark argument to skip tests when running on emulator. When
automaticGenerationDuring
build is enabled, benchmarks will also trigger baseline profile generation. This will fail, if emulators are used. With the new argumentskipBenchmarksOnEmulator
we can instead skip the test. ( 0c2ddcd ) - Change perf event enable logic to run on API 23+ ( 2550048 )
এপিআই পরিবর্তন
- Existing experimental
PerfettoConfig
argument toMacrobenchmarkRule.measureRepeated()
moved to the newExperimentalConfig
object.
বাগ ফিক্স
- Increase
lockClocks.sh
retry count ( 99e9dac ) - Don't create
nonMinified
and benchmark build types if existing. Due to a bug, even ifnonMinified
and benchmark build types existed, they were going to be recreated. ( e75f0a5 ) - Ignore non-terminating slices from
TraceSectionMetric
results. ( a927d20 ) - Improved emulator check to consider
sdk_
prefix. ( 1587de8 ) - Treat non-running packages as cleared in
FrameTimingGfxInfoMetric
. ( 35cc79c ) - Fix
androidx.benchmark.cpuEventCounter
producing corrupt values for non-Instruction events. ( 06edd59 ) - Fix
resumeTiming/runWithTimingDisabled
to respect metric priority order, and significantly reduce impact of lower priority metric pause/resume on higher priority metric results. For example, if using cpu perf counters viacpuEventCounter.enable
instrumentation argument, timeNs is no longer significantly reduced when pause/resume occur. ( 5de0968 )
সংস্করণ 1.3
সংস্করণ 1.3.4
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.3.4
is released. Version 1.3.4 contains these commits .
বাগ ফিক্স
- Fixed Gradle Project Isolation incompatibilities in the Benchmark Baseline Gradle Plugin. ( b/404523257 )
সংস্করণ 1.3.3
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.3
is released. Version 1.3.3 contains these commits .
বাগ ফিক্স
- Fixed
CollectBaselineProfileTask
when AVD device has spaces in it ( Ia0225 , b/371642809 )
সংস্করণ 1.3.2
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.2
is released. Version 1.3.2 contains these commits .
বাগ ফিক্স
- Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. ( I2f678 , b/285187547 )
To use FTL apply the plugin to the baseline profile module in the plugin block, with:
plugins {
...
id("com.google.firebase.testlab")
}
and then configure firebase test lab with:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
Also the created FTL device needs to be added to the baseline profile extension:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.3.1
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.3.1
is released. Version 1.3.1 contains these commits .
বাগ ফিক্স
- Added gradle property
androidx.baselineprofile.suppressWarnings
to suppress all baseline profile warnings ( I7c36e , b/349646646 ) - Fixed Baseline Profile Gradle Plugin to use pre-existing
nonMinified…
andbenchmark…
if created by the app instead of creating wrappers. ( Ia8934 , b/361370179 ) - Fixed
java.lang.AssertionError: ERRORS (not suppressed): EMULATOR
whenautomaticGenerationDuringBuild
is enabled on emulators. New argument is used to instead skip the test. ( If3f51 , b/355515798 ) - Microbenchmark minification - keep subclasses of
org.junit.runner.notification.RunListener
in benchmark library proguard ( Ic8ed5 , b/354264743 ) - Fix
TraceSectionMetric
to Ignore non-terminating slices. Previously these were considered to have -1 duration, eg during summation or finding minimum duration. ( If74b7 ) - Fixed an issue in
FrameTimingGfxInfoMetric
where starting the metric would crash if the process wasn't already running. ( I6e412 )
সংস্করণ 1.3.0
21 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0
is released. Version 1.3.0 contains these commits .
Microbenchmark changes since 1.2.0
- Method tracing is on by default in microbenchmarks when running on most devices
- Method tracing runs as a separate phase, after measurements - this enables accurate measurements and method traces to both be output from a single benchmark run
- Method tracing on some Android OS and ART versions will affect later measurement phases - on these versions, method tracing is off by default and a warning is printed to Studio output
- Main thread benchmarks and ANRs
- Added
measureRepeatedOnMainThread
for UI thread benchmarks (eg those that interact with Compose/View UIs) to avoid ANRs when running for many seconds. - Method traces are skipped if expected to overrun the ANR avoidance deadline. Set
androidx.benchmark.profiling.skipWhenDurationRisksAnr
to false to disable this behavior (not recommended for CI runs, as ANRs can cause problem in long CI runs).
- Added
- মিনিফিকেশন
- Embedded proguard rules to improve microbenchmarking with minification enabled
- Minification/R8 in a library module requires AGP 8.3, and can be enabled via
android.buildTypes.release.androidTest.enableMinification
in yourbuild.gradle
- Experimental
BlackHole.consume()
API added to prevent dead code elimination ( If6812 , b/286091643 )
- মেট্রিক্স
- Experimental cpu event counter feature (metrics from
perf_event_open
, which requires root on most versions of the platform), access viaInstrumentationArgument
androidx.benchmark.cpuEventCounter.enable
(can be set totrue
), andandroidx.benchmark.cpuEventCounter.events
can be set eg to (Instructions,CpuCycles
). This should be supported on some userdebug emulators, but support has not been tested across all available emulators
- Experimental cpu event counter feature (metrics from
MACRObenchmark changes since 1.2.0
- Method tracing overhaul for macrobenchmarks.
- Now method traces are scoped to the duration of the
measureBlock
, and can capture multiple sessions if the process starts multiple times. - Previously, method tracing would only work for
StartupMode.COLD
benchmarks, and capture nothing formeasureBlocks
that didn't restart the target process - Fixed method traces flush in macrobenchmark, so that method traces should be fully captured and valid, even on slower devices. ( I6349a , b/329904950 )
- Now method traces are scoped to the duration of the
- Correctly dump ART profile during individual
warmUp
iterations when process is killed soCompilationMode.Partial(warmup=N)
measurements are more accurate. ( I17923 ) - Drop Shader broadcast failure message
- Added debugging suggestions to drop shader broadcast failure message
- Add two instrumentation arguments for overriding shader dropping behavior to workaround crashes when benchmarking apps without
ProfileInstaller
1.3:-
androidx.benchmark.dropShaders.enable=true/false
: can be used to skip all shader dropping (including that done inStartupMode.Cold
launches), esp when benchmarking apps that don't yet use profileinstaller 1.3 -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: can be used to tolerate failures when trying to drop shaders, for example when benchmarking apps without profileinstaller 1.3 ( I4f573 )
-
- Added experimental
MacrobenchmarkRule#measureRepeated
variant which takes a customPerfettoConfig
for fully customized Perfetto trace recording. Note that incorrectly configured configs may cause built in Metric classes to fail. ( Idfd3d , b/309841164 , b/304038384 ) - Cancel background dexopt jobs before running a Macrobenchmark to reduce interference. ( I989ed )
- Macrobenchmark now waits for 1 second for the target application to flush an ART profile (previously it waited for 500 ms). ( I85a50 , b/316082056 )
- TraceSectionMetric overhaul
- Note :
TraceSectionMetric
changes below can affect outputs in CI usage, and may create discontinuities, or break parsing - Sum is now the default, as most usage of this metric is for repeated events, and first would discard data in these cases
- Changed to be more customizable, with more available modes
- Mode names are now embedded in metric output name (in Studio and JSON)
- Now supports slices created using
Trace.{begin|end}AsyncSection
.
- Note :
- মেট্রিক্স
- Power - Added
PowerMetric.deviceSupportsHighPrecisionTracking
,PowerMetric.deviceBatteryHasMinimumCharge()
andPowerMetric.deviceSupportsPowerEnergy()
- Renamed
Metric.getResult
togetMeasurements
to match return type - Added log.w / exception labels to all startup detection failures. This does not change current behavior (so some errors throw, and others silently fail to detect the startup), just makes it more understandable. Generally the ones that
Log.w()
and fail to report startup metrics are those where non-frame events are missing, exceptions are thrown when startup is detected except for frame timing information (from UI/RT slices). ( Id240f , b/329145809 ) - Added
frameCount
measurement toFrameTimingMetric
to aid in discovery of scenarios where measurements change because the number of frames produced changed (new animations added, invalidation issues fixed). ( I1e5aa ) - Clarified that
frameOverrunMs
is the preferred metric for tracking when available in docs, and why. ( I18749 , b/329478323 ) - Fixes issue where unterminated frames at the beginning and end of the trace could be paired together, which would incorrectly report as a single extremely long frame. ( I39353 , b/322232828 )
- Improve
FrameTimingMetric
error when frames aren't produced, and always output link to trace when failing metric parsing to assist in diagnosing problem. ( I956b9 ) - Fixed crash in
FrameTimingMetric
failing to parse frame id, especially on certain OEM devices. ( Ia24bc , b/303823815 , b/306235276 ) - Relaxed strictness of checks in
FrameMetrics
, and added more detail to error messages. ( Iadede )
- Power - Added
Baseline Profile capture / Gradle plugin changes since 1.2.0
- Increased max recommended version of AGP to 9.0.0-alpha01.
- Ensure
mergeArtProfile
andmergeStartupProfile
tasks always wait for baseline profile generation. ( I623d6 , b/343086054 ) - Generating a baseline profile successfully will output a summary of what changed ( I824c8 , b/269484510 )
- Added DSL to disable warnings ( Ic4deb , b/331237001 )
- Fix to ensure benchmarks use generated baseline profiles when
automaticGenerationDuringBuild
is off ( Ic144f , b/333024280 ) - Fix
BaselineProfile
gradle plugin property overrides to enable baseline profile generation and benchmarking when customizing anonMinified
or benchmark build type. ( Ib8f05 , b/324837887 ) - Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15. ( I1d2af , b/313992099 )
- Fixed baseline and startup profile output url at the end of generation task. ( I802e5 , b/313976958 )
Other significant changes since 1.2.0
- Trace capture
- Reduced EXITCODE 2 error when starting perfetto from an error to logged warning
- Enable AIDL tracing by default in benchmarks(requires API 28) ( Ia0af2 , b/341852305 )
- Enable porter tag tracing by default in benchmarks. This captures, for example, wakelock tracepoints. ( Icfe44 , b/286551983 )
- Increased trace capture start timeout to avoid crashes when starting tracing on slower devices ( I98841 , b/329145808 )
- Added public API
PerfettoTraceProcessor.Session.queryMetrics
APIs with JSON, textproto, and proto binary (undecoded) variants. These allow you to query metrics built intoTraceProcessor
( I54d7f , b/304038382 ) - Enable blocking start on Perfetto trace record to reduce risk of missing data at beginning of trace. Only supported on API 33+. ( Ie6e41 , b/310760059 )
- JSON output
- Added additional information in benchmark context in JSON output:
-
context.artMainlineVersion
- integer version of Art mainline module (if present on device,-1
otherwise) -
context.build.id
- Equals android.os.Build.ID -
context.build.version.codename
- Equals android.os.Build.VERSION.CODENAME -
context.build.version.abbreviatedCodename
- corresponds to first letter of pre-release codename (including on release builds) ( Ie5020 )
-
- Added
profilerOutput
list to JSON output for easier tooling around profiling traces (eg Perfetto, Method traces) ( I05ddd , b/332604449 ) - Added a warning when Android Test Orchestrator is used in benchmark modules, as this will cause per-module output JSON files to be repeatedly overwritten. ( Ia1af6 , b/286899049 )
- Throw when filenames are longer than 200 chars to avoid unclear crashes when writing or post-processing files. ( I4a5ab )
- Added additional information in benchmark context in JSON output:
সংস্করণ 1.3.0-আরসি 01
7 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0-rc01
is released. Version 1.3.0-rc01 contains these commits .
বাগ ফিক্স
- Fix
androidx.benchmark.cpuEventCounter
producing corrupt values for non-Instruction events ( I7386a , b/286306579 ) - Fix
resumeTiming
/runWithTimingDisabled
to respect metric priority order, and significantly reduce impact of lower priority metric pause/resume on higher priority metric results. For example, if using cpu perf counters viacpuEventCounter.enable
instrumentation argument, timeNs is no longer significantly reduced when pause/resume occur. ( I39c2e , b/286306579 , b/307445225 ) - Reduced chance of stack sampling causing
measureRepeatedOnMainThread
from hitting main thread hard timeout by moving stack sampling conversion off main thread. ( I487a8 , b/342237318 ) - Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (eg R8 version 3.3) and for all builds when using AGP 8.1 or later (eg D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. আরো বিস্তারিত জানার জন্য এই নিবন্ধটি দেখুন. ( I9496c , b/345472586 )
- Added agp version check to send package name as instr arg. Previous to AGP 8.4.0 the target app package name cannot be send to the instrumentation app via instrumentation arguments. ( 0c72a3f )
সংস্করণ 1.3.0-BETA02
10 জুলাই, 2024
androidx.benchmark:benchmark-*:1.3.0-beta02
is released. Version 1.3.0-beta02 contains these commits .
বাগ ফিক্স
- Gracefully handle EXITCODE
2
when starting Perfetto to log a warning, but proceed.
সংস্করণ 1.3.0-BETA01
জুন 12, 2024
androidx.benchmark:benchmark-*:1.3.0-beta01
is released. Version 1.3.0-beta01 contains these commits .
এপিআই পরিবর্তন
- Renamed
MethodTracing.affectsMeasurementOnThisDevice
toAFFECTS_MEASUREMENT_ON_THIS_DEVICE
for consistency. ( I1bdfa ) - Added experimental
BlackHole.consume()
api to prevent dead code elimination in microbenchmarks. ( If6812 , b/286091643 ) - Microbenchmark will now correctly throw to prevent method tracing from interfering with measurements. This occurs on certain devices when method tracing is forced on (via instrumentation args or
MicrobenchmarkConfig
), and if a measurement is attempted after a method trace. Affected devices are running API 26-30 or certain ART mainline module versions affected by this interference, and can be detected at runtime viaProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice
. ( Iafb92 , b/303660864 )
বাগ ফিক্স
- Bumped max agp version recommended to 9.0.0-alpha01. ( I5bbb0 )
- Added compilation mode to benchmark context ( If5612 , b/325512900 )
- Enable AIDL tracing by default (requires API 28) ( Ia0af2 , b/341852305 )
- Added additional information in benchmark context in JSON output:
-
context.artMainlineVersion
- integer version of Art mainline module (if present on device, -1 otherwise) -
context.build.id
- Equalsandroid.os.Build.ID
-
context.build.version.codename
- Equalsandroid.os.Build.VERSION.CODENAME
-
context.build.version.abbreviatedCodename
- corresponds to first letter of pre-release codename (even on release builds) ( Ie5020 )
-
- Fixes
StackSampling
to respectandroidx.benchmark.profiling.sampleDurationSeconds
( Ib1d53 ) - Change macro->common dependency to be
api()
, so it's easier to use egPerfettoTrace
andPerfettoConfig
. ( Icdae3 , b/341851833 ) - Ensure
mergeArtProfile
andmergeStartupProfile
tasks always wait for baseline profile generation. ( I623d6 , b/343086054 ) - Consider variant enable state when deciding whether variant should be enabled. ( I5d19e , b/343249144 )
- Increased default start timeout for perfetto trace processor. ( I87e8c , b/329145808 )
Version 1.3.0-alpha05
14 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha05
is released. Version 1.3.0-alpha05 contains these commits .
বাগ ফিক্স
- Throw clearer exception when macrobench metric returns zero values for all iterations ( Iab58f , b/314931695 )
- Additional workaround rules added to microbench proguard rules, including support for listener rules and other observed warnings / errors. ( I14d8f , b/329126308 , b/339085669 )
- Method tracing runs as a separate phase during a Macrobenchmark, and it no longer affects measurements. ( If9a50 , b/285912360 , b/336588271 )
- Added extra debugging suggestions to drop shader broadcast failure message. ( I5efa6 , b/325502725 )
Version 1.3.0-alpha04
1 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha04
is released. Version 1.3.0-alpha04 contains these commits .
এপিআই পরিবর্তন
- Added experimental
MacrobenchmarkRule#measureRepeated
variant which takes a customPerfettoConfig
for fully customized Perfetto trace recording. Note that incorrectly configured configs may cause built in Metric classes to fail. ( Idfd3d , b/309841164 , b/304038384 ) - Rename
PowerMetric.deviceSupportsPowerEnergy
toPowerMetric.deviceSupportsHighPrecisionTracking
for clarity ( I5b82f ) - Added
PowerMetric.deviceBatteryHasMinimumCharge()
andPowerMetric.deviceSupportsPowerEnergy()
to enable changing or skipping benchmarks based on device power measurement capability. ( I6a591 , b/322121218 )
বাগ ফিক্স
- Added comparison with previous baseline profile ( I824c8 , b/269484510 )
- Added DSL to disable warnings ( Ic4deb , b/331237001 )
- Changed exception to info log when benchmark variants are disabled ( I8a517 , b/332772491 )
- Make it simpler to capture method traces for a Macrobenchmark is scoped to the duration of the actual
measureBlock()
. Previously, it started at target process launch and only supported cold starts ( Iee85a , b/300651094 ) - Avoid crashing when perfetto trace processor is slow to start ( I98841 , b/329145808 )
সংস্করণ 1.3.0-আলফা 03
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha03
is released. Version 1.3.0-alpha03 contains these commits .
নতুন বৈশিষ্ট্য
- Adds public API
PerfettoTraceProcessor.Session.queryMetrics
APIs with JSON, textproto, and proto binary (undecoded) variants. These allow you to query metrics built into TraceProcessor ( I54d7f , b/304038382 ) - Added
profilerOutput
to JSON output for easier tooling around profiling traces (eg perfetto, method traces). ( I05ddd , b/332604449 ) - Added power tag to benchmark Perfetto Config. This captures, for example, wakelock tracepoints. ( Icfe44 , b/286551983 )
- Added inst argument
androidx.benchmark.profiling.skipWhenDurationRisksAnr
, can be set to false to avoid skipping method traces when expected duration may cause an ANR - strongly recommended to avoid in CI runs. - Added experimental inst argument
androidx.benchmark.profiling.perfCompare.enable
, set this to true to run comparison timing between measurement and profiling phases. Useful in eg evaluating overhead of method tracing. ( I61fb4 , b/329146942 )
এপিআই পরিবর্তন
- Changed
TraceSectionMetric.Mode
to sealed class to enable future expansion without breaking exhaustive when statements ( I71f7b ) - Added
TraceSectionMetric.Mode.Average
and.Count
, and reordered args so the more common argument (mode) was earlier in the arg list, reducing need for specifying parameter names. ( Ibf0b0 , b/315830077 , b/322167531 ) - Renamed
Metric.getResult
togetMeasurements
to match return type ( I42595 )
বাগ ফিক্স
- Fix to ensure benchmarks use generated baseline profiles when
automaticGenerationDuringBuild
is off ( Ic144f , b/333024280 ) - Fix
BaselineProfile
gradle plugin property overrides to enable baseline profile generation and benchmarking when customizing anonMinified
or benchmark build type. ( Ib8f05 , b/324837887 ) - Fixed method traces flush in macrobenchmark, so that method traces should be fully captured and valid, even on slower devices. ( I6349a , b/329904950 )
- Enable blocking start on Perfetto trace record to reduce risk of missing data at beginning of trace. Only supported on API 33+. ( Ie6e41 , b/310760059 )
- Added a warning when Android Test Orchestrator is used in benchmark modules, as this will cause per-module output JSON files to be repeatedly overwritten. ( Ia1af6 , b/286899049 )
- Force ',' (comma) thousands separators for consistency in Studio output, ignoring device locale ( I3e921 , b/313496656 )
-
TraceSectionMetric
now supports slices created usingTrace.{begin|end}AsyncSection
. ( I91b32 , b/300434906 ) - Added log.w / exception labels to all startup detection failures. This does not change current behavior (so some errors throw, and others silently fail to detect the startup), just makes it more understandable. Generally the ones that
Log.w()
and fail to report startup metrics are those where non-frame events are missing, exceptions are thrown when startup is detected except for frame timing information (from UI/RT slices). ( Id240f , b/329145809 ) - Cancel background dexopt jobs before running a Macrobenchmark to reduce interference. ( I989ed )
- Added
frameCount
measurement toFrameTimingMetric
to aid in discovery of scenarios where measurements change because the number of frames produced changed (new animations added, invalidation issues fixed). ( I1e5aa ) - Clarified that
frameOverrunMs
is the preferred metric for tracking when available in docs, and why. ( I18749 , b/329478323 )
সংস্করণ 1.3.0-আলফা 02
20 মার্চ, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha02
is released. Version 1.3.0-alpha02 contains these commits .
নতুন বৈশিষ্ট্য
Experimental R8 support in microbench via embedded proguard rules. Note that this support is experimental, and requires AGP 8.3 for minification of library module tests. Use the following to enable R8 minification/optimization in your benchmark module's
build.gradle
, which should lead to a significant performance increase, depending on workload. ( I738a3 , b/184378053 )android { buildTypes.release.androidTest.enableMinification = true }
বাগ ফিক্স
- Fixes method tracing warning to be on separate line from microbench output. ( I0455c , b/328308833 )
Version 1.3.0-alpha01
ফেব্রুয়ারি 21, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha01
is released. Version 1.3.0-alpha01 contains these commits.
এপিআই পরিবর্তন
- Renamed
MicrobenchmarkConfig
boolean parameters to avoid unnecessary word 'should' ( Ia8f00 , b/303387299 ) - Added
BenchmarkRule.measureRepeatedOnMainThread
so main thread benchmarks (eg ones touching Views or Compose UIs) can avoid triggering ANRs, especially during large suites in CI. ( I5c86d ) - Added
FrameTimingGfxInfoMetric
, an experimental alternate implementation ofFrameTimingMetric
with measurements coming directly from the platform, rather than extracted from the Perfetto trace. ( I457cb , b/322232828 ) - Add the ability to dump an ART profile during individual
warmUp
iterations. ( I17923 ) - Several changes to
TraceSectionMetric
API:- Add
Mode.Min
,Mode.Max
- Add label argument to override section name as metric label
- Added mode name to output to clarify metric meaning
- Changed default to sum, as most usage of this metric is for repeated events Be aware of this changes in CI usage, as it may create discontinuities or break parsing. ( Ic1e82 , b/301892382 , b/301955938 )
- Add
বাগ ফিক্স
- Improved error message in baseline profile gradle plugin when specified managed device does not exist ( Idea2b , b/313803289 )
- Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15 ( I1d2af , b/313992099 )
- Fixed baseline and startup profile output url at the end of generation task ( I802e5 , b/313976958 )
- Adjusted data source timeouts to attempt to fix
java.lang.IllegalStateException: Failed to stop [ProcessPid(processName=perfetto, pid=...)]
( I8dc7d , b/323601788 ) - Add two instrumentation arguments for overriding shader dropping behavior to workaround crashes when benchmarking apps without
ProfileInstaller
1.3:-
androidx.benchmark.dropShaders.enable=true/false
: can be used to skip all shader dropping (including that done inStartupMode.Cold
launches), esp when benchmarking apps that don't yet use profileinstaller 1.3 -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: can be used to tolerate failures when trying to drop shaders, for example when benchmarking apps without profileinstaller 1.3 ( I4f573 )
-
- Skip method tracing on UI thread when expected to take longer than a few seconds, and cleanup method traces when throwing. ( I6e768 )
- Throw when filenames are longer than 200 chars to avoid unclear crashes when writing or post-processing files. ( I4a5ab )
- Fixes issue where unterminated frames at the beginning and end of the trace could be paired together, which would incorrectly report as a single extremely long frame. ( I39353 , b/322232828 )
- Use
--skip verification
on API 30+ when reinstalling a package on API 30-33 to clear ART profiles on user builds. This helps bypass Play Protect warnings that cause failures on some class of devices. ( Ic9e36 ) - Use
am force-stop
to kill apps when not a system app like System UI or Launcher. ( I5e028 ) - Macrobenchmark now waits for
1 second
for the target application to flush an ART profile (previously it waited for500 ms
). ( I85a50 , b/316082056 ) - Improve
FrameTimingMetric
error when frames aren't produced, and always output link to trace when failing metric parsing to assist in diagnosing problem. ( I956b9 ) - Fixed crash in
FrameTimingMetric
failing to parse frame id, especially on certain OEM devices. ( Ia24bc , b/303823815 , b/306235276 ) - Relaxed strictness of checks in
FrameMetrics
, and added more detail to error messages. ( Iadede )
সংস্করণ 1.2
সংস্করণ 1.2.4
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.2.4
is released. Version 1.2.4 contains these commits .
বাগ ফিক্স
- Fixes baseline profile srcset not being set up in benchmark variants. Also fixes
automaticGenerationDuringBuild
in libraries causing a circular dependency. ( I28ab7 , b/333024280 ) - Use
am force-stop
to kill apps when not a system app like System UI or Launcher. This fixesStartupMode.COLD
benchmarks crashing from "Package $package must not be running prior to cold start!" due to process kill not fully succeeding. ( I5e028 )
সংস্করণ 1.2.3
24 জানুয়ারী, 2024
androidx.benchmark:benchmark-*:1.2.3
is released. Version 1.2.3 contains these commits.
বাগ ফিক্স
- Removed exception from Baseline Profile Gradle Plugin when AGP version is 8.3.0 or higher.
- Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15.
সংস্করণ 1.2.2
ডিসেম্বর 1, 2023
androidx.benchmark:benchmark-*:1.2.2
is released. Version 1.2.2 contains these commits.
Baseline Profiles
- Execution logs will show the baseline profile output file path as a local file URI ( aosp/2843918 , aosp/2853665 , b/313976958 )
সংস্করণ 1.2.1
15 নভেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.1
is released. Version 1.2.1 contains these commits.
নতুন বৈশিষ্ট্য
- Improved error message when user disables test variants ( b/307478189 )
- Added properties to support AS test run integration ( b/309805233 ), ( b/309116324 )
সংস্করণ 1.2.0
18 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0
is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
Baseline Profiles
- New Baseline Profile Gradle Plugin automates capturing and including baseline profiles in your test and build workflow.
-
BaselineProfileRule.collect
now stable, a streamlined and simplified version of the previous experimentalBaselineProfileRule.collectBaselineProfile
API- Just specify
packageName
, and drive your app
- Just specify
- For libraries generating baseline profiles, you can now filter the rules generated either in code (
BaselineProfileRule.collect
argument), or even more simply in the gradle plugin - সংশোধন করে
- Fixed baseline profile collection on Android U+ ( Id1392 , b/277645214 )
Macrobenchmark
- সংকলন
- Macrobenchmark now correctly fully resets compilation state for each compile - this requires reinstalling the APK prior to Android 14, so benchmarking on Android 14+ is strongly recommended if you want to persist state (like user login) in what's being measured.
- You can also work around this by controlling app compilation separately, and skipping compilation with
CompilationMode.Ignore()
or instrumentation argument
Instrumentation Arguments
- Support for
androidx.benchmark.dryRunMode.enable
instrumentation argument, (already available in microbenchmark) for quicker validation runs (eg when creating the benchmark, or in presubmit) - Support for
androidx.benchmark.profiling.mode=StackSampling
andMethodTracing
. - Added
androidx.benchmark.enabledRules
to allow runtime filtering baseline profile vs macrobenchmark rule tests - Added
androidx.benchmark.perfettoSdkTracing.enable
argument to enable tracing with tracing-perfetto, eg Compose recomposition tracing. Note that when used withStartupMode.COLD
, timing will be significantly affected as the tracing library is loaded and enabled during app startup.
- Support for
প্রয়োজনীয়তা
- Macrobenchmark now requires
ProfileInstaller
1.3.0 or greater in the target app, to enable profile capture / reset, and shader cache clearing.
- Macrobenchmark now requires
New Experimental Metric APIs
- Added experimental
TraceSectionMetric
, which allows for extracting simple timing fromtrace("") {}
blocks in your app, or TraceMetric for leveraging the full query capability of PerfettoTraceProcessor
. - Added experimental
PowerMetric
to capture power usage information - Added experimental
MemoryCountersMetric
to count page faults - Added experimental
PerfettoTraceProcessor
API, which is used internally to extract metrics from System traces (aka Perfetto traces)
- Added experimental
সংশোধন করে
- Fixed crashes when installing or extracting profiles from an app installed from multiple APKs (eg from app bundle).
- Fixed
FrameTimingMetric
ignoring frames with inconsistent frame IDs (generally, frames during ripples on API 31+) ( I747d2 , b/279088460 ) - Fixed parsing errors on traces > 64MB ( Ief831 , b/269949822 )
- Clarified errors when device (especially emulator) OS image not correctly configured for tracing, or compilation
- Skip battery level check for devices without battery (micro and macro)
- Improved file output, with more clear errors for invalid output directories, and safer defaults
- Improved stability of
StartupMode.COLD
by consistently dropping the shader cache (also exposed viaMacrobenchmarkScope.dropShaderCache
) - Fixed leanback fallback for
startActivityAndWait
.
Microbenchmark
- বৈশিষ্ট্য
- Profiling was moved to a separate phase, after other metrics, so one test run can display both accurate timing and profiling results.
- পরীক্ষামূলক API
- Added experimental
MicrobenchmarkConfig
API for defining custom metrics and configuring tracing and profiling. Can be used to capture method traces, or capture tracepoints (but be aware of tracing overhead). - Added experimental APIs for controlling
BenchmarkState
separately fromBenchmarkRule
, without JUnit - Added experimental
PerfettoTrace
record to enable capturing Perfetto traces, with custom configuration, separate from benchmark APIs.
- Added experimental
- সংশোধন করে
- Workaround missing leading whitespaces in Android Studio benchmark output.
- Fix issue where warnings could fail to print in Android Studio benchmark output.
- Fixed
SampledProfiling
crash on Android 13 (API 33) and higher. - Massively improved performance of
dryRunMode
by skippingIsolationActivity
and Perfetto tracing (Up to 10x faster dry run mode on older OS versions).
Version 1.2.0-rc02
6 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc02
is released. Version 1.2.0-rc02 contains these commits.
বাগ ফিক্স
- Fix Benchmark file output to no longer break
BaselineProfile
Plugin file copying. Files were generated and copied off device, but had been renamed such that the gradle plugin wouldn't see them. ( I8dbcc , b/303034735 , b/296453339 ) - Clarified
tracing-perfetto
loading error messages when injecting from macrobenchmark module into target application.
Version 1.2.0-rc01
20 সেপ্টেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc01
is released. Version 1.2.0-rc01 contains these commits.
বাগ ফিক্স
- An exception (with remedy instructions) is now thrown when Perfetto SDK tracing fails to initialize in a Benchmark. ( I6c878 , b/286228781 )
- Fix OOM crash when converting ART method trace -> perfetto format. ( I106bd , b/296905344 )
- (Macrobenchmark) Clarified method tracing label when linked in Studio test output, and fixed method tracing filenames to be unique on device/host, so they won't be overwritten when more than one benchmark is run. ( I08e65 , b/285912360 )
- Ensures that the device is awake when capturing a baseline profile. ( I503fc )
Version 1.2.0-beta05
30 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta05
is released. Version 1.2.0-beta05 contains these commits.
নতুন বৈশিষ্ট্য
- The Baseline Profile Gradle Plugin now supports Android Gradle Plugin 8.3. ( aosp/2715214 )
Version 1.2.0-beta04
23 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta04
is released. Version 1.2.0-beta04 contains these commits.
নতুন বৈশিষ্ট্য
- The Baseline Profiles Gradle plugin now supports Android Gradle Plugin 8.3. ( aosp/2715214 )
বাগ ফিক্স
- Fix failures in writing / moving and pulling files (especially those from parameterized tests) by sanitizing output file names further, avoiding '=' and ':' in output file names. ( I759d8 )
Version 1.2.0-beta03
9 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta03
is released. Version 1.2.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added argument to filter
TraceSectionMetric
to only the target package, on by default ( Ia219b , b/292208786 )
বাগ ফিক্স
- Renamed
fullTracing.enable
instrumentation argument toperfettoSdkTracing.enable
for consistency with artifact name, and other references.fullTracing.enable
will continue to work as a fallback. ( I7cc00 ) - Benchmark library internal tracepoints (including microbenchmark loop/phase tracing) will now show up in Studio system trace viewer, and nest under the correct process in Perfetto. ( I6b2e7 , b/293510459 )
- Removed macrobenchmark NOT-PROFILEABLE error on API 31+, and skip profileable check on eng/userdebug rooted devices. ( I2abac , b/291722507 )
- When using Dex Layout Optimizations, startup profile rules are also now considered as baseline profile rules. ( aosp/2684246 , b/293889189 )
Version 1.2.0-beta02
জুলাই 26, 2023
androidx.benchmark:benchmark-*:1.2.0-beta02
is released. Version 1.2.0-beta02 contains these commits.
এপিআই পরিবর্তন
- Added experimental APIs for microbench custom metrics and configuration (eg profiler, and tracing). ( I86101 , b/291820856 )
বাগ ফিক্স
- Report error in macrobench when OS is misconfigured for tracing, as was recently fixed in API 26/28 ARM64 emulators. ( I0a328 , b/282191686 )
- Added detail to compilation reset failure to suggest updating emulator, as some emulators have recently fixed this issue. ( I8c815 , b/282191686 )
- Make
androidx.test.uiautomator:uiautomator:2.2.0
anapi
instead of animplementation
dependency. ( I1981e )
Version 1.2.0-beta01
18 জুলাই, 2023
androidx.benchmark:benchmark-*:1.2.0-beta01
is released. Version 1.2.0-beta01 contains these commits.
বাগ ফিক্স
- Fix warnings being sometimes suppressed in Benchmark output in Studio, and workaround leading whitespaces from Benchmark output not showing up in Studio ( Ia61d0 , b/227205461 , b/286306579 , b/285912360 )
- Fixed comment for
FrameTimingMetric
. The submetric is namedframeDurationCpuMs
. ( Ib097f , b/288830934 ).
Version 1.2.0-alpha16
জুন 21, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha16
is released. Version 1.2.0-alpha16 contains these commits.
এপিআই পরিবর্তন
-
BaselineProfileRule.collectBaselineProfile()
API has been renamed toBaselineProfileRule.collect()
. ( I4b665 )
বাগ ফিক্স
- Macrobenchmark support for
androidx.benchmark.profiling.mode = MethodTracing
. ( I7ad37 , b/285912360 ) - Microbenchmark profiling moved to a separate phase, so it occurs in sequence after measurement, instead of replacing it.
MethodTracing
trace sections are also now included in the captured Perfetto trace, if present. ( I9f657 , b/285014599 ) - Add count measurement to
TraceSectionMetric
withMode.Sum
. ( Ic121a , b/264398606 )
Version 1.2.0-alpha15
7 জুন, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha15
is released. Version 1.2.0-alpha15 contains these commits.
নতুন বৈশিষ্ট্য
- Added experimental
MemoryUsageMetric
for tracking memory usage of a target application. ( I56453 , b/133147125 , b/281749311 ) - Add support for fully custom Perfetto configs with
PerfettoTrace.record
( If9d75 , b/280460183 ) - Added property to skip baseline profile generation. Usage:
./gradlew assemble -Pandroidx.baselineprofile.skipgeneration
. ( I37fda , b/283447020 )
এপিআই পরিবর্তন
- The
collectBaselineProfile
API always generates stable baseline profiles. ThecollectStableBaselineProfile
API has been removed andcollectBaselineProfile
should be used instead. ( I17262 , b/281078707 ) - Changed
BaselineProfileRule
'sfilterPredicate
arg to non-null, with a equivalent default value so that the default filter behavior is more clear in docs. ( I3816e )
বাগ ফিক্স
- Disable
IsolationActivity
and Perfetto tracing indryRunMode
to significantly improve performance, as these were majority of runtime. ( Ie4f7d ) - Support for call stack sampling in Macrobenchmarks using instrumentation test arguments
androidx.benchmark.profiling.mode=StackSampling
andandroidx.benchmark.profiling.sampleFrequency
. ( I1d13b , b/282188489 ) - Fixes crash when dropping shaders on Android U (API 34), as well as on emulators. ( I031ca , b/274314544 )
Version 1.2.0-alpha14
3 মে, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha14
is released. Version 1.2.0-alpha14 contains these commits.
বাগ ফিক্স
- Fix
FrameTimingMetric
ignoring frames with inconsistent frame IDs. This would cause some animations on recent platform versions (API 31+) to ignore many frames whileRenderThread
was animating (eg during a ripple). ( I747d2 , b/279088460 ) - Fixed trace processor parsing for traces larger than 64Mb. ( Ief831 , b/269949822 )
- Fixed baseline profile generation on Android U failing because of the different output of
pm dump-profiles
command. ( Id1392 , b/277645214 ) - Fix GPU clock locking script to compare strings correctly ( I53e54 , b/213935715 )
Version 1.2.0-alpha13
5 এপ্রিল, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha13
is released. Version 1.2.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Added profile type parameter when generating baseline profiles to support upcoming startup profile feature ( Ie20d7 , b/275093123 )
- Added new experimental
TraceMetric
API for defining fully custom metrics based on content of a Perfetto trace. ( I4ce31 , b/219851406 ) - Add an experimental metric to determine the number of page faults during a benchmark. ( I48db0 )
Version 1.2.0-alpha12
22 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha12
is released. Version 1.2.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- The new baseline profile gradle plugin is released in alpha version, making it easier to generate a baseline profile and simplifying the developer workflow.
এপিআই পরিবর্তন
- Removed Perfetto tracing support on API 21 and 22, which includes both Microbenchmarks and the experimental
PerfettoTrace
APIs. Prior to this version,UiAutomation
connections were unreliable on some devices. ( I78e8c ) - Added public experimental API for
PerfettoTraceProcessor
to enable parsing trace content. This is a step toward fully custom metrics based on Perfetto trace data. ( I2659e , b/219851406 )
Version 1.2.0-alpha11
8 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha11
is released. Version 1.2.0-alpha11 contains these commits.
বাগ ফিক্স
- Fixed crashes in
MacrobenchmarkRule
andBaselineProfileRule
when reinstalling or extracting profiles from an app bundle with multiple APKs. ( I0d8c8 , b/270587281 )
Version 1.2.0-alpha10
22 ফেব্রুয়ারি, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha10
is released. Version 1.2.0-alpha10 contains these commits.
নতুন বৈশিষ্ট্য
- On Android 14+, Macrobenchmark no longer reinstalls target applications to reset compilation state, thanks to a new platform feature. Previously it was necessary to have a rooted device, or to deal with all application state (eg user login) being removed before each benchmark runs. ( I9b08c , b/249143766 )
বাগ ফিক্স
- Fix
DryRunMode
to no longer crash with empty profile, due to compilation skipping. Instead, it runs a single iteration and extracts the profile to ensure something is captured. ( I2f05d , b/266403227 ) - Fix
PowerMetric
crash when checking for powerstats presence on old API levels. ( 5faaf9 , b/268253898 )
Version 1.2.0-alpha09
11 জানুয়ারী, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha09
is released. Version 1.2.0-alpha09 contains these commits.
বাগ ফিক্স
- Enabled passing
None
toandroidx.benchmark.enabledRules
instrumentation arg to disable all benchmarks / baseline profile generation. ( I3d7fd , b/258671856 ) - Fix
PerfettoTrace
capture in app modules (ie non-self-instrumenting test APKs) ( I12cfc ) - Fixed baseline profile adb pull argument order in Studio output ( I958d1 , b/261781624 )
- Arm emulator api 33 is now correctly recognized as such when trying to run a macrobenchmark and will correctly print the warning. ( 69133b , b/262209591 )
- Skip battery level check on devices without battery in Macrobenchmark ( fe4114 , b/232448937 )
Version 1.2.0-alpha08
7 ডিসেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha08
is released. Version 1.2.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- পরীক্ষার আচরণ এবং কর্মক্ষমতা পরিদর্শন করতে পরীক্ষার অংশ হিসাবে পারফেটো ট্রেসগুলি (সিস্টেম ট্রেস হিসাবেও পরিচিত) ক্যাপচার করতে পরীক্ষামূলক নতুন এপিআইএস
PerfettoTrace.record {}
এবংPerfettoTraceRule
যুক্ত করা হয়েছে। ( I3ba16 ) -
BaselineProfileRule
now accepts a filter predicate instead of a list of package prefixes. This gives the test full control on filtering. ( I93240 ) - Add an experimental API
BaselineProfileRule.collectStableBaselineProfile
which waits until a baseline profile is stable for N iterations. ( I923f3 ) - Add the ability to specify an output file name prefix when generating baseline profiles using
BaselineProfileRule
. ( I7b59f , b/260318655 )
বাগ ফিক্স
- Improve safety of file output writing, which should prevent output files from silently not being written / appended, especially on API 21/22. ( If8c44 , b/227510293 )
- Fix
simpleperf
trace output to create and place the file correctly. This should also more generally fix issues where a file is unsuccessfully pulled by gradle. ( I12a1c , b/259424099 ) - Improve profileinstaller error message printed when profileinstaller is too old. This now tells you to update profileinstaller version (1.2.1) for measuring baseline profiles on API 31 through 33, instead of saying it's not supported. ( Ia517f , b/253519888 )
- Fix several shell command failures onerror message Print needed API <=23, including failed perfetto capture binary setup and trace capture failures ( Ib6b87 , b/258863685 )
- Automatically sort generated profile rules to minimize the number of changes as they change over time (when checking-in profile rules into source control). ( Ie2509 )
- Fixed crash on unrooted builds below Android 13 (API 33) with message
Expected no stderr from echo 3 > /proc/sys/vm/drop_caches
( I6c245 , b/259508183 )
Known Issues - MacrobenchmarkScope.dropShaderCache()
may crash due to a missing broadcast registry in profileinstaller manifest, which has not yet been released. ( I5c728 , b/258619948 ) To workaround the issue in profileinstaller:1.3.0-alpha02
, add the following to your application's (not your benchmark's) AndroidManifest.xml:
<!-- workaround bug in profileinstaller 1.3.0-alpha02, remove when updating to alpha03+ -->
<receiver
android:name="androidx.profileinstaller.ProfileInstallReceiver"
android:permission="android.permission.DUMP"
android:exported="true">
<intent-filter>
<action android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
</intent-filter>
</receiver>
Version 1.2.0-alpha07
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha07
is released. Version 1.2.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Adds
PowerMetric
API for measuring energy and power in Macrobenchmarks. ( Ife601 , b/220183779 ) - Fixed
MacrobenchmarkScope.dropShaderCache()
to actually drop the shader cache. This removes roughly 20ms of noise fromStartupMode.COLD
benchmarks, as shaders are now consistently cleared each iteration. Previously,Partial
compilation using warmup iterations would report incorrectly fast numbers, as shader caching was more likely to happen during warmup. This fix requires either a rooted device, or usingprofileinstaller:1.3.0-alpha02
in the target app. ForProfileInstaller
library's API changes, please refer to ProfileInstaller 1.30-alpha02 page. ( Ia5171 , b/231455742 ) - Added
TraceSectionMode("label", Mode.Sum)
, allowing measurement of total time spent on multiple trace sections with the same label. For instance,TraceSectionMetric("inflate", Mode.Sum)
will report a metricinflateMs
for the total time in a macrobenchmark spent on inflation. Also removed API 29 requirement, asTraceSectionMetric
works together withandroidx.tracing.Trace
back to lower API levels, with the use offorceEnableAppTracing
within the target app. ( Id7b68 , b/231455742 )
বাগ ফিক্স
- Improved safety of all internal shell commands by validating all output/errors. ( I5984d , b/255402908 , b/253094958 )
- Specify device in baseline profile
adb pull
command, so the pull command can be simply copied if multiple devices are connected (up to one emulator) ( I6ac6c , b/223359380 ) - Add error if macrobenchmark test apk isn't set up as self-instrumenting. This error prevents macrobenchmarking from within the target app's process. In process, macrobench wouldn't be able to compile/kill/cold start the app, or control its own permissions ( I4279b )
- Fixed an issue in
measureRepeated()
whereStartupMode.COLD
wouldn't kill the target process aftersetupBlock
. NowsetupBlock
interacting with the app will not leave the app process running, and an invalid cold start measurement. ( I8ebb7 )
Version 1.2.0-alpha06
24 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha06
is released. Version 1.2.0-alpha06 contains these commits.
এপিআই পরিবর্তন
-
BaselineProfileRule
no longer requires root on Android 13 (API 33), and is no longer experimental. ( Ie0a7d , b/250083467 , b/253094958 )- This change also fixes how profiles from an app are flushed to disk on unrooted devices, but requires updating the target app's profileinstaller dependency.
- To use
BaselineProfileRule
orCompilationMode.Partial(warmupIterations)
on an unrooted device, you must also update your target app to useandroidx.profileinstaller.profileinstaller:1.3.0-alpha01
. This enables flushing the profile to disk correctly, so that it can be compiled/extracted.
বাগ ফিক্স
- Fixes
SampledProfiling
crash on API 33+. ( I40743 , b/236109374 )
Version 1.2.0-alpha05
5 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha05
is released. Version 1.2.0-alpha05 contains these commits.
বাগ ফিক্স
- Fix frame breakdown in Studio system trace viewer for benchmark captured traces ( I3f3ae , b/239677443 )
- Correct
FrameTimingMetric
to listFrameOverrun
as requiring API 31 instead of 29 ( I716dd , b/220702554 ) - Set iteration in
BaselineProfileRule
, and throw clearly if target package not installed (was already done for MacrobenchmarkRule). ( Ic09a3 , b/227991471 )
Version 1.2.0-alpha04
21শে সেপ্টেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha04
is released. Version 1.2.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
Add support for
dryRunMode.enable
instrumentation argument to macrobenchmark (already available in micro) for faster local development, and validating app automation (eg in presubmit). This overrides iterations to 1, skips compilation, suppresses all configuration errors , and disables measurement .json file output. ( Ib51b4 , b/175149857 )On Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.dryRunMode.enable=true
In build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.dryRunMode.enable', 'true' } }
বাগ ফিক্স
- Fixed
StartupTimingMetric
to no longer require measured Activities to be launched throughMacrobenchmarkScope.startActivityAndWait()
. This means the metric can pick up launches from eg notifications,Context.startActivity()
, in-app Activity based navigation, or shell commands. ( Ia2de6 , b/245414235 ) - Fix bug where
startActivityAndWait
would timeout trying to wait for launch completion on emulators by reducing strictness of frame detection. ( Ibe2c6 , b/244594339 , b/228946895 )
Version 1.2.0-alpha03
7 সেপ্টেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha03
is released. Version 1.2.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added experimental APIs for using
BenchmarkState
independently, separate fromBenchmarkRule
/JUnit4
. ( Id478f , b/228489614 )
বাগ ফিক্স
- Added Leanback fallback for
startActivityAndWait
. ( 01ed77 , b/242899915 )
Version 1.2.0-alpha02
24 আগস্ট, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha02
is released. Version 1.2.0-alpha02 contains these commits.
এপিআই পরিবর্তন
- Default to
am force stop
forMacrobenchmarkScope.killProcess()
, even when rooted, except during Baseline Profile generation. This can be overridden with an optional boolean argument. ( 02cce9 , b/241214097 )
বাগ ফিক্স
- Support baseline profile generation for System apps. ( I900b8 , b/241214097 )
- Support checking for ODPM power metrics on unrooted devices. ( a38c78 , b/229623230 )
Version 1.2.0-alpha01
জুলাই 27, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha01
is released. Version 1.2.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- New tracing-perfetto-common component allowing tooling to enable Perfetto SDK tracing in an app that exposes it ( I2cc7f )
Added
androidx.benchmark.enabledRules
instrumentation argument to enable filtering macrobenchmark runs to just benchmarks, or just baseline profile generation. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when just generatingBaselineProfiles
on an emulator. Comma-separated list also Supported. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
এপিআই পরিবর্তন
- Added new
PowerMetric
for measuring energy and power tasks in benchmarks. ( I9f39b , b/220183779 ) - Added a new compilation mode
CompilationMode.Ignore
to skip profile reset and compilation. ( Ibbcf8 , b/230453509 ) - Added a new parameter to
BaselineProfileRule#collectBaselineProfile
to filter output file by package names ( If7338 , b/220146561 ) - Enables developer to discharge device to measure power drain. ( I6a6cb )
- Added the ability to clear shader cache in
MacrobenchmarkScope
. ( I32122 ) - Enables developer to configure display of metric type and detail desired subsystem categories. ( I810c9 )
- Previously an
UnsupportedOperationException
was thrown in the benchmark if run on an unsupported device. Now UOE only occurs if the metric is used on the unsupported device (ie:PowerMetric.configure
). ( I5cf20 , b/227229375 ) - Added
TotalPowerMetric
andTotalEnergyMetric
for measuring total power and energy in each system category in macrobenchmarks. ( I3b26b , b/224557371 )
বাগ ফিক্স
- Fixed an issue where compiled methods were not correctly being reset between each macrobenchmark on unrooted builds. This unfortunately requires reinstalling the apk each iteration, which will clear application data for each macrobenchmark. ( I31c74 , b/230665435 )
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 , b/227510293 , b/227512788 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
Version 1.1.1
Version 1.1.1
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.1.1
is released. Version 1.1.1 contains these commits.
বাগ ফিক্স
- Fixes
android.system.ErrnoException: open failed: EACCES
which would occur on some Android11 (API 30)+ devices. This is a cherry-pick of a fix from1.2.0-alpha01
. ( aosp/2072249 )
সংস্করণ 1.1.0
সংস্করণ 1.1.0
15 জুন, 2022
androidx.benchmark:benchmark-*:1.1.0
is released. Version 1.1.0 contains these commits.
- This version is identical to
androidx.benchmark:benchmark-*:1.1.0-rc03
.
Important changes since 1.0.0
Support for Jetpack Macrobenchmarks, which allows you to measure whole-app interactions like startup and scrolling , provides the ability to capture traces & measure trace sections .
Support for Baseline Profiles
-
CompilationMode.Partial
to measure the effectiveness of Baseline Profiles. -
@BaselineProfileRule
to automatically generate Baseline profiles for a given critical user journey.
-
Support for Allocation metrics & profiling during Microbenchmark runs.
Version 1.1.0-rc03
জুন 1, 2022
androidx.benchmark:benchmark-*:1.1.0-rc03
is released. Version 1.1.0-rc03 contains these commits.
বাগ ফিক্স
Avoid reinstalling the target package on every benchmark iteration. ( aosp/2093027 , b/231976084 )
Remove the
300ms
delay frompressHome()
. ( aosp/2086030 , b/231322975 )Improve Macrobenchmark iteration speed by optimizing Shell commands used under the hood. ( aosp/2086023 , b/231323582 )
Support for Managed Gradle Devices when generating Baseline Profiles with Macrobenchmarks. ( aosp/2062228 , b/228926421 )
Version 1.1.0-rc02
11 মে, 2022
androidx.benchmark:benchmark-*:1.1.0-rc02
is released. Version 1.1.0-rc02 contains these commits.
- Note that this release includes a behavior change, as apps are now fully reinstalled in between each benchmark to ensure accurate measurements.
Bug Fixes/Behavior Changes
Fixed an issue where app compilation was not correctly reset between macrobenchmarks, and not reset at all on unrooted builds. This fixes many cases where running multiple tests would result in
CompilationMode
having little to no effect on measurements. To workaround this problem, the target app is now fully reinstalling each test method, which will clear application data between each macrobenchmark. ( I31c74 , b/230665435 )As this prevents apps from setting up state before tests, it is now possible to skip compilation / reinstallation to enable working around this. You can for example fully compile the target with a shell command
cmd package compile -f -m speed <package>
, and then bypass macrobenchmark's compilation step.Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.compilation.enabled, 'false' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.compilation.enabled=false
Made it possible to share a module between macrobenchmarks and baseline profile generating tests by adding
androidx.benchmark.enabledRules
instrumentation argument. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when generatingBaselineProfiles
on an emulator. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
Version 1.1.0-rc01
20 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-rc01
is released. Version 1.1.0-rc01 contains these commits.
বাগ ফিক্স
- Baseline profile output links in Android Studio now use a unique file name. This way the output always reflects the latest results of using a
BaselineProfileRule
. ( aosp/2057008 , b/228203086 )
Version 1.1.0-beta06
6 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-beta06
is released. Version 1.1.0-beta06 contains these commits.
বাগ ফিক্স
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
- Fix startup metrics for Macrobenchmarks when
CompilationMode.None()
is used. Before this change,CompilationMode.Partial()
would appear to be slower thanCompilation.None()
. ( 611ac9 ).
Version 1.1.0-beta05
23 মার্চ, 2022
androidx.benchmark:benchmark-*:1.1.0-beta05
is released. Version 1.1.0-beta05 contains these commits.
বাগ ফিক্স
- Kill package after skipping profile installation when using
CompilationMode.None
. ( aosp/1991373 ) - Fixed an issue where Macrobenchmarks is unable to collect startup metrics when using
StartupMode.COLD
. ( aosp/2012227 b/218668335 )
Version 1.1.0-beta04
23 ফেব্রুয়ারি, 2022
androidx.benchmark:benchmark-*:1.1.0-beta04
is released. Version 1.1.0-beta04 contains these commits.
বাগ ফিক্স
Fix missing metrics on Android 10, and
NoSuchElementException
caused by process names not being captured correctly in traces. ( Ib4c17 , b/218668335 )Use
PowerManager
for thermal throttling detection on Q (API 29) and higher. This significantly reduces frequency of false positives in thermal throttling detection (benchmark retry after 90 second cooldown), and speeds up benchmarks significantly on user builds. It also provides throttle detection even when clocks are locked (if they're locked too high for the device's physical environment). ( I9c027 , b/217497678 , b/131755853 )Filter simpleperf sampled profiling to
measureRepeated
thread only to simplify inspection ( Ic3e12 , b/217501939 )Support metrics from named UI subprocesses in multi-process apps ( Ice6c0 , b/215988434 )
Filter Baseline Profile rules to target Android 9 (SDK 28). aosp/1980331 b/216508418
Skip Profile Installation when using
Compilation.None()
. Additionally, report warnings when the app is using an older version ofandroidx.profileinstaller
and Android Gradle Plugin. aosp/1977029
Version 1.1.0-beta03
ফেব্রুয়ারী 9, 2022
androidx.benchmark:benchmark-*:1.1.0-beta03
is released. Version 1.1.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added
AudioUnderrunMetric
into macrobenchmark library under experimental flag to allow detection of audio underruns ( Ib5972 ) BaselineProfileRule
no longer accepts asetup
block as this functioned the same as theprofileBlock
. ( Ic7dfe , b/215536447 )যেমন
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, setupBlock = { startActivityAndWait() }, profileBlock = { // ... } ) }
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, profileBlock = { startActivityAndWait() // ... } ) }
বাগ ফিক্স
- Fixed issue where microbench profiler traces would fail to be updated in subsequent runs when linked in Studio output ( I5ae4d , b/214917025 )
- Prevent compilation shell commands on API 23 ( Ice380 )
- Renamed
FrameCpuTime
->FrameDurationCpu
,FrameUiTime
->FrameDurationUi
to clarify these are durations, not timestamps, and to match prefixes. ( I0eba3 , b/216337830 )
Version 1.1.0-beta02
জানুয়ারী 26, 2022
androidx.benchmark:benchmark-*:1.1.0-beta02
is released. Version 1.1.0-beta02 contains these commits.
বাগ ফিক্স
- Microbenchmark Stack Sampling / Method Tracing Profile results are now linked in Studio output, similar to other profiling outputs, and do not suppress the allocation metric. ( Idcb65 , b/214440748 , b/214253245 )
- BaselineProfileRule now prints the
adb pull
command in logcat and Studio output for pulling generated BaselineProfile text file. ( f08811 )
Version 1.1.0-beta01
জানুয়ারী 12, 2022
androidx.benchmark:benchmark-*:1.1.0-beta01
is released. Version 1.1.0-beta01 contains these commits.
বাগ ফিক্স
- Fixes profiler argument enable being ignored. ( I37373 , b/210619998 )
- Removed deprecated
CompliationModes
( I98186 , b/213467659 ) - Switched baseline profile arg of
CompilationMode.Partial
to enum for clarity. ( Id67ea )
Version 1.1.0-alpha13
15 ডিসেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha13
is released. Version 1.1.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Add low-overhead System Tracing to microbench output on Android Q (API 29+). Note that this does not currently capture custom tracing (via
android.os.Trace
orandroidx.tracing
Jetpack APIs) to avoid affecting results. This tracing should be useful in diagnosing instability, especially from sources outside the benchmark. ( I298be , b/205636583 , b/145598917 ) - Clarify
CompilationModes
into three classes - Full, None, Partial. Previously they were inconsistently named after compilation arguments (which we now treat as implementation details) and features. This makes the tradeoffs, potential combinations, and behavior across platform versions more clear. ( I3d7bf , b/207132597 ) - Setup and measure are now always in pairs, in order. You can now query the package name and iteration (though the iteration may be
null
in certain warmup scenarios). ( Id3b68 , b/208357448 , b/208369635 )
বাগ ফিক্স
- Fixed
CompilationMode.Speed
incorrectly treated asNone
( I01137 )
Version 1.1.0-alpha12
নভেম্বর 17, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha12
is released. Version 1.1.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- Add experimental TraceSectionMetric for custom trace-based timing measurements. ( I99db1 , b/204572664 )
Bug Fixes
- Wake device each iteration, to ensure UI can be tested - requires lockscreen is disabled. ( Ibfa28 , b/180963442 )
- Fixes multiple crashes in StackSampling profiling mode on emulators and non-rooted devices ( Icdbda , b/202719335 )
- Removed 0.5 second sleep at the end of each iteration - if you see missing metrics with this change, please file a bug. ( Iff6aa )
- Reduce chances of dropped data, and lower memory overhead from tracing ( Id2544 , b/199324831 , b/204448861 )
- Reduce trace size by ~40% by switching to compact sched storage format. ( Id5fb6 , b/199324831 )
- Updated implementations of startup metrics to always end at end of renderthread. This will be more contistent across platform versions, and more closely map to in-app measurements. ( Ic6b55 )
Version 1.1.0-alpha11
3 নভেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha11
is released. Version 1.1.0-alpha11 contains these commits.
এপিআই পরিবর্তন
- Macrobenchmark now has a
minSdkVersion
of23
. ( If2655 ) - Adds a new experimental
BaselineProfileRule
which is capable of generating baseline profiles for app's critical user journey. Detailed documentation to follow. ( Ibbefa , b/203692160 ) - Removes measureRepeated interface variant, which was added for java callers, as it caused ambiguity in completing/resolving the method. Java callers will again need to return Unit.Instance from measureRepeated. If this is an inconvenience, please file a bug, we can revisit this in a future version. ( Ifb23e , b/204331495 )
Version 1.1.0-alpha10
27 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha10
is released. Version 1.1.0-alpha10 contains these commits.
এপিআই পরিবর্তন
- Backport StartupTimingMetric to work back to API 23. This new implementation also better handles reportFullyDrawn() to wait until corresponding content has been rendered. ( If3ac9 , b/183129298 )
- Added JvmOverloads to multiple MacrobenchmarkScope methods for Java callers. ( I644fe , b/184546459 )
- Provide alternative MacrobenchmarkRule.measureRepeated function that uses a
Consumer<MacrobenchmarkScope>
for idiomatic usage in Java language. ( If74ab , b/184546459 )
বাগ ফিক্স
- Fix for traces not starting early enough, and missing metric data. This is expected to fix "Unable to read any metrics during benchmark" exceptions that were caused by the library itself. ( I6dfcb , b/193827052 , b/200302931 )
- FrameNegativeSlack has been renamed to FrameOverrun to clarify its meaning - how much the frame went over its time budget. ( I6c2aa , b/203008701 )
Version 1.1.0-alpha09
13 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha09
is released. Version 1.1.0-alpha09 contains these commits.
Bug Fixes
- Support dropping Kernel page cache without root on API 31/S+, which will increase accuracy of StartupMode.COLD launches. ( Iecfdb , b/200160030 )
Version 1.1.0-alpha08
সেপ্টেম্বর 29, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha08
is released. Version 1.1.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- Enable scrolling macrobenchmarks to run back to API 23 ( If39c2 , b/183129298 )
- Add new type of sampled metric to UI and JSON output, focused on percentiles of multiple samples per iteration. ( I56247 , b/199940612 )
- Switch to floating point metrics throughout the benchmark libraries (truncated in the Studio UI). ( I69249 , b/197008210 )
Version 1.1.0-alpha07
1 সেপ্টেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha07
is released. Version 1.1.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Raised min API to 21 to reflect the intended lowest API level to be supported in the future. Current min API supported continues to be conveyed via RequiredApi(), and is currently 29 ( I440d6 , b/183129298 )
Bug Fixes
- Fixes
ProfileInstaller
to make it easier for apps using baseline profiles to run MacroBenchmarks usingCompilationMode.BaselineProfile
. ( I42657 , b/196074999 ) NOTE: requires also updating toandroidx.profileinstaller:profileinstaller:1.1.0-alpha04
or greater. -
StartupMode.COLD
+CompilationMode.None
benchmarks are now more stable. ( I770cd , b/196074999 )
Version 1.1.0-alpha06
18 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha06
is released. Version 1.1.0-alpha06 contains these commits.
এপিআই পরিবর্তন
- Added
androidx.benchmark.iterations
instrumentation argument to allow manual overriding of iteration count when testing/profiling locally. ( 6188be , b/194137879 )
Bug Fixes
- Switched to Simpleperf as default sampling profiler on API 29+. ( Ic4b34 , b/158303822 )
পরিচিত সমস্যা
-
CompilationMode.BaselineProfile
is a work in progress. Avoid using it to determine how good a profile is for now.
Version 1.1.0-alpha05
4 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha05
is released. Version 1.1.0-alpha05 contains these commits.
1.1.0-alpha04
was cancelled before release due to a sporatic crash. b/193827052
এপিআই পরিবর্তন
- Switched startActivityAndWait to invoke launch via
am start
, which reduces the time of each measurement iteration by approximately 5 seconds, at the cost of no longer supporting intent parcelables. ( I5a6f5 , b/192009149
Bug Fixes
- Reduce aggressiveness of thermal throttle detection, and recompute baseline if throttles are detected frequently. ( I7327b )
- Fixes FrameTimingMetric to work on Android S beta ( Ib60cc , b/193260119 )
- Use an
EmptyActivity
to bring the target app out of a force-stopped state to better supportCompilationMode.BaselineProfile
. ( Id7cac , b/192084204 ) - Changed trace file extension to
.perfetto-trace
to match platform standard. ( I4c236 , b/174663039 ) - StartupTimingMetric now outputs the "fullyDrawnMs" metric to measure time until your application has completed rendering. To define this metric for your app, call Activity.reportFullyDrawn when your initial content is ready, such as when your initial list items are loaded from DB or network. (reportFullyDrawn method available without build version checks on ComponentActivity). Note that your test must run long enough to capture the metric (startActivityAndWait doesn't wait for reportFullyDrawn). ( If1141 , b/179176560 )
- Reduce cost of appending Ui metadata to traces by 50+ ms ( Ic8390 , b/193923003 )
- Drastically increased polling frequency when stopping tracing, which can reduce eg startup benchmark runtime by 30+% ( Idfbc1 , b/193723768 )
Version 1.1.0-alpha03
16 জুন, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha03
is released. Version 1.1.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added a new
CompilationMode.BaselineProfile
to support profiles installed using the Jetpack ProfileInstaller library . ( aosp/1720930 )
Bug Fixes
The sample Gradle code for suppressing benchmark errors has been updated to use a non-deprecated API with a syntax that also supports .gradle.kts users.
যেমন,
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"
Version 1.1.0-alpha02
18 মে, 2021
Benchmark version 1.1.0-alpha02 brings a big component to benchmarking - Macrobenchmark. In addition to benchmark allowing you to measure CPU loops, macrobenchmark allows you to measure whole-app interactions like startup and scrolling, and capture traces. For more information see the library documentation .
androidx.benchmark:benchmark-*:1.1.0-alpha02
is released. Version 1.1.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
Macrobenchmark artifacts added ( androidx.benchmark:benchmark-macro-junit4
and androidx.benchmark:benchmark-macro
)
- Capture startup, scrolling/animation performance metrics from your app, locally or in CI
- Capture and inspect traces from within Android Studio
বাগ ফিক্স
- Workaround shell permissions issue with output directory on Android 12 (Note - may require updating Android Gradle Plugin to 7.0.0 canary and Android Studio to Arctic Fox (2020.3.1), to continue capturing output files on affected devices). ( Icb039 )
- Support configuration caching in BenchmarkPlugin ( 6be1c1 , b/159804788 )
- Simplified file output - on by default, in a directory that doesn't require
requestLegacyExternalStorage=true
( 8b5a4d , b/172376362 ) - Fixes library printing logcat warnings about not finding JIT thread on platform versions where it is not present. ( I9cc63 , b/161847393 )
- Fix for reading device max frequency. ( I55c7a )
Version 1.1.0-alpha01
জুন 10, 2020
androidx.benchmark:benchmark-common:1.1.0-alpha01
, androidx.benchmark:benchmark-gradle-plugin:1.1.0-alpha01
, and androidx.benchmark:benchmark-junit4:1.1.0-alpha01
are released. Version 1.1.0-alpha01 contains these commits.
New Features of 1.1
- Allocation Metric - Benchmarks now run an additional phase after warmup and timing, capturing allocation counts. Allocations can cause performance problems on older versions of the platform (140ns in O became 8ns in M - measured on Nexus5X, with locked clocks). This metric is displayed in Android Studio console output, as well as in the
- Profiling support - You can now capture profiling data for a benchmark run, to inspect why your code may be running slowly. Benchmark supports capturing either method tracing, or method sampling from ART. These files can be inspected with the Profiler inside Android Studio using File > Open .
- The Benchmark Gradle plugin now provides defaults for simpler setup:
-
testBuildType
is set to release by default, to avoid using dependencies with code coverage built-in. The release buildType is also configured as the default buildType, which allows Android Studio to automatically select the correct build variant when opening a project for the first time. ( b/138808399 ) -
signingConfig.debug
is used as the default signing config ( b/153583269 )
-
** Bug Fixes **
- Significantly reduced the warmup transition overhead, where the first measurement for each benchmark was artificially higher than others. This issue was more pronounced in very small benchmarks (1 microsecond or less). ( b/142058671 )
- Fixed
InstrumentationResultParser
error printed for each benchmark when running from command line. ( I64988 , b/154248456 )
পরিচিত সমস্যা
- Command line, gradle invocations of Benchmark do not print out results directly. You can work around this by either running through Studio, or parsing the JSON output file for results.
- Benchmark reporting fails to pull the report from devices that have an app installed with an applicationId ending with either “android” or “download” (case insensitive). Users hitting this issue should upgrade the Android Gradle Plugin to 4.2-alpha01 or later.
সংস্করণ 1.0.0
Benchmark Version 1.0.0
নভেম্বর 20, 2019
androidx.benchmark:benchmark-common:1.0.0
, androidx.benchmark:benchmark-gradle-plugin:1.0.0
, and androidx.benchmark:benchmark-junit4:1.0.0
are released with no changes from 1.0.0-rc01. Version 1.0.0 contains these commits .
Major features of 1.0.0
The Benchmark library allows you to write performance benchmarks of app code and get results quickly.
It prevents build and runtime configuration issues and stabilizes device performance to ensure that measurements are accurate and consistent. Run the benchmarks directly in Android Studio , or in Continuous Integration to observe code performance over time, and to prevent regressions.
প্রধান বৈশিষ্ট্য অন্তর্ভুক্ত:
- Clock stabilization
- Automatic thread prioritization
- Support for UI performance testing, such as in the RecyclerView Sample
- JIT-aware warmup and looping
- JSON benchmark output for post-processing
Version 1.0.0-rc01
23 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-rc01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-rc01
, and androidx.benchmark:benchmark-junit4:1.0.0-rc01
are released. Version 1.0.0-rc01 contains these commits .
নতুন বৈশিষ্ট্য
- Added systrace tracing to benchmarks
বাগ ফিক্স
- Fixed metric instability issue where JIT wouldn't finish before warm up due to deprioritization ( b/140773023 )
- Unified JSON output directory across Android Gradle Plugin 3.5 and 3.6
Version 1.0.0-beta01
9 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-beta01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-beta01
, and androidx.benchmark:benchmark-junit4:1.0.0-beta01
are released. Version 1.0.0-beta01 contains these commits .
নতুন বৈশিষ্ট্য
- Run garbage collection before each warmup to reduce memory pressure from one benchmark to leak to the next ( b/140895105 )
বাগ ফিক্স
- Added
androidx.annotation:android-experimental-lint
dependency, so that Java code will correctly produce lint errors when experimental API is not used, similar to what is provided by the Kotlin experimental annotation for Kotlin callers. - Now correctly detects usage of
additionalTestOutputDir
instrumentation argument for output in Android Gradle Plugin 3.6, to know when AGP will handle data copy. - Fix undetected clock frequency in JSON to correctly print
-1
( b/141945670 ).
Version 1.0.0-alpha06
সেপ্টেম্বর 18, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha06
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha06
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha06
are released. Version 1.0.0-alpha06 contains these commits .
নতুন বৈশিষ্ট্য
- Added a check for incorrectly using the old package for the test runner, which now provides a more-helpful error message
API changes
- The experimental annotation
ExperimentalAnnotationReport
is now correctly public. Usage of the experimental BenchmarkState#report API now requires this annotation
Version 1.0.0-alpha05
5 সেপ্টেম্বর, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha05
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha05
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha05
are released. The commits included in this version can be found here .
API changes
-
BenchmarkState.reportData
API is now marked experimental
বাগ ফিক্স
- Fix for the clock-locking script, which would fail on devices that were either missing the
cut
orexpr
shell utilities. - Fixed an issue with
./gradlew lockClocks
task that would hang on devices that were rooted with an older version of the su utility, which did not support the-c
flag.
Version 1.0.0-alpha04
7 আগস্ট, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha04
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha04
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha04
are released. The commits included in this version can be found here .
New documentation has also been added for how to use the Benchmark library without Gradle, both for usage with different build systems (such as Bazel or Buck), and when running in CI. For more information, see Build benchmarks without Gradle and Run benchmarks in Continuous Integration .
নতুন বৈশিষ্ট্য
- গ্রেডল প্লাগইন
- Now automatically disables test coverage, and sets the
AndroidBenchmarkRunner
by default ( b/138374050 ) - Added support for new AGP-based data copy, when running benchmarks and when using AGP 3.6+
- Now automatically disables test coverage, and sets the
- JSON format additions
- Output total benchmark test run time ( b/133147694 )
-
@Parameterized
benchmarks that use a name string (for example@Parameters(name = "size={0},depth={1}")
) now output parameter names and values per benchmark in the JSON output ( b/132578772 )
- Dry Run mode ( b/138785848 )
- Added a "dry run" mode for running each benchmark loop only once, to check for errors/crashes without capturing measurements. This can be useful eg for, for example, quickly running benchmarks in presubmit to check that they're not broken.
API changes
- Module structure has changed, splitting the library ( b/138451391 )
-
benchmark:benchmark-junit4
contains classes with JUnit dependency:AndroidBenchmarkRunner
, andBenchmarkRule
, both of which have moved into theandroidx.benchmark.junit4
package -
benchmark:benchmark-common
contains the rest of the logic, including the BenchmarkState API - This split will allow the library to support benchmarking without JUnit4 APIs in the future
-
- Configuration warnings are now treated as errors, and will crash the test ( b/137653596 )
- This is done to further encourage accurate measurements, especially in CI
- These errors can be reduced back to warnings with an instrumentation argument. For example:
-e androidx.benchmark.suppressErrors "DEBUGGABLE,LOW_BATTERY"
বাগ ফিক্স
- Errors when writing to external storage on Q devices provide more-descriptive messages, with suggestions of how to resolve the issue
- Screens are automatically turned on during benchmark runs, instead of failing when the screen is off
External contributions
- Thanks to Sergey Zakharov for contributing JSON output improvements and the fix for screen off issues!
Version 1.0.0-alpha03
জুলাই 2, 2019
androidx.benchmark:benchmark:1.0.0-alpha03
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha03
are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Expose sleep duration due to thermal throttling per benchmark in the full JSON report
বাগ ফিক্স
- The Gradle plugin should no longer be required to be applied after Android plugins and the Android block
- Adds support for benchmark reports on Android 10 devices using scoped storage
Version 1.0.0-alpha02
জুন 6, 2019
androidx.benchmark:1.0.0-alpha02
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha02
are released. The commits included in this version can be found here .
Note that we are treating the JSON schema as an API. We plan to follow the same stability constraints as other APIs: stable (with very rare exceptions) once in beta, and fixed in final release, with only additions in minor releases and changes/removals in major releases.
API changes
Overhauled JSON schema. Further changes to the JSON schema are likely to be limited to additions:
- Reorganized the result object structure to support additional metric groups in the future ( b/132713021 )
- Added test run context information, such as device and build info and whether clocks are locked, to the top-level object ( b/132711920 )
- Time metric names now have 'ns' in their name ( b/132714527 )
- Additional stats added per reported metric (maximum, median, minimum), and removed simplified 'nanos' summary stat ( b/132713851 )
Removed XML output ( b/132714414 )
Thermal throttle detection removed from
BenchmarkState.reportData
API ( b/132887006 )
বাগ ফিক্স
- Fixed
./gradlew lockClocks
not sticking on some recent OS devices ( b/133424037 ) - Throttling detection disabled for emulator ( b/132880807 )
Version 1.0.0-alpha01
7 মে, 2019
androidx.benchmark:benchmark:1.0.0-alpha01
is released. The commits included in this version are available here .
বেঞ্চমার্ক
সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | প্রার্থী মুক্তি | বিটা রিলিজ | আলফা রিলিজ |
---|---|---|---|---|
9 এপ্রিল, 2025 | 1.3.4 | - | - | 1.4.0-alpha11 |
নির্ভরতা ঘোষণা করা
To add a dependency on Benchmark, you must add the Google Maven repository to your project. আরও তথ্যের জন্য Google এর Maven সংগ্রহস্থল পড়ুন।
Macrobenchmark
To use Macrobenchmark in your project, add the following dependencies to your build.gradle
file for your macrobenchmark module :
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-macro-junit4:1.3.4" }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-macro-junit4:1.3.4") }
Microbenchmark
To use Microbenchmark in your project, add the following dependencies to your build.gradle
file for your microbenchmark module :
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-junit4:1.3.4" } android { ... defaultConfig { ... testInstrumentationRunner "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-junit4:1.3.4") } android { ... defaultConfig { ... testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
মাইক্রোবেঞ্চমার্ক লাইব্রেরি আপনার মাইক্রোবেঞ্চমার্ক মডিউলের সাথে ব্যবহার করার জন্য একটি গ্রেডল প্লাগইনও প্রদান করে। এই প্লাগইনটি মডিউলের জন্য বিল্ড কনফিগারেশন ডিফল্ট সেট করে, হোস্টে বেঞ্চমার্ক আউটপুট কপি সেট আপ করে এবং ./gradlew lockClocks
টাস্ক প্রদান করে।
প্লাগইন ব্যবহার করতে, আপনার শীর্ষ-স্তরের build.gradle
ফাইলে `plugins` ব্লকে নিম্নলিখিত লাইনটি অন্তর্ভুক্ত করুন:
গ্রোভি
plugins { id 'androidx.benchmark' version '1.3.4' apply false }
কোটলিন
plugins { id("androidx.benchmark") version "1.3.4" apply false }
তারপর প্লাগইনটি আপনার বেঞ্চমার্ক মডিউলের build.gradle
ফাইলে প্রয়োগ করুন
গ্রোভি
plugins { id 'androidx.benchmark' }
কোটলিন
plugins { id("androidx.benchmark") }
প্রতিক্রিয়া
আপনার প্রতিক্রিয়া জেটপ্যাককে আরও ভাল করতে সাহায্য করে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন বা এই লাইব্রেরির উন্নতির জন্য ধারনা পান তাহলে আমাদের জানান। আপনি একটি নতুন তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি দেখুন৷ আপনি তারকা বোতামে ক্লিক করে একটি বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ 1.4
Version 1.4.0-alpha11
9 এপ্রিল, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha11
is released. Version 1.4.0-alpha11 contains these commits .
এপিআই পরিবর্তন
- Changed
TraceProcessor
's argument timeout: Duration to timeoutMs long for Java caller usability. ( I9fbb5 ) - Mark
TraceProcessor
constructor as internal. Callers should useTraceProcessor.startServer
orTraceProcessor.runServer
. ( Ia8c5b )
Bug Fixes
- When killing the application with
MacrobenchmarkScope.killProcess
, validate the kill command results to prevent silent failure, and timeout error. ( I84555 )
নির্ভরতা আপডেট
- This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer. ( Idb6b5 )
Version 1.4.0-alpha10
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha10
is released. Version 1.4.0-alpha10 contains these commits .
এপিআই পরিবর্তন
- Increased default timeout for
TraceProcessor
server load and querying to 120 seconds (from 60/30 previously), and made both configurable with one timeout parameter. ( Ifec87 )
Bug Fixes
- Fixed a few issues that would occur when benchmarking or capturing profiles of an app without
profileinstaller
, and it's includedBroadcastReciever
. This only affects runs on rooted devices. ( Ied308 )
Version 1.4.0-alpha09
12 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha09
is released. Version 1.4.0-alpha09 contains these commits .
এপিআই পরিবর্তন
- Added
TraceProcessor
and Session API with closable Handles, for easier usage with custom lifecycles. This is also a step towards enabling easier Coroutine and Java API usage. The extension functions toTraceProcessor.runServer {}
are now marked experimental, as they're likely to move, and be made non-experimental in the future. ( I358b4 )
Bug Fixes
- Fixed Benchmark and Baseline Profile capture not working with API 36 due to a change in
pgrep
toybox that now requires-a
to print the full command line. ( Idc991 ) - Filter default tracing config to reduce risk of data loss in traces on newer API levels. ( I54e8a )
- Added experimental
androidx.benchmark.killExistingPerfettoRecordings
instrumentation argument, which can be set tofalse
to allow pre existing perfetto trace capture to continue. By default pre existing perfetto trace captures on device are killed to prevent interference. ( I02a3c ) - The JSON field
context.osCodenameAbbreviated
will now beREL
for released OS versions at and above API 35, as non-numeric code names are no longer supported by the underlying platform. ( Ib17fd ) - Fixes crash in
FrameTimingMetric
when resynced frames occur. ( I7c6f4 , b/394610806 ) - No longer assume
Choreographer#doFrame
is the top of the stack frame on the main thread forFrameTimingQuery
. ( Iee0e0 , b/340206285 )
Version 1.4.0-alpha08
ফেব্রুয়ারি 12, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha08
is released. Version 1.4.0-alpha08 contains these commits .
এপিআই পরিবর্তন
- Moved
TraceProcessor.runSession()
extension APIs to be experimental, as they are likely to move to be concrete constructors eventually on Android. ( Ib0528 , b/393640753 ) - Most of the implementation of Startup Insights are now public/experimental, and move to the
TraceProcessor
artifact SeeStartupInsights
. ( I0aa00 ) - Deprecate
BenchmarkRule.runWithTimingDisabled {}
in favor ofBenchmarkRule.runWithMeasurementDisabled {}
, which more clearly describes the behavior - all metrics are paused. Additionally, expose theMicrobenchmarkScope
superclass since redeclaring therunWithMeasurementDisabled
function to open access isn't possible, since it's inline. ( I9e23b , b/389149423 , b/149979716 ) - Benchmark libraries have moved to Kotlin 2.0. ( I9d1e0 )
- Removed
androidx.benchmark.startupProfiles.enable
instrumentation argument. It is no longer useful, as it can be controlled byincludeInStartupProfile
arg inBaselineProfileRule.collect()
. ( I39eb4 )
Bug Fixes
- Reduced the amount of Microbenchmark internal functions called during profiling to make eg Method traces more clear ( Ifaed8 )
- Speculative fix for crashes: 'Failed to stop [
ProcessPid(processName=perfetto, pid=...)
]'. Now Benchmark will log a message instead of crashing when a background Perfetto process isn't able to be stopped before running the benchmark. ( I37d3e , b/323601788 ) - Fix
IllegalStateExceptions
with 'Expectedpm dump-profiles
stdout' label that were caused by overly strict output format check. ( I358dc )
Version 1.4.0-alpha07
জানুয়ারী 29, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha07
is released. Version 1.4.0-alpha07 contains these commits .
নতুন বৈশিষ্ট্য
-
BaselineProfileRule
now introduces acollectWithResults(...)
API which includes a list of paths to the computed profiles. ( I056f8 ) - Added
androidx.benchmark.measureRepeatedOnMainThread.throwOnDeadline
instrumentation argument, which can be set to false to disable the throw on deadline behavior ofmeasureRepeatedOnMainThread
for local testing. Not otherwise recommended, as this increases the likelihood of ANRs during tests. ( Idbeec , b/353226476 )
এপিআই পরিবর্তন
- Added
@JvmOverloads
toMicrobenchmarkConfig
constructor. ( I13fd3 ) - Refactored
BenchmarkRule
to be built on top of coroutines, and support betteryield()
behavior. This refactor removed several experimentalBenchmarkState
APIs, but will be followed by replacements as needed. Additionally, addedrunWithMeasurementDisabled
to clarify behavior (all measurement is paused). In the future,runWithTimingDisabled
will be deprecated. ( I19837 , b/389149423 , b/311242861 ) - Move
PerfettoTraceProcessor
toTraceProcessor
in a newandroidx.benchmark:benchmark-traceprocessor
artifact, and make most of its API non-experimental. Any customTraceMetric
or anything reading from traces will need to update to the newTraceProcessor
import. The newTraceProcessor
API works exactly like the old one, but is a standalone interface library (somewhat analogous to theandroidx.sqlite
layer from Room) with an Android-specific implementation built into macrobenchmark. The new artifact can be used on JVM as well, but currently you'll need to start your own copy of theTraceProcessor
binary and offer a port to connect to it on. ( I3a767 , I62563 , b/381134564 )
Bug Fixes
- Throw a clearer error message when
MacrobenchmarkScope.startActivityAndWait
fails to launch the target process (potentially due to a crash in the target process), instead of the more ambiguous 'Unable to confirm activity launch completion' message ( I3539b ) - Fixed several syntax errors in Kotlin samples, and syntax highlighting in several Java / build.gradle samples. ( Ib3808 )
- Clarified
ArtMetric
andCaptureInfo
parameter docs. ( I96e60 )
Version 1.4.0-alpha06
11 ডিসেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha06
is released. Version 1.4.0-alpha06 contains these commits .
এপিআই পরিবর্তন
- Removed usage of
@Language("sql")
inPerfettoTraceProcessor.Session.query()
, as Studio highlighting/parsing is broken. ( Idc2fa , b/377733398 )
Bug Fixes
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I46810 , b/326456246 ) - Corrected
ArtMetric
to report class load (not init), and improved docs to clarify runtime behavior. ( I9915c ) - On Android Multiuser, execute commands as root only on rooted devices. ( I88b44 )
সংস্করণ 1.4.0-আলফা 05
13 নভেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha05
is released. Version 1.4.0-alpha05 contains these commits .
Bug Fixes
- Fixed an issue on API 34+ where
CompilationMode.None()
would have inconsistent performance not representative of initial, worst case performance. This works around a platform change which allows ART's compilation stateverify
to partially compile apps (only affecting class loading) shortly after first launch. ( Ie48d0 ) - Fixed issue where (especially short) traces could be captured that wouldn't report measurement from built-in Macrobenchmark Metrics, due to the process name being truncated within the Perfetto trace. Now macrobenchmark works around this issue by looking for the truncated package name in all built-in queries, in addition to the expected package name. Note that custom
TraceMetric
implementations or other direct callers ofPerfettoSession.query
can implement this same behavior by changingprocess.name LIKE "$packageName"
in a Perfetto query to instead be(process.name LIKE "$packageName" OR process.name LIKE "$(packageName.takeLast(15))")
. ( I5bf01 , b/377565760 )
সংস্করণ 1.4.0-আলফা 04
অক্টোবর 30, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha04
is released. Version 1.4.0-alpha04 contains these commits .
নতুন বৈশিষ্ট্য
- (Experimental) Enable Baseline Profile generation, and benchmarking on apps installed to a secondary user, for example any app on headless Android Auto devices. This support has been tested in some scenarios, but let us know with a bug if it doesn't work for you. ( I9fcbe , b/356684617 , b/373641155 )
Bug Fixes
-
isProfileable
is now always overridden in benchmark builds, andisDebuggable
is also now always overridden in both benchmark andnonMinified
(baseline profile capture) builds. ( I487fa , b/369213505 ) - Fixes compilation detection on some physical devices prior to API 28 - affects json
context.compilationMode
, as well as behavior ofandroidx.benchmark.requireAot=true
(which no longer incorrectly throws) ( Ic3e08 , b/374362482 ) - In
CpuEventCounter
metrics, throw if invalid measurements are observed (eg instructions/cpucycles==0) ( I8c503 )
সংস্করণ 1.4.0-আলফা 03
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha03
is released. Version 1.4.0-alpha03 contains these commits .
এপিআই পরিবর্তন
- Macrobenchmark : Adds
ArtMetric
, which can be used to inspect profile coverage or general Android RunTime performance. Captures number and total duration of JIT, class init (where available), and class verification. Additionally, changesCaptureInfo
to include optional ART mainline version with default. ( I930f7 ) - Add
coefficientOfVariation
to Benchmark JSON output to show stability within a given benchmark run. ( Ib14ea )
Bug Fixes
- Fixed
CollectBaselineProfileTask
when AVD device has spaces in it. ( Ia0225 , b/371642809 ) - Speculative fix for errors from
StartupMode.COLD
exceptions:Package <packagename> must not be running prior to cold start!
. Now,MacrobenchmarkScope.killProcess()
(including the one run before each iteration, used to implementStartupMode.COLD
behavior) will wait to verify that the app's processes have all stopped running. ( I60aa6 , b/351582215 ) - Fixed issue where UNLOCKED_ error would show up on some rooted emulators. ( Ic5117 )
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I7104f , b/326456246 )
সংস্করণ 1.4.0-আলফা 02
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha02
is released. Version 1.4.0-alpha02 contains these commits .
এপিআই পরিবর্তন
- Moved Gradle tasks
lockClocks
andunlockClocks
to be on benchmark projects, instead of available at the top level. This change was necessary as there is unfortunately no way to register these as top level actions without breaking project isolation. ( I02b8f , b/363325823 )
বাগ ফিক্স
-
BaselineProfileRule
now collects profiles for multi-process apps by signaling each running process at the end of the block to dump profiles. If a profile based compilation never successfully finds a process to broadcast to, the compilation will fail, as it's unexpected to have profile data within. Additionally, added an instrumentation argument to control dump wait duration:androidx.benchmark.saveProfileWaitMillis
( I0f519 , b/366231469 ) - From Benchmark
1.3.2
: Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. ( I2f678 , b/285187547 )
To use FTL apply the plugin to the baseline profile module in the plugin block, with:
plugins {
...
id("com.google.firebase.testlab")
}
and then configure firebase test lab with:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
Also the created FTL device needs to be added to the baseline profile extension:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.4.0-আলফা 01
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha01
is released. Version 1.4.0-alpha01 contains these commits .
New Feature - App Startup Insights
- Initial version of app startup insights can be enabled in Macrobenchmark. ( 09fae38 )
To enable in a startup benchmark:
@Test
fun startup {
macrobenchmarkRule.measureRepeated(
…
packageName = "com.example.my.application.id"
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
compilationMode = CompilationMode.None(),
experimentalConfig = ExperimentalConfig(startupInsightsConfig = StartupInsightsConfig(isEnabled = true))
) {
scope.startActivityAndWait(...)
}
}
Then running your startup benchmark will analyze the trace to look for common problems, and print them after metrics to Studio test output in the benchmark tab, eg:
StartupBenchmark_startup[startup=COLD,compilationMode=None]
├── Metrics
│ ├── timeToFullDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
│ └── timeToInitialDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
├── App Startup Insights
│ ├── App in debuggable mode (expected: false)
│ │ └── seen in iterations: 0(true) 1(true) 2(true) 3(true) 4(true) 5(true) 6(true) 7(true) 8(true) 9(true)
│ ├── Potential CPU contention with another process (expected: < 100000000ns)
│ │ └── seen in iterations: 4(105022546ns)
│ └── Main Thread - Binder transactions blocked (expected: false)
│ └── seen in iterations: 7(true)
└── Traces
└── Iteration 0 1 2 3 4 5 6 7 8 9
This feature is still a work-in-progress, with improvements to documentation and extensibility to follow, but feedback is welcome.
নতুন বৈশিষ্ট্য
- Added gradle property
androidx.baselineprofile.suppressWarnings
to suppress all baseline profile warnings. ( 314153a ) - Microbench metrics are now displayed in Perfetto traces as counters. ( 3214854 )
- Add experimental scripts for disabling jit (requires root / runtime restart), and resetting device perf/test state. These are not currently published as gradle tasks. ( 7c3732b )
- Added benchmark argument to skip tests when running on emulator. When
automaticGenerationDuring
build is enabled, benchmarks will also trigger baseline profile generation. This will fail, if emulators are used. With the new argumentskipBenchmarksOnEmulator
we can instead skip the test. ( 0c2ddcd ) - Change perf event enable logic to run on API 23+ ( 2550048 )
এপিআই পরিবর্তন
- Existing experimental
PerfettoConfig
argument toMacrobenchmarkRule.measureRepeated()
moved to the newExperimentalConfig
object.
Bug Fixes
- Increase
lockClocks.sh
retry count ( 99e9dac ) - Don't create
nonMinified
and benchmark build types if existing. Due to a bug, even ifnonMinified
and benchmark build types existed, they were going to be recreated. ( e75f0a5 ) - Ignore non-terminating slices from
TraceSectionMetric
results. ( a927d20 ) - Improved emulator check to consider
sdk_
prefix. ( 1587de8 ) - Treat non-running packages as cleared in
FrameTimingGfxInfoMetric
. ( 35cc79c ) - Fix
androidx.benchmark.cpuEventCounter
producing corrupt values for non-Instruction events. ( 06edd59 ) - Fix
resumeTiming/runWithTimingDisabled
to respect metric priority order, and significantly reduce impact of lower priority metric pause/resume on higher priority metric results. For example, if using cpu perf counters viacpuEventCounter.enable
instrumentation argument, timeNs is no longer significantly reduced when pause/resume occur. ( 5de0968 )
সংস্করণ 1.3
সংস্করণ 1.3.4
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.3.4
is released. Version 1.3.4 contains these commits .
Bug Fixes
- Fixed Gradle Project Isolation incompatibilities in the Benchmark Baseline Gradle Plugin. ( b/404523257 )
সংস্করণ 1.3.3
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.3
is released. Version 1.3.3 contains these commits .
Bug Fixes
- Fixed
CollectBaselineProfileTask
when AVD device has spaces in it ( Ia0225 , b/371642809 )
সংস্করণ 1.3.2
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.2
is released. Version 1.3.2 contains these commits .
Bug Fixes
- Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. ( I2f678 , b/285187547 )
To use FTL apply the plugin to the baseline profile module in the plugin block, with:
plugins {
...
id("com.google.firebase.testlab")
}
and then configure firebase test lab with:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
Also the created FTL device needs to be added to the baseline profile extension:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.3.1
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.3.1
is released. Version 1.3.1 contains these commits .
Bug Fixes
- Added gradle property
androidx.baselineprofile.suppressWarnings
to suppress all baseline profile warnings ( I7c36e , b/349646646 ) - Fixed Baseline Profile Gradle Plugin to use pre-existing
nonMinified…
andbenchmark…
if created by the app instead of creating wrappers. ( Ia8934 , b/361370179 ) - Fixed
java.lang.AssertionError: ERRORS (not suppressed): EMULATOR
whenautomaticGenerationDuringBuild
is enabled on emulators. New argument is used to instead skip the test. ( If3f51 , b/355515798 ) - Microbenchmark minification - keep subclasses of
org.junit.runner.notification.RunListener
in benchmark library proguard ( Ic8ed5 , b/354264743 ) - Fix
TraceSectionMetric
to Ignore non-terminating slices. Previously these were considered to have -1 duration, eg during summation or finding minimum duration. ( If74b7 ) - Fixed an issue in
FrameTimingGfxInfoMetric
where starting the metric would crash if the process wasn't already running. ( I6e412 )
সংস্করণ 1.3.0
21 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0
is released. Version 1.3.0 contains these commits .
Microbenchmark changes since 1.2.0
- Method tracing is on by default in microbenchmarks when running on most devices
- Method tracing runs as a separate phase, after measurements - this enables accurate measurements and method traces to both be output from a single benchmark run
- Method tracing on some Android OS and ART versions will affect later measurement phases - on these versions, method tracing is off by default and a warning is printed to Studio output
- Main thread benchmarks and ANRs
- Added
measureRepeatedOnMainThread
for UI thread benchmarks (eg those that interact with Compose/View UIs) to avoid ANRs when running for many seconds. - Method traces are skipped if expected to overrun the ANR avoidance deadline. Set
androidx.benchmark.profiling.skipWhenDurationRisksAnr
to false to disable this behavior (not recommended for CI runs, as ANRs can cause problem in long CI runs).
- Added
- মিনিফিকেশন
- Embedded proguard rules to improve microbenchmarking with minification enabled
- Minification/R8 in a library module requires AGP 8.3, and can be enabled via
android.buildTypes.release.androidTest.enableMinification
in yourbuild.gradle
- Experimental
BlackHole.consume()
API added to prevent dead code elimination ( If6812 , b/286091643 )
- মেট্রিক্স
- Experimental cpu event counter feature (metrics from
perf_event_open
, which requires root on most versions of the platform), access viaInstrumentationArgument
androidx.benchmark.cpuEventCounter.enable
(can be set totrue
), andandroidx.benchmark.cpuEventCounter.events
can be set eg to (Instructions,CpuCycles
). This should be supported on some userdebug emulators, but support has not been tested across all available emulators
- Experimental cpu event counter feature (metrics from
MACRObenchmark changes since 1.2.0
- Method tracing overhaul for macrobenchmarks.
- Now method traces are scoped to the duration of the
measureBlock
, and can capture multiple sessions if the process starts multiple times. - Previously, method tracing would only work for
StartupMode.COLD
benchmarks, and capture nothing formeasureBlocks
that didn't restart the target process - Fixed method traces flush in macrobenchmark, so that method traces should be fully captured and valid, even on slower devices. ( I6349a , b/329904950 )
- Now method traces are scoped to the duration of the
- Correctly dump ART profile during individual
warmUp
iterations when process is killed soCompilationMode.Partial(warmup=N)
measurements are more accurate. ( I17923 ) - Drop Shader broadcast failure message
- Added debugging suggestions to drop shader broadcast failure message
- Add two instrumentation arguments for overriding shader dropping behavior to workaround crashes when benchmarking apps without
ProfileInstaller
1.3:-
androidx.benchmark.dropShaders.enable=true/false
: can be used to skip all shader dropping (including that done inStartupMode.Cold
launches), esp when benchmarking apps that don't yet use profileinstaller 1.3 -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: can be used to tolerate failures when trying to drop shaders, for example when benchmarking apps without profileinstaller 1.3 ( I4f573 )
-
- Added experimental
MacrobenchmarkRule#measureRepeated
variant which takes a customPerfettoConfig
for fully customized Perfetto trace recording. Note that incorrectly configured configs may cause built in Metric classes to fail. ( Idfd3d , b/309841164 , b/304038384 ) - Cancel background dexopt jobs before running a Macrobenchmark to reduce interference. ( I989ed )
- Macrobenchmark now waits for 1 second for the target application to flush an ART profile (previously it waited for 500 ms). ( I85a50 , b/316082056 )
- TraceSectionMetric overhaul
- Note :
TraceSectionMetric
changes below can affect outputs in CI usage, and may create discontinuities, or break parsing - Sum is now the default, as most usage of this metric is for repeated events, and first would discard data in these cases
- Changed to be more customizable, with more available modes
- Mode names are now embedded in metric output name (in Studio and JSON)
- Now supports slices created using
Trace.{begin|end}AsyncSection
.
- Note :
- মেট্রিক্স
- Power - Added
PowerMetric.deviceSupportsHighPrecisionTracking
,PowerMetric.deviceBatteryHasMinimumCharge()
andPowerMetric.deviceSupportsPowerEnergy()
- Renamed
Metric.getResult
togetMeasurements
to match return type - Added log.w / exception labels to all startup detection failures. This does not change current behavior (so some errors throw, and others silently fail to detect the startup), just makes it more understandable. Generally the ones that
Log.w()
and fail to report startup metrics are those where non-frame events are missing, exceptions are thrown when startup is detected except for frame timing information (from UI/RT slices). ( Id240f , b/329145809 ) - Added
frameCount
measurement toFrameTimingMetric
to aid in discovery of scenarios where measurements change because the number of frames produced changed (new animations added, invalidation issues fixed). ( I1e5aa ) - Clarified that
frameOverrunMs
is the preferred metric for tracking when available in docs, and why. ( I18749 , b/329478323 ) - Fixes issue where unterminated frames at the beginning and end of the trace could be paired together, which would incorrectly report as a single extremely long frame. ( I39353 , b/322232828 )
- Improve
FrameTimingMetric
error when frames aren't produced, and always output link to trace when failing metric parsing to assist in diagnosing problem. ( I956b9 ) - Fixed crash in
FrameTimingMetric
failing to parse frame id, especially on certain OEM devices. ( Ia24bc , b/303823815 , b/306235276 ) - Relaxed strictness of checks in
FrameMetrics
, and added more detail to error messages. ( Iadede )
- Power - Added
Baseline Profile capture / Gradle plugin changes since 1.2.0
- Increased max recommended version of AGP to 9.0.0-alpha01.
- Ensure
mergeArtProfile
andmergeStartupProfile
tasks always wait for baseline profile generation. ( I623d6 , b/343086054 ) - Generating a baseline profile successfully will output a summary of what changed ( I824c8 , b/269484510 )
- Added DSL to disable warnings ( Ic4deb , b/331237001 )
- Fix to ensure benchmarks use generated baseline profiles when
automaticGenerationDuringBuild
is off ( Ic144f , b/333024280 ) - Fix
BaselineProfile
gradle plugin property overrides to enable baseline profile generation and benchmarking when customizing anonMinified
or benchmark build type. ( Ib8f05 , b/324837887 ) - Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15. ( I1d2af , b/313992099 )
- Fixed baseline and startup profile output url at the end of generation task. ( I802e5 , b/313976958 )
Other significant changes since 1.2.0
- Trace capture
- Reduced EXITCODE 2 error when starting perfetto from an error to logged warning
- Enable AIDL tracing by default in benchmarks(requires API 28) ( Ia0af2 , b/341852305 )
- Enable porter tag tracing by default in benchmarks. This captures, for example, wakelock tracepoints. ( Icfe44 , b/286551983 )
- Increased trace capture start timeout to avoid crashes when starting tracing on slower devices ( I98841 , b/329145808 )
- Added public API
PerfettoTraceProcessor.Session.queryMetrics
APIs with JSON, textproto, and proto binary (undecoded) variants. These allow you to query metrics built intoTraceProcessor
( I54d7f , b/304038382 ) - Enable blocking start on Perfetto trace record to reduce risk of missing data at beginning of trace. Only supported on API 33+. ( Ie6e41 , b/310760059 )
- JSON output
- Added additional information in benchmark context in JSON output:
-
context.artMainlineVersion
- integer version of Art mainline module (if present on device,-1
otherwise) -
context.build.id
- Equals android.os.Build.ID -
context.build.version.codename
- Equals android.os.Build.VERSION.CODENAME -
context.build.version.abbreviatedCodename
- corresponds to first letter of pre-release codename (including on release builds) ( Ie5020 )
-
- Added
profilerOutput
list to JSON output for easier tooling around profiling traces (eg Perfetto, Method traces) ( I05ddd , b/332604449 ) - Added a warning when Android Test Orchestrator is used in benchmark modules, as this will cause per-module output JSON files to be repeatedly overwritten. ( Ia1af6 , b/286899049 )
- Throw when filenames are longer than 200 chars to avoid unclear crashes when writing or post-processing files. ( I4a5ab )
- Added additional information in benchmark context in JSON output:
সংস্করণ 1.3.0-আরসি 01
7 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0-rc01
is released. Version 1.3.0-rc01 contains these commits .
Bug Fixes
- Fix
androidx.benchmark.cpuEventCounter
producing corrupt values for non-Instruction events ( I7386a , b/286306579 ) - Fix
resumeTiming
/runWithTimingDisabled
to respect metric priority order, and significantly reduce impact of lower priority metric pause/resume on higher priority metric results. For example, if using cpu perf counters viacpuEventCounter.enable
instrumentation argument, timeNs is no longer significantly reduced when pause/resume occur. ( I39c2e , b/286306579 , b/307445225 ) - Reduced chance of stack sampling causing
measureRepeatedOnMainThread
from hitting main thread hard timeout by moving stack sampling conversion off main thread. ( I487a8 , b/342237318 ) - Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (eg R8 version 3.3) and for all builds when using AGP 8.1 or later (eg D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. আরো বিস্তারিত জানার জন্য এই নিবন্ধটি দেখুন. ( I9496c , b/345472586 )
- Added agp version check to send package name as instr arg. Previous to AGP 8.4.0 the target app package name cannot be send to the instrumentation app via instrumentation arguments. ( 0c72a3f )
সংস্করণ 1.3.0-BETA02
10 জুলাই, 2024
androidx.benchmark:benchmark-*:1.3.0-beta02
is released. Version 1.3.0-beta02 contains these commits .
Bug Fixes
- Gracefully handle EXITCODE
2
when starting Perfetto to log a warning, but proceed.
সংস্করণ 1.3.0-BETA01
জুন 12, 2024
androidx.benchmark:benchmark-*:1.3.0-beta01
is released. Version 1.3.0-beta01 contains these commits .
এপিআই পরিবর্তন
- Renamed
MethodTracing.affectsMeasurementOnThisDevice
toAFFECTS_MEASUREMENT_ON_THIS_DEVICE
for consistency. ( I1bdfa ) - Added experimental
BlackHole.consume()
api to prevent dead code elimination in microbenchmarks. ( If6812 , b/286091643 ) - Microbenchmark will now correctly throw to prevent method tracing from interfering with measurements. This occurs on certain devices when method tracing is forced on (via instrumentation args or
MicrobenchmarkConfig
), and if a measurement is attempted after a method trace. Affected devices are running API 26-30 or certain ART mainline module versions affected by this interference, and can be detected at runtime viaProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice
. ( Iafb92 , b/303660864 )
Bug Fixes
- Bumped max agp version recommended to 9.0.0-alpha01. ( I5bbb0 )
- Added compilation mode to benchmark context ( If5612 , b/325512900 )
- Enable AIDL tracing by default (requires API 28) ( Ia0af2 , b/341852305 )
- Added additional information in benchmark context in JSON output:
-
context.artMainlineVersion
- integer version of Art mainline module (if present on device, -1 otherwise) -
context.build.id
- Equalsandroid.os.Build.ID
-
context.build.version.codename
- Equalsandroid.os.Build.VERSION.CODENAME
-
context.build.version.abbreviatedCodename
- corresponds to first letter of pre-release codename (even on release builds) ( Ie5020 )
-
- Fixes
StackSampling
to respectandroidx.benchmark.profiling.sampleDurationSeconds
( Ib1d53 ) - Change macro->common dependency to be
api()
, so it's easier to use egPerfettoTrace
andPerfettoConfig
. ( Icdae3 , b/341851833 ) - Ensure
mergeArtProfile
andmergeStartupProfile
tasks always wait for baseline profile generation. ( I623d6 , b/343086054 ) - Consider variant enable state when deciding whether variant should be enabled. ( I5d19e , b/343249144 )
- Increased default start timeout for perfetto trace processor. ( I87e8c , b/329145808 )
Version 1.3.0-alpha05
14 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha05
is released. Version 1.3.0-alpha05 contains these commits .
Bug Fixes
- Throw clearer exception when macrobench metric returns zero values for all iterations ( Iab58f , b/314931695 )
- Additional workaround rules added to microbench proguard rules, including support for listener rules and other observed warnings / errors. ( I14d8f , b/329126308 , b/339085669 )
- Method tracing runs as a separate phase during a Macrobenchmark, and it no longer affects measurements. ( If9a50 , b/285912360 , b/336588271 )
- Added extra debugging suggestions to drop shader broadcast failure message. ( I5efa6 , b/325502725 )
Version 1.3.0-alpha04
1 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha04
is released. Version 1.3.0-alpha04 contains these commits .
এপিআই পরিবর্তন
- Added experimental
MacrobenchmarkRule#measureRepeated
variant which takes a customPerfettoConfig
for fully customized Perfetto trace recording. Note that incorrectly configured configs may cause built in Metric classes to fail. ( Idfd3d , b/309841164 , b/304038384 ) - Rename
PowerMetric.deviceSupportsPowerEnergy
toPowerMetric.deviceSupportsHighPrecisionTracking
for clarity ( I5b82f ) - Added
PowerMetric.deviceBatteryHasMinimumCharge()
andPowerMetric.deviceSupportsPowerEnergy()
to enable changing or skipping benchmarks based on device power measurement capability. ( I6a591 , b/322121218 )
Bug Fixes
- Added comparison with previous baseline profile ( I824c8 , b/269484510 )
- Added DSL to disable warnings ( Ic4deb , b/331237001 )
- Changed exception to info log when benchmark variants are disabled ( I8a517 , b/332772491 )
- Make it simpler to capture method traces for a Macrobenchmark is scoped to the duration of the actual
measureBlock()
. Previously, it started at target process launch and only supported cold starts ( Iee85a , b/300651094 ) - Avoid crashing when perfetto trace processor is slow to start ( I98841 , b/329145808 )
সংস্করণ 1.3.0-আলফা 03
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha03
is released. Version 1.3.0-alpha03 contains these commits .
নতুন বৈশিষ্ট্য
- Adds public API
PerfettoTraceProcessor.Session.queryMetrics
APIs with JSON, textproto, and proto binary (undecoded) variants. These allow you to query metrics built into TraceProcessor ( I54d7f , b/304038382 ) - Added
profilerOutput
to JSON output for easier tooling around profiling traces (eg perfetto, method traces). ( I05ddd , b/332604449 ) - Added power tag to benchmark Perfetto Config. This captures, for example, wakelock tracepoints. ( Icfe44 , b/286551983 )
- Added inst argument
androidx.benchmark.profiling.skipWhenDurationRisksAnr
, can be set to false to avoid skipping method traces when expected duration may cause an ANR - strongly recommended to avoid in CI runs. - Added experimental inst argument
androidx.benchmark.profiling.perfCompare.enable
, set this to true to run comparison timing between measurement and profiling phases. Useful in eg evaluating overhead of method tracing. ( I61fb4 , b/329146942 )
এপিআই পরিবর্তন
- Changed
TraceSectionMetric.Mode
to sealed class to enable future expansion without breaking exhaustive when statements ( I71f7b ) - Added
TraceSectionMetric.Mode.Average
and.Count
, and reordered args so the more common argument (mode) was earlier in the arg list, reducing need for specifying parameter names. ( Ibf0b0 , b/315830077 , b/322167531 ) - Renamed
Metric.getResult
togetMeasurements
to match return type ( I42595 )
Bug Fixes
- Fix to ensure benchmarks use generated baseline profiles when
automaticGenerationDuringBuild
is off ( Ic144f , b/333024280 ) - Fix
BaselineProfile
gradle plugin property overrides to enable baseline profile generation and benchmarking when customizing anonMinified
or benchmark build type. ( Ib8f05 , b/324837887 ) - Fixed method traces flush in macrobenchmark, so that method traces should be fully captured and valid, even on slower devices. ( I6349a , b/329904950 )
- Enable blocking start on Perfetto trace record to reduce risk of missing data at beginning of trace. Only supported on API 33+. ( Ie6e41 , b/310760059 )
- Added a warning when Android Test Orchestrator is used in benchmark modules, as this will cause per-module output JSON files to be repeatedly overwritten. ( Ia1af6 , b/286899049 )
- Force ',' (comma) thousands separators for consistency in Studio output, ignoring device locale ( I3e921 , b/313496656 )
-
TraceSectionMetric
now supports slices created usingTrace.{begin|end}AsyncSection
. ( I91b32 , b/300434906 ) - Added log.w / exception labels to all startup detection failures. This does not change current behavior (so some errors throw, and others silently fail to detect the startup), just makes it more understandable. Generally the ones that
Log.w()
and fail to report startup metrics are those where non-frame events are missing, exceptions are thrown when startup is detected except for frame timing information (from UI/RT slices). ( Id240f , b/329145809 ) - Cancel background dexopt jobs before running a Macrobenchmark to reduce interference. ( I989ed )
- Added
frameCount
measurement toFrameTimingMetric
to aid in discovery of scenarios where measurements change because the number of frames produced changed (new animations added, invalidation issues fixed). ( I1e5aa ) - Clarified that
frameOverrunMs
is the preferred metric for tracking when available in docs, and why. ( I18749 , b/329478323 )
সংস্করণ 1.3.0-আলফা 02
20 মার্চ, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha02
is released. Version 1.3.0-alpha02 contains these commits .
নতুন বৈশিষ্ট্য
Experimental R8 support in microbench via embedded proguard rules. Note that this support is experimental, and requires AGP 8.3 for minification of library module tests. Use the following to enable R8 minification/optimization in your benchmark module's
build.gradle
, which should lead to a significant performance increase, depending on workload. ( I738a3 , b/184378053 )android { buildTypes.release.androidTest.enableMinification = true }
Bug Fixes
- Fixes method tracing warning to be on separate line from microbench output. ( I0455c , b/328308833 )
Version 1.3.0-alpha01
ফেব্রুয়ারি 21, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha01
is released. Version 1.3.0-alpha01 contains these commits.
এপিআই পরিবর্তন
- Renamed
MicrobenchmarkConfig
boolean parameters to avoid unnecessary word 'should' ( Ia8f00 , b/303387299 ) - Added
BenchmarkRule.measureRepeatedOnMainThread
so main thread benchmarks (eg ones touching Views or Compose UIs) can avoid triggering ANRs, especially during large suites in CI. ( I5c86d ) - Added
FrameTimingGfxInfoMetric
, an experimental alternate implementation ofFrameTimingMetric
with measurements coming directly from the platform, rather than extracted from the Perfetto trace. ( I457cb , b/322232828 ) - Add the ability to dump an ART profile during individual
warmUp
iterations. ( I17923 ) - Several changes to
TraceSectionMetric
API:- Add
Mode.Min
,Mode.Max
- Add label argument to override section name as metric label
- Added mode name to output to clarify metric meaning
- Changed default to sum, as most usage of this metric is for repeated events Be aware of this changes in CI usage, as it may create discontinuities or break parsing. ( Ic1e82 , b/301892382 , b/301955938 )
- Add
বাগ ফিক্স
- Improved error message in baseline profile gradle plugin when specified managed device does not exist ( Idea2b , b/313803289 )
- Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15 ( I1d2af , b/313992099 )
- Fixed baseline and startup profile output url at the end of generation task ( I802e5 , b/313976958 )
- Adjusted data source timeouts to attempt to fix
java.lang.IllegalStateException: Failed to stop [ProcessPid(processName=perfetto, pid=...)]
( I8dc7d , b/323601788 ) - Add two instrumentation arguments for overriding shader dropping behavior to workaround crashes when benchmarking apps without
ProfileInstaller
1.3:-
androidx.benchmark.dropShaders.enable=true/false
: can be used to skip all shader dropping (including that done inStartupMode.Cold
launches), esp when benchmarking apps that don't yet use profileinstaller 1.3 -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: can be used to tolerate failures when trying to drop shaders, for example when benchmarking apps without profileinstaller 1.3 ( I4f573 )
-
- Skip method tracing on UI thread when expected to take longer than a few seconds, and cleanup method traces when throwing. ( I6e768 )
- Throw when filenames are longer than 200 chars to avoid unclear crashes when writing or post-processing files. ( I4a5ab )
- Fixes issue where unterminated frames at the beginning and end of the trace could be paired together, which would incorrectly report as a single extremely long frame. ( I39353 , b/322232828 )
- Use
--skip verification
on API 30+ when reinstalling a package on API 30-33 to clear ART profiles on user builds. This helps bypass Play Protect warnings that cause failures on some class of devices. ( Ic9e36 ) - Use
am force-stop
to kill apps when not a system app like System UI or Launcher. ( I5e028 ) - Macrobenchmark now waits for
1 second
for the target application to flush an ART profile (previously it waited for500 ms
). ( I85a50 , b/316082056 ) - Improve
FrameTimingMetric
error when frames aren't produced, and always output link to trace when failing metric parsing to assist in diagnosing problem. ( I956b9 ) - Fixed crash in
FrameTimingMetric
failing to parse frame id, especially on certain OEM devices. ( Ia24bc , b/303823815 , b/306235276 ) - Relaxed strictness of checks in
FrameMetrics
, and added more detail to error messages. ( Iadede )
সংস্করণ 1.2
সংস্করণ 1.2.4
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.2.4
is released. Version 1.2.4 contains these commits .
Bug Fixes
- Fixes baseline profile srcset not being set up in benchmark variants. Also fixes
automaticGenerationDuringBuild
in libraries causing a circular dependency. ( I28ab7 , b/333024280 ) - Use
am force-stop
to kill apps when not a system app like System UI or Launcher. This fixesStartupMode.COLD
benchmarks crashing from "Package $package must not be running prior to cold start!" due to process kill not fully succeeding. ( I5e028 )
সংস্করণ 1.2.3
24 জানুয়ারী, 2024
androidx.benchmark:benchmark-*:1.2.3
is released. Version 1.2.3 contains these commits.
Bug Fixes
- Removed exception from Baseline Profile Gradle Plugin when AGP version is 8.3.0 or higher.
- Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15.
সংস্করণ 1.2.2
ডিসেম্বর 1, 2023
androidx.benchmark:benchmark-*:1.2.2
is released. Version 1.2.2 contains these commits.
Baseline Profiles
- Execution logs will show the baseline profile output file path as a local file URI ( aosp/2843918 , aosp/2853665 , b/313976958 )
সংস্করণ 1.2.1
15 নভেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.1
is released. Version 1.2.1 contains these commits.
নতুন বৈশিষ্ট্য
- Improved error message when user disables test variants ( b/307478189 )
- Added properties to support AS test run integration ( b/309805233 ), ( b/309116324 )
সংস্করণ 1.2.0
18 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0
is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
Baseline Profiles
- New Baseline Profile Gradle Plugin automates capturing and including baseline profiles in your test and build workflow.
-
BaselineProfileRule.collect
now stable, a streamlined and simplified version of the previous experimentalBaselineProfileRule.collectBaselineProfile
API- Just specify
packageName
, and drive your app
- Just specify
- For libraries generating baseline profiles, you can now filter the rules generated either in code (
BaselineProfileRule.collect
argument), or even more simply in the gradle plugin - সংশোধন করে
- Fixed baseline profile collection on Android U+ ( Id1392 , b/277645214 )
Macrobenchmark
- সংকলন
- Macrobenchmark now correctly fully resets compilation state for each compile - this requires reinstalling the APK prior to Android 14, so benchmarking on Android 14+ is strongly recommended if you want to persist state (like user login) in what's being measured.
- You can also work around this by controlling app compilation separately, and skipping compilation with
CompilationMode.Ignore()
or instrumentation argument
Instrumentation Arguments
- Support for
androidx.benchmark.dryRunMode.enable
instrumentation argument, (already available in microbenchmark) for quicker validation runs (eg when creating the benchmark, or in presubmit) - Support for
androidx.benchmark.profiling.mode=StackSampling
andMethodTracing
. - Added
androidx.benchmark.enabledRules
to allow runtime filtering baseline profile vs macrobenchmark rule tests - Added
androidx.benchmark.perfettoSdkTracing.enable
argument to enable tracing with tracing-perfetto, eg Compose recomposition tracing. Note that when used withStartupMode.COLD
, timing will be significantly affected as the tracing library is loaded and enabled during app startup.
- Support for
প্রয়োজনীয়তা
- Macrobenchmark now requires
ProfileInstaller
1.3.0 or greater in the target app, to enable profile capture / reset, and shader cache clearing.
- Macrobenchmark now requires
New Experimental Metric APIs
- Added experimental
TraceSectionMetric
, which allows for extracting simple timing fromtrace("") {}
blocks in your app, or TraceMetric for leveraging the full query capability of PerfettoTraceProcessor
. - Added experimental
PowerMetric
to capture power usage information - Added experimental
MemoryCountersMetric
to count page faults - Added experimental
PerfettoTraceProcessor
API, which is used internally to extract metrics from System traces (aka Perfetto traces)
- Added experimental
সংশোধন করে
- Fixed crashes when installing or extracting profiles from an app installed from multiple APKs (eg from app bundle).
- Fixed
FrameTimingMetric
ignoring frames with inconsistent frame IDs (generally, frames during ripples on API 31+) ( I747d2 , b/279088460 ) - Fixed parsing errors on traces > 64MB ( Ief831 , b/269949822 )
- Clarified errors when device (especially emulator) OS image not correctly configured for tracing, or compilation
- Skip battery level check for devices without battery (micro and macro)
- Improved file output, with more clear errors for invalid output directories, and safer defaults
- Improved stability of
StartupMode.COLD
by consistently dropping the shader cache (also exposed viaMacrobenchmarkScope.dropShaderCache
) - Fixed leanback fallback for
startActivityAndWait
.
Microbenchmark
- বৈশিষ্ট্য
- Profiling was moved to a separate phase, after other metrics, so one test run can display both accurate timing and profiling results.
- পরীক্ষামূলক API
- Added experimental
MicrobenchmarkConfig
API for defining custom metrics and configuring tracing and profiling. Can be used to capture method traces, or capture tracepoints (but be aware of tracing overhead). - Added experimental APIs for controlling
BenchmarkState
separately fromBenchmarkRule
, without JUnit - Added experimental
PerfettoTrace
record to enable capturing Perfetto traces, with custom configuration, separate from benchmark APIs.
- Added experimental
- সংশোধন করে
- Workaround missing leading whitespaces in Android Studio benchmark output.
- Fix issue where warnings could fail to print in Android Studio benchmark output.
- Fixed
SampledProfiling
crash on Android 13 (API 33) and higher. - Massively improved performance of
dryRunMode
by skippingIsolationActivity
and Perfetto tracing (Up to 10x faster dry run mode on older OS versions).
Version 1.2.0-rc02
6 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc02
is released. Version 1.2.0-rc02 contains these commits.
Bug Fixes
- Fix Benchmark file output to no longer break
BaselineProfile
Plugin file copying. Files were generated and copied off device, but had been renamed such that the gradle plugin wouldn't see them. ( I8dbcc , b/303034735 , b/296453339 ) - Clarified
tracing-perfetto
loading error messages when injecting from macrobenchmark module into target application.
Version 1.2.0-rc01
20 সেপ্টেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc01
is released. Version 1.2.0-rc01 contains these commits.
Bug Fixes
- An exception (with remedy instructions) is now thrown when Perfetto SDK tracing fails to initialize in a Benchmark. ( I6c878 , b/286228781 )
- Fix OOM crash when converting ART method trace -> perfetto format. ( I106bd , b/296905344 )
- (Macrobenchmark) Clarified method tracing label when linked in Studio test output, and fixed method tracing filenames to be unique on device/host, so they won't be overwritten when more than one benchmark is run. ( I08e65 , b/285912360 )
- Ensures that the device is awake when capturing a baseline profile. ( I503fc )
Version 1.2.0-beta05
30 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta05
is released. Version 1.2.0-beta05 contains these commits.
নতুন বৈশিষ্ট্য
- The Baseline Profile Gradle Plugin now supports Android Gradle Plugin 8.3. ( aosp/2715214 )
Version 1.2.0-beta04
23 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta04
is released. Version 1.2.0-beta04 contains these commits.
নতুন বৈশিষ্ট্য
- The Baseline Profiles Gradle plugin now supports Android Gradle Plugin 8.3. ( aosp/2715214 )
Bug Fixes
- Fix failures in writing / moving and pulling files (especially those from parameterized tests) by sanitizing output file names further, avoiding '=' and ':' in output file names. ( I759d8 )
Version 1.2.0-beta03
9 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta03
is released. Version 1.2.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added argument to filter
TraceSectionMetric
to only the target package, on by default ( Ia219b , b/292208786 )
Bug Fixes
- Renamed
fullTracing.enable
instrumentation argument toperfettoSdkTracing.enable
for consistency with artifact name, and other references.fullTracing.enable
will continue to work as a fallback. ( I7cc00 ) - Benchmark library internal tracepoints (including microbenchmark loop/phase tracing) will now show up in Studio system trace viewer, and nest under the correct process in Perfetto. ( I6b2e7 , b/293510459 )
- Removed macrobenchmark NOT-PROFILEABLE error on API 31+, and skip profileable check on eng/userdebug rooted devices. ( I2abac , b/291722507 )
- When using Dex Layout Optimizations, startup profile rules are also now considered as baseline profile rules. ( aosp/2684246 , b/293889189 )
Version 1.2.0-beta02
জুলাই 26, 2023
androidx.benchmark:benchmark-*:1.2.0-beta02
is released. Version 1.2.0-beta02 contains these commits.
এপিআই পরিবর্তন
- Added experimental APIs for microbench custom metrics and configuration (eg profiler, and tracing). ( I86101 , b/291820856 )
Bug Fixes
- Report error in macrobench when OS is misconfigured for tracing, as was recently fixed in API 26/28 ARM64 emulators. ( I0a328 , b/282191686 )
- Added detail to compilation reset failure to suggest updating emulator, as some emulators have recently fixed this issue. ( I8c815 , b/282191686 )
- Make
androidx.test.uiautomator:uiautomator:2.2.0
anapi
instead of animplementation
dependency. ( I1981e )
Version 1.2.0-beta01
18 জুলাই, 2023
androidx.benchmark:benchmark-*:1.2.0-beta01
is released. Version 1.2.0-beta01 contains these commits.
Bug Fixes
- Fix warnings being sometimes suppressed in Benchmark output in Studio, and workaround leading whitespaces from Benchmark output not showing up in Studio ( Ia61d0 , b/227205461 , b/286306579 , b/285912360 )
- Fixed comment for
FrameTimingMetric
. The submetric is namedframeDurationCpuMs
. ( Ib097f , b/288830934 ).
Version 1.2.0-alpha16
জুন 21, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha16
is released. Version 1.2.0-alpha16 contains these commits.
এপিআই পরিবর্তন
-
BaselineProfileRule.collectBaselineProfile()
API has been renamed toBaselineProfileRule.collect()
. ( I4b665 )
Bug Fixes
- Macrobenchmark support for
androidx.benchmark.profiling.mode = MethodTracing
. ( I7ad37 , b/285912360 ) - Microbenchmark profiling moved to a separate phase, so it occurs in sequence after measurement, instead of replacing it.
MethodTracing
trace sections are also now included in the captured Perfetto trace, if present. ( I9f657 , b/285014599 ) - Add count measurement to
TraceSectionMetric
withMode.Sum
. ( Ic121a , b/264398606 )
Version 1.2.0-alpha15
7 জুন, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha15
is released. Version 1.2.0-alpha15 contains these commits.
নতুন বৈশিষ্ট্য
- Added experimental
MemoryUsageMetric
for tracking memory usage of a target application. ( I56453 , b/133147125 , b/281749311 ) - Add support for fully custom Perfetto configs with
PerfettoTrace.record
( If9d75 , b/280460183 ) - Added property to skip baseline profile generation. Usage:
./gradlew assemble -Pandroidx.baselineprofile.skipgeneration
. ( I37fda , b/283447020 )
এপিআই পরিবর্তন
- The
collectBaselineProfile
API always generates stable baseline profiles. ThecollectStableBaselineProfile
API has been removed andcollectBaselineProfile
should be used instead. ( I17262 , b/281078707 ) - Changed
BaselineProfileRule
'sfilterPredicate
arg to non-null, with a equivalent default value so that the default filter behavior is more clear in docs. ( I3816e )
বাগ ফিক্স
- Disable
IsolationActivity
and Perfetto tracing indryRunMode
to significantly improve performance, as these were majority of runtime. ( Ie4f7d ) - Support for call stack sampling in Macrobenchmarks using instrumentation test arguments
androidx.benchmark.profiling.mode=StackSampling
andandroidx.benchmark.profiling.sampleFrequency
. ( I1d13b , b/282188489 ) - Fixes crash when dropping shaders on Android U (API 34), as well as on emulators. ( I031ca , b/274314544 )
Version 1.2.0-alpha14
3 মে, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha14
is released. Version 1.2.0-alpha14 contains these commits.
Bug Fixes
- Fix
FrameTimingMetric
ignoring frames with inconsistent frame IDs. This would cause some animations on recent platform versions (API 31+) to ignore many frames whileRenderThread
was animating (eg during a ripple). ( I747d2 , b/279088460 ) - Fixed trace processor parsing for traces larger than 64Mb. ( Ief831 , b/269949822 )
- Fixed baseline profile generation on Android U failing because of the different output of
pm dump-profiles
command. ( Id1392 , b/277645214 ) - Fix GPU clock locking script to compare strings correctly ( I53e54 , b/213935715 )
Version 1.2.0-alpha13
5 এপ্রিল, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha13
is released. Version 1.2.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Added profile type parameter when generating baseline profiles to support upcoming startup profile feature ( Ie20d7 , b/275093123 )
- Added new experimental
TraceMetric
API for defining fully custom metrics based on content of a Perfetto trace. ( I4ce31 , b/219851406 ) - Add an experimental metric to determine the number of page faults during a benchmark. ( I48db0 )
Version 1.2.0-alpha12
22 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha12
is released. Version 1.2.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- The new baseline profile gradle plugin is released in alpha version, making it easier to generate a baseline profile and simplifying the developer workflow.
এপিআই পরিবর্তন
- Removed Perfetto tracing support on API 21 and 22, which includes both Microbenchmarks and the experimental
PerfettoTrace
APIs. Prior to this version,UiAutomation
connections were unreliable on some devices. ( I78e8c ) - Added public experimental API for
PerfettoTraceProcessor
to enable parsing trace content. This is a step toward fully custom metrics based on Perfetto trace data. ( I2659e , b/219851406 )
Version 1.2.0-alpha11
8 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha11
is released. Version 1.2.0-alpha11 contains these commits.
Bug Fixes
- Fixed crashes in
MacrobenchmarkRule
andBaselineProfileRule
when reinstalling or extracting profiles from an app bundle with multiple APKs. ( I0d8c8 , b/270587281 )
Version 1.2.0-alpha10
22 ফেব্রুয়ারি, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha10
is released. Version 1.2.0-alpha10 contains these commits.
নতুন বৈশিষ্ট্য
- On Android 14+, Macrobenchmark no longer reinstalls target applications to reset compilation state, thanks to a new platform feature. Previously it was necessary to have a rooted device, or to deal with all application state (eg user login) being removed before each benchmark runs. ( I9b08c , b/249143766 )
Bug Fixes
- Fix
DryRunMode
to no longer crash with empty profile, due to compilation skipping. Instead, it runs a single iteration and extracts the profile to ensure something is captured. ( I2f05d , b/266403227 ) - Fix
PowerMetric
crash when checking for powerstats presence on old API levels. ( 5faaf9 , b/268253898 )
Version 1.2.0-alpha09
11 জানুয়ারী, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha09
is released. Version 1.2.0-alpha09 contains these commits.
Bug Fixes
- Enabled passing
None
toandroidx.benchmark.enabledRules
instrumentation arg to disable all benchmarks / baseline profile generation. ( I3d7fd , b/258671856 ) - Fix
PerfettoTrace
capture in app modules (ie non-self-instrumenting test APKs) ( I12cfc ) - Fixed baseline profile adb pull argument order in Studio output ( I958d1 , b/261781624 )
- Arm emulator api 33 is now correctly recognized as such when trying to run a macrobenchmark and will correctly print the warning. ( 69133b , b/262209591 )
- Skip battery level check on devices without battery in Macrobenchmark ( fe4114 , b/232448937 )
Version 1.2.0-alpha08
December 7, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha08
is released. Version 1.2.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- পরীক্ষার আচরণ এবং কর্মক্ষমতা পরিদর্শন করতে পরীক্ষার অংশ হিসাবে পারফেটো ট্রেসগুলি (সিস্টেম ট্রেস হিসাবেও পরিচিত) ক্যাপচার করতে পরীক্ষামূলক নতুন এপিআইএস
PerfettoTrace.record {}
এবংPerfettoTraceRule
যুক্ত করা হয়েছে। ( I3ba16 ) -
BaselineProfileRule
now accepts a filter predicate instead of a list of package prefixes. This gives the test full control on filtering. ( I93240 ) - Add an experimental API
BaselineProfileRule.collectStableBaselineProfile
which waits until a baseline profile is stable for N iterations. ( I923f3 ) - Add the ability to specify an output file name prefix when generating baseline profiles using
BaselineProfileRule
. ( I7b59f , b/260318655 )
Bug Fixes
- Improve safety of file output writing, which should prevent output files from silently not being written / appended, especially on API 21/22. ( If8c44 , b/227510293 )
- Fix
simpleperf
trace output to create and place the file correctly. This should also more generally fix issues where a file is unsuccessfully pulled by gradle. ( I12a1c , b/259424099 ) - Improve profileinstaller error message printed when profileinstaller is too old. This now tells you to update profileinstaller version (1.2.1) for measuring baseline profiles on API 31 through 33, instead of saying it's not supported. ( Ia517f , b/253519888 )
- Fix several shell command failures onerror message Print needed API <=23, including failed perfetto capture binary setup and trace capture failures ( Ib6b87 , b/258863685 )
- Automatically sort generated profile rules to minimize the number of changes as they change over time (when checking-in profile rules into source control). ( Ie2509 )
- Fixed crash on unrooted builds below Android 13 (API 33) with message
Expected no stderr from echo 3 > /proc/sys/vm/drop_caches
( I6c245 , b/259508183 )
Known Issues - MacrobenchmarkScope.dropShaderCache()
may crash due to a missing broadcast registry in profileinstaller manifest, which has not yet been released. ( I5c728 , b/258619948 ) To workaround the issue in profileinstaller:1.3.0-alpha02
, add the following to your application's (not your benchmark's) AndroidManifest.xml:
<!-- workaround bug in profileinstaller 1.3.0-alpha02, remove when updating to alpha03+ -->
<receiver
android:name="androidx.profileinstaller.ProfileInstallReceiver"
android:permission="android.permission.DUMP"
android:exported="true">
<intent-filter>
<action android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
</intent-filter>
</receiver>
Version 1.2.0-alpha07
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha07
is released. Version 1.2.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Adds
PowerMetric
API for measuring energy and power in Macrobenchmarks. ( Ife601 , b/220183779 ) - Fixed
MacrobenchmarkScope.dropShaderCache()
to actually drop the shader cache. This removes roughly 20ms of noise fromStartupMode.COLD
benchmarks, as shaders are now consistently cleared each iteration. Previously,Partial
compilation using warmup iterations would report incorrectly fast numbers, as shader caching was more likely to happen during warmup. This fix requires either a rooted device, or usingprofileinstaller:1.3.0-alpha02
in the target app. ForProfileInstaller
library's API changes, please refer to ProfileInstaller 1.30-alpha02 page. ( Ia5171 , b/231455742 ) - Added
TraceSectionMode("label", Mode.Sum)
, allowing measurement of total time spent on multiple trace sections with the same label. For instance,TraceSectionMetric("inflate", Mode.Sum)
will report a metricinflateMs
for the total time in a macrobenchmark spent on inflation. Also removed API 29 requirement, asTraceSectionMetric
works together withandroidx.tracing.Trace
back to lower API levels, with the use offorceEnableAppTracing
within the target app. ( Id7b68 , b/231455742 )
Bug Fixes
- Improved safety of all internal shell commands by validating all output/errors. ( I5984d , b/255402908 , b/253094958 )
- Specify device in baseline profile
adb pull
command, so the pull command can be simply copied if multiple devices are connected (up to one emulator) ( I6ac6c , b/223359380 ) - Add error if macrobenchmark test apk isn't set up as self-instrumenting. This error prevents macrobenchmarking from within the target app's process. In process, macrobench wouldn't be able to compile/kill/cold start the app, or control its own permissions ( I4279b )
- Fixed an issue in
measureRepeated()
whereStartupMode.COLD
wouldn't kill the target process aftersetupBlock
. NowsetupBlock
interacting with the app will not leave the app process running, and an invalid cold start measurement. ( I8ebb7 )
Version 1.2.0-alpha06
24 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha06
is released. Version 1.2.0-alpha06 contains these commits.
এপিআই পরিবর্তন
-
BaselineProfileRule
no longer requires root on Android 13 (API 33), and is no longer experimental. ( Ie0a7d , b/250083467 , b/253094958 )- This change also fixes how profiles from an app are flushed to disk on unrooted devices, but requires updating the target app's profileinstaller dependency.
- To use
BaselineProfileRule
orCompilationMode.Partial(warmupIterations)
on an unrooted device, you must also update your target app to useandroidx.profileinstaller.profileinstaller:1.3.0-alpha01
. This enables flushing the profile to disk correctly, so that it can be compiled/extracted.
Bug Fixes
- Fixes
SampledProfiling
crash on API 33+. ( I40743 , b/236109374 )
Version 1.2.0-alpha05
5 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha05
is released. Version 1.2.0-alpha05 contains these commits.
Bug Fixes
- Fix frame breakdown in Studio system trace viewer for benchmark captured traces ( I3f3ae , b/239677443 )
- Correct
FrameTimingMetric
to listFrameOverrun
as requiring API 31 instead of 29 ( I716dd , b/220702554 ) - Set iteration in
BaselineProfileRule
, and throw clearly if target package not installed (was already done for MacrobenchmarkRule). ( Ic09a3 , b/227991471 )
Version 1.2.0-alpha04
21শে সেপ্টেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha04
is released. Version 1.2.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
Add support for
dryRunMode.enable
instrumentation argument to macrobenchmark (already available in micro) for faster local development, and validating app automation (eg in presubmit). This overrides iterations to 1, skips compilation, suppresses all configuration errors , and disables measurement .json file output. ( Ib51b4 , b/175149857 )On Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.dryRunMode.enable=true
In build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.dryRunMode.enable', 'true' } }
Bug Fixes
- Fixed
StartupTimingMetric
to no longer require measured Activities to be launched throughMacrobenchmarkScope.startActivityAndWait()
. This means the metric can pick up launches from eg notifications,Context.startActivity()
, in-app Activity based navigation, or shell commands. ( Ia2de6 , b/245414235 ) - Fix bug where
startActivityAndWait
would timeout trying to wait for launch completion on emulators by reducing strictness of frame detection. ( Ibe2c6 , b/244594339 , b/228946895 )
Version 1.2.0-alpha03
September 7, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha03
is released. Version 1.2.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added experimental APIs for using
BenchmarkState
independently, separate fromBenchmarkRule
/JUnit4
. ( Id478f , b/228489614 )
Bug Fixes
- Added Leanback fallback for
startActivityAndWait
. ( 01ed77 , b/242899915 )
Version 1.2.0-alpha02
24 আগস্ট, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha02
is released. Version 1.2.0-alpha02 contains these commits.
এপিআই পরিবর্তন
- Default to
am force stop
forMacrobenchmarkScope.killProcess()
, even when rooted, except during Baseline Profile generation. This can be overridden with an optional boolean argument. ( 02cce9 , b/241214097 )
Bug Fixes
- Support baseline profile generation for System apps. ( I900b8 , b/241214097 )
- Support checking for ODPM power metrics on unrooted devices. ( a38c78 , b/229623230 )
Version 1.2.0-alpha01
জুলাই 27, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha01
is released. Version 1.2.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- New tracing-perfetto-common component allowing tooling to enable Perfetto SDK tracing in an app that exposes it ( I2cc7f )
Added
androidx.benchmark.enabledRules
instrumentation argument to enable filtering macrobenchmark runs to just benchmarks, or just baseline profile generation. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when just generatingBaselineProfiles
on an emulator. Comma-separated list also Supported. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
এপিআই পরিবর্তন
- Added new
PowerMetric
for measuring energy and power tasks in benchmarks. ( I9f39b , b/220183779 ) - Added a new compilation mode
CompilationMode.Ignore
to skip profile reset and compilation. ( Ibbcf8 , b/230453509 ) - Added a new parameter to
BaselineProfileRule#collectBaselineProfile
to filter output file by package names ( If7338 , b/220146561 ) - Enables developer to discharge device to measure power drain. ( I6a6cb )
- Added the ability to clear shader cache in
MacrobenchmarkScope
. ( I32122 ) - Enables developer to configure display of metric type and detail desired subsystem categories. ( I810c9 )
- Previously an
UnsupportedOperationException
was thrown in the benchmark if run on an unsupported device. Now UOE only occurs if the metric is used on the unsupported device (ie:PowerMetric.configure
). ( I5cf20 , b/227229375 ) - Added
TotalPowerMetric
andTotalEnergyMetric
for measuring total power and energy in each system category in macrobenchmarks. ( I3b26b , b/224557371 )
Bug Fixes
- Fixed an issue where compiled methods were not correctly being reset between each macrobenchmark on unrooted builds. This unfortunately requires reinstalling the apk each iteration, which will clear application data for each macrobenchmark. ( I31c74 , b/230665435 )
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 , b/227510293 , b/227512788 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
Version 1.1.1
Version 1.1.1
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.1.1
is released. Version 1.1.1 contains these commits.
Bug Fixes
- Fixes
android.system.ErrnoException: open failed: EACCES
which would occur on some Android11 (API 30)+ devices. This is a cherry-pick of a fix from1.2.0-alpha01
. ( aosp/2072249 )
সংস্করণ 1.1.0
সংস্করণ 1.1.0
15 জুন, 2022
androidx.benchmark:benchmark-*:1.1.0
is released. Version 1.1.0 contains these commits.
- This version is identical to
androidx.benchmark:benchmark-*:1.1.0-rc03
.
Important changes since 1.0.0
Support for Jetpack Macrobenchmarks, which allows you to measure whole-app interactions like startup and scrolling , provides the ability to capture traces & measure trace sections .
Support for Baseline Profiles
-
CompilationMode.Partial
to measure the effectiveness of Baseline Profiles. -
@BaselineProfileRule
to automatically generate Baseline profiles for a given critical user journey.
-
Support for Allocation metrics & profiling during Microbenchmark runs.
Version 1.1.0-rc03
জুন 1, 2022
androidx.benchmark:benchmark-*:1.1.0-rc03
is released. Version 1.1.0-rc03 contains these commits.
Bug Fixes
Avoid reinstalling the target package on every benchmark iteration. ( aosp/2093027 , b/231976084 )
Remove the
300ms
delay frompressHome()
. ( aosp/2086030 , b/231322975 )Improve Macrobenchmark iteration speed by optimizing Shell commands used under the hood. ( aosp/2086023 , b/231323582 )
Support for Managed Gradle Devices when generating Baseline Profiles with Macrobenchmarks. ( aosp/2062228 , b/228926421 )
Version 1.1.0-rc02
May 11, 2022
androidx.benchmark:benchmark-*:1.1.0-rc02
is released. Version 1.1.0-rc02 contains these commits.
- Note that this release includes a behavior change, as apps are now fully reinstalled in between each benchmark to ensure accurate measurements.
Bug Fixes/Behavior Changes
Fixed an issue where app compilation was not correctly reset between macrobenchmarks, and not reset at all on unrooted builds. This fixes many cases where running multiple tests would result in
CompilationMode
having little to no effect on measurements. To workaround this problem, the target app is now fully reinstalling each test method, which will clear application data between each macrobenchmark. ( I31c74 , b/230665435 )As this prevents apps from setting up state before tests, it is now possible to skip compilation / reinstallation to enable working around this. You can for example fully compile the target with a shell command
cmd package compile -f -m speed <package>
, and then bypass macrobenchmark's compilation step.Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.compilation.enabled, 'false' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.compilation.enabled=false
Made it possible to share a module between macrobenchmarks and baseline profile generating tests by adding
androidx.benchmark.enabledRules
instrumentation argument. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when generatingBaselineProfiles
on an emulator. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
Version 1.1.0-rc01
20 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-rc01
is released. Version 1.1.0-rc01 contains these commits.
Bug Fixes
- Baseline profile output links in Android Studio now use a unique file name. This way the output always reflects the latest results of using a
BaselineProfileRule
. ( aosp/2057008 , b/228203086 )
Version 1.1.0-beta06
6 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-beta06
is released. Version 1.1.0-beta06 contains these commits.
Bug Fixes
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
- Fix startup metrics for Macrobenchmarks when
CompilationMode.None()
is used. Before this change,CompilationMode.Partial()
would appear to be slower thanCompilation.None()
. ( 611ac9 ).
Version 1.1.0-beta05
23 মার্চ, 2022
androidx.benchmark:benchmark-*:1.1.0-beta05
is released. Version 1.1.0-beta05 contains these commits.
Bug Fixes
- Kill package after skipping profile installation when using
CompilationMode.None
. ( aosp/1991373 ) - Fixed an issue where Macrobenchmarks is unable to collect startup metrics when using
StartupMode.COLD
. ( aosp/2012227 b/218668335 )
Version 1.1.0-beta04
23 ফেব্রুয়ারি, 2022
androidx.benchmark:benchmark-*:1.1.0-beta04
is released. Version 1.1.0-beta04 contains these commits.
Bug Fixes
Fix missing metrics on Android 10, and
NoSuchElementException
caused by process names not being captured correctly in traces. ( Ib4c17 , b/218668335 )Use
PowerManager
for thermal throttling detection on Q (API 29) and higher. This significantly reduces frequency of false positives in thermal throttling detection (benchmark retry after 90 second cooldown), and speeds up benchmarks significantly on user builds. It also provides throttle detection even when clocks are locked (if they're locked too high for the device's physical environment). ( I9c027 , b/217497678 , b/131755853 )Filter simpleperf sampled profiling to
measureRepeated
thread only to simplify inspection ( Ic3e12 , b/217501939 )Support metrics from named UI subprocesses in multi-process apps ( Ice6c0 , b/215988434 )
Filter Baseline Profile rules to target Android 9 (SDK 28). aosp/1980331 b/216508418
Skip Profile Installation when using
Compilation.None()
. Additionally, report warnings when the app is using an older version ofandroidx.profileinstaller
and Android Gradle Plugin. aosp/1977029
Version 1.1.0-beta03
ফেব্রুয়ারী 9, 2022
androidx.benchmark:benchmark-*:1.1.0-beta03
is released. Version 1.1.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added
AudioUnderrunMetric
into macrobenchmark library under experimental flag to allow detection of audio underruns ( Ib5972 ) BaselineProfileRule
no longer accepts asetup
block as this functioned the same as theprofileBlock
. ( Ic7dfe , b/215536447 )যেমন
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, setupBlock = { startActivityAndWait() }, profileBlock = { // ... } ) }
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, profileBlock = { startActivityAndWait() // ... } ) }
Bug Fixes
- Fixed issue where microbench profiler traces would fail to be updated in subsequent runs when linked in Studio output ( I5ae4d , b/214917025 )
- Prevent compilation shell commands on API 23 ( Ice380 )
- Renamed
FrameCpuTime
->FrameDurationCpu
,FrameUiTime
->FrameDurationUi
to clarify these are durations, not timestamps, and to match prefixes. ( I0eba3 , b/216337830 )
Version 1.1.0-beta02
জানুয়ারী 26, 2022
androidx.benchmark:benchmark-*:1.1.0-beta02
is released. Version 1.1.0-beta02 contains these commits.
Bug Fixes
- Microbenchmark Stack Sampling / Method Tracing Profile results are now linked in Studio output, similar to other profiling outputs, and do not suppress the allocation metric. ( Idcb65 , b/214440748 , b/214253245 )
- BaselineProfileRule now prints the
adb pull
command in logcat and Studio output for pulling generated BaselineProfile text file. ( f08811 )
Version 1.1.0-beta01
জানুয়ারী 12, 2022
androidx.benchmark:benchmark-*:1.1.0-beta01
is released. Version 1.1.0-beta01 contains these commits.
Bug Fixes
- Fixes profiler argument enable being ignored. ( I37373 , b/210619998 )
- Removed deprecated
CompliationModes
( I98186 , b/213467659 ) - Switched baseline profile arg of
CompilationMode.Partial
to enum for clarity. ( Id67ea )
Version 1.1.0-alpha13
15 ডিসেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha13
is released. Version 1.1.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Add low-overhead System Tracing to microbench output on Android Q (API 29+). Note that this does not currently capture custom tracing (via
android.os.Trace
orandroidx.tracing
Jetpack APIs) to avoid affecting results. This tracing should be useful in diagnosing instability, especially from sources outside the benchmark. ( I298be , b/205636583 , b/145598917 ) - Clarify
CompilationModes
into three classes - Full, None, Partial. Previously they were inconsistently named after compilation arguments (which we now treat as implementation details) and features. This makes the tradeoffs, potential combinations, and behavior across platform versions more clear. ( I3d7bf , b/207132597 ) - Setup and measure are now always in pairs, in order. You can now query the package name and iteration (though the iteration may be
null
in certain warmup scenarios). ( Id3b68 , b/208357448 , b/208369635 )
Bug Fixes
- Fixed
CompilationMode.Speed
incorrectly treated asNone
( I01137 )
Version 1.1.0-alpha12
নভেম্বর 17, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha12
is released. Version 1.1.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- Add experimental TraceSectionMetric for custom trace-based timing measurements. ( I99db1 , b/204572664 )
Bug Fixes
- Wake device each iteration, to ensure UI can be tested - requires lockscreen is disabled. ( Ibfa28 , b/180963442 )
- Fixes multiple crashes in StackSampling profiling mode on emulators and non-rooted devices ( Icdbda , b/202719335 )
- Removed 0.5 second sleep at the end of each iteration - if you see missing metrics with this change, please file a bug. ( Iff6aa )
- Reduce chances of dropped data, and lower memory overhead from tracing ( Id2544 , b/199324831 , b/204448861 )
- Reduce trace size by ~40% by switching to compact sched storage format. ( Id5fb6 , b/199324831 )
- Updated implementations of startup metrics to always end at end of renderthread. This will be more contistent across platform versions, and more closely map to in-app measurements. ( Ic6b55 )
Version 1.1.0-alpha11
3 নভেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha11
is released. Version 1.1.0-alpha11 contains these commits.
এপিআই পরিবর্তন
- Macrobenchmark now has a
minSdkVersion
of23
. ( If2655 ) - Adds a new experimental
BaselineProfileRule
which is capable of generating baseline profiles for app's critical user journey. Detailed documentation to follow. ( Ibbefa , b/203692160 ) - Removes measureRepeated interface variant, which was added for java callers, as it caused ambiguity in completing/resolving the method. Java callers will again need to return Unit.Instance from measureRepeated. If this is an inconvenience, please file a bug, we can revisit this in a future version. ( Ifb23e , b/204331495 )
Version 1.1.0-alpha10
27 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha10
is released. Version 1.1.0-alpha10 contains these commits.
এপিআই পরিবর্তন
- Backport StartupTimingMetric to work back to API 23. This new implementation also better handles reportFullyDrawn() to wait until corresponding content has been rendered. ( If3ac9 , b/183129298 )
- Added JvmOverloads to multiple MacrobenchmarkScope methods for Java callers. ( I644fe , b/184546459 )
- Provide alternative MacrobenchmarkRule.measureRepeated function that uses a
Consumer<MacrobenchmarkScope>
for idiomatic usage in Java language. ( If74ab , b/184546459 )
Bug Fixes
- Fix for traces not starting early enough, and missing metric data. This is expected to fix "Unable to read any metrics during benchmark" exceptions that were caused by the library itself. ( I6dfcb , b/193827052 , b/200302931 )
- FrameNegativeSlack has been renamed to FrameOverrun to clarify its meaning - how much the frame went over its time budget. ( I6c2aa , b/203008701 )
Version 1.1.0-alpha09
13 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha09
is released. Version 1.1.0-alpha09 contains these commits.
Bug Fixes
- Support dropping Kernel page cache without root on API 31/S+, which will increase accuracy of StartupMode.COLD launches. ( Iecfdb , b/200160030 )
Version 1.1.0-alpha08
সেপ্টেম্বর 29, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha08
is released. Version 1.1.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- Enable scrolling macrobenchmarks to run back to API 23 ( If39c2 , b/183129298 )
- Add new type of sampled metric to UI and JSON output, focused on percentiles of multiple samples per iteration. ( I56247 , b/199940612 )
- Switch to floating point metrics throughout the benchmark libraries (truncated in the Studio UI). ( I69249 , b/197008210 )
Version 1.1.0-alpha07
1 সেপ্টেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha07
is released. Version 1.1.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Raised min API to 21 to reflect the intended lowest API level to be supported in the future. Current min API supported continues to be conveyed via RequiredApi(), and is currently 29 ( I440d6 , b/183129298 )
Bug Fixes
- Fixes
ProfileInstaller
to make it easier for apps using baseline profiles to run MacroBenchmarks usingCompilationMode.BaselineProfile
. ( I42657 , b/196074999 ) NOTE: requires also updating toandroidx.profileinstaller:profileinstaller:1.1.0-alpha04
or greater. -
StartupMode.COLD
+CompilationMode.None
benchmarks are now more stable. ( I770cd , b/196074999 )
Version 1.1.0-alpha06
18 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha06
is released. Version 1.1.0-alpha06 contains these commits.
এপিআই পরিবর্তন
- Added
androidx.benchmark.iterations
instrumentation argument to allow manual overriding of iteration count when testing/profiling locally. ( 6188be , b/194137879 )
Bug Fixes
- Switched to Simpleperf as default sampling profiler on API 29+. ( Ic4b34 , b/158303822 )
পরিচিত সমস্যা
-
CompilationMode.BaselineProfile
is a work in progress. Avoid using it to determine how good a profile is for now.
Version 1.1.0-alpha05
4 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha05
is released. Version 1.1.0-alpha05 contains these commits.
1.1.0-alpha04
was cancelled before release due to a sporatic crash. b/193827052
এপিআই পরিবর্তন
- Switched startActivityAndWait to invoke launch via
am start
, which reduces the time of each measurement iteration by approximately 5 seconds, at the cost of no longer supporting intent parcelables. ( I5a6f5 , b/192009149
Bug Fixes
- Reduce aggressiveness of thermal throttle detection, and recompute baseline if throttles are detected frequently. ( I7327b )
- Fixes FrameTimingMetric to work on Android S beta ( Ib60cc , b/193260119 )
- Use an
EmptyActivity
to bring the target app out of a force-stopped state to better supportCompilationMode.BaselineProfile
. ( Id7cac , b/192084204 ) - Changed trace file extension to
.perfetto-trace
to match platform standard. ( I4c236 , b/174663039 ) - StartupTimingMetric now outputs the "fullyDrawnMs" metric to measure time until your application has completed rendering. To define this metric for your app, call Activity.reportFullyDrawn when your initial content is ready, such as when your initial list items are loaded from DB or network. (reportFullyDrawn method available without build version checks on ComponentActivity). Note that your test must run long enough to capture the metric (startActivityAndWait doesn't wait for reportFullyDrawn). ( If1141 , b/179176560 )
- Reduce cost of appending Ui metadata to traces by 50+ ms ( Ic8390 , b/193923003 )
- Drastically increased polling frequency when stopping tracing, which can reduce eg startup benchmark runtime by 30+% ( Idfbc1 , b/193723768 )
Version 1.1.0-alpha03
16 জুন, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha03
is released. Version 1.1.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added a new
CompilationMode.BaselineProfile
to support profiles installed using the Jetpack ProfileInstaller library . ( aosp/1720930 )
Bug Fixes
The sample Gradle code for suppressing benchmark errors has been updated to use a non-deprecated API with a syntax that also supports .gradle.kts users.
যেমন,
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"
Version 1.1.0-alpha02
18 মে, 2021
Benchmark version 1.1.0-alpha02 brings a big component to benchmarking - Macrobenchmark. In addition to benchmark allowing you to measure CPU loops, macrobenchmark allows you to measure whole-app interactions like startup and scrolling, and capture traces. For more information see the library documentation .
androidx.benchmark:benchmark-*:1.1.0-alpha02
is released. Version 1.1.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
Macrobenchmark artifacts added ( androidx.benchmark:benchmark-macro-junit4
and androidx.benchmark:benchmark-macro
)
- Capture startup, scrolling/animation performance metrics from your app, locally or in CI
- Capture and inspect traces from within Android Studio
Bug Fixes
- Workaround shell permissions issue with output directory on Android 12 (Note - may require updating Android Gradle Plugin to 7.0.0 canary and Android Studio to Arctic Fox (2020.3.1), to continue capturing output files on affected devices). ( Icb039 )
- Support configuration caching in BenchmarkPlugin ( 6be1c1 , b/159804788 )
- Simplified file output - on by default, in a directory that doesn't require
requestLegacyExternalStorage=true
( 8b5a4d , b/172376362 ) - Fixes library printing logcat warnings about not finding JIT thread on platform versions where it is not present. ( I9cc63 , b/161847393 )
- Fix for reading device max frequency. ( I55c7a )
Version 1.1.0-alpha01
জুন 10, 2020
androidx.benchmark:benchmark-common:1.1.0-alpha01
, androidx.benchmark:benchmark-gradle-plugin:1.1.0-alpha01
, and androidx.benchmark:benchmark-junit4:1.1.0-alpha01
are released. Version 1.1.0-alpha01 contains these commits.
New Features of 1.1
- Allocation Metric - Benchmarks now run an additional phase after warmup and timing, capturing allocation counts. Allocations can cause performance problems on older versions of the platform (140ns in O became 8ns in M - measured on Nexus5X, with locked clocks). This metric is displayed in Android Studio console output, as well as in the
- Profiling support - You can now capture profiling data for a benchmark run, to inspect why your code may be running slowly. Benchmark supports capturing either method tracing, or method sampling from ART. These files can be inspected with the Profiler inside Android Studio using File > Open .
- The Benchmark Gradle plugin now provides defaults for simpler setup:
-
testBuildType
is set to release by default, to avoid using dependencies with code coverage built-in. The release buildType is also configured as the default buildType, which allows Android Studio to automatically select the correct build variant when opening a project for the first time. ( b/138808399 ) -
signingConfig.debug
is used as the default signing config ( b/153583269 )
-
** Bug Fixes **
- Significantly reduced the warmup transition overhead, where the first measurement for each benchmark was artificially higher than others. This issue was more pronounced in very small benchmarks (1 microsecond or less). ( b/142058671 )
- Fixed
InstrumentationResultParser
error printed for each benchmark when running from command line. ( I64988 , b/154248456 )
পরিচিত সমস্যা
- Command line, gradle invocations of Benchmark do not print out results directly. You can work around this by either running through Studio, or parsing the JSON output file for results.
- Benchmark reporting fails to pull the report from devices that have an app installed with an applicationId ending with either “android” or “download” (case insensitive). Users hitting this issue should upgrade the Android Gradle Plugin to 4.2-alpha01 or later.
সংস্করণ 1.0.0
Benchmark Version 1.0.0
নভেম্বর 20, 2019
androidx.benchmark:benchmark-common:1.0.0
, androidx.benchmark:benchmark-gradle-plugin:1.0.0
, and androidx.benchmark:benchmark-junit4:1.0.0
are released with no changes from 1.0.0-rc01. Version 1.0.0 contains these commits .
Major features of 1.0.0
The Benchmark library allows you to write performance benchmarks of app code and get results quickly.
It prevents build and runtime configuration issues and stabilizes device performance to ensure that measurements are accurate and consistent. Run the benchmarks directly in Android Studio , or in Continuous Integration to observe code performance over time, and to prevent regressions.
প্রধান বৈশিষ্ট্য অন্তর্ভুক্ত:
- Clock stabilization
- Automatic thread prioritization
- Support for UI performance testing, such as in the RecyclerView Sample
- JIT-aware warmup and looping
- JSON benchmark output for post-processing
Version 1.0.0-rc01
23 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-rc01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-rc01
, and androidx.benchmark:benchmark-junit4:1.0.0-rc01
are released. Version 1.0.0-rc01 contains these commits .
নতুন বৈশিষ্ট্য
- Added systrace tracing to benchmarks
বাগ ফিক্স
- Fixed metric instability issue where JIT wouldn't finish before warm up due to deprioritization ( b/140773023 )
- Unified JSON output directory across Android Gradle Plugin 3.5 and 3.6
Version 1.0.0-beta01
9 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-beta01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-beta01
, and androidx.benchmark:benchmark-junit4:1.0.0-beta01
are released. Version 1.0.0-beta01 contains these commits .
নতুন বৈশিষ্ট্য
- Run garbage collection before each warmup to reduce memory pressure from one benchmark to leak to the next ( b/140895105 )
বাগ ফিক্স
- Added
androidx.annotation:android-experimental-lint
dependency, so that Java code will correctly produce lint errors when experimental API is not used, similar to what is provided by the Kotlin experimental annotation for Kotlin callers. - Now correctly detects usage of
additionalTestOutputDir
instrumentation argument for output in Android Gradle Plugin 3.6, to know when AGP will handle data copy. - Fix undetected clock frequency in JSON to correctly print
-1
( b/141945670 ).
Version 1.0.0-alpha06
সেপ্টেম্বর 18, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha06
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha06
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha06
are released. Version 1.0.0-alpha06 contains these commits .
নতুন বৈশিষ্ট্য
- Added a check for incorrectly using the old package for the test runner, which now provides a more-helpful error message
API changes
- The experimental annotation
ExperimentalAnnotationReport
is now correctly public. Usage of the experimental BenchmarkState#report API now requires this annotation
Version 1.0.0-alpha05
5 সেপ্টেম্বর, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha05
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha05
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha05
are released. The commits included in this version can be found here .
API changes
-
BenchmarkState.reportData
API is now marked experimental
বাগ ফিক্স
- Fix for the clock-locking script, which would fail on devices that were either missing the
cut
orexpr
shell utilities. - Fixed an issue with
./gradlew lockClocks
task that would hang on devices that were rooted with an older version of the su utility, which did not support the-c
flag.
Version 1.0.0-alpha04
7 আগস্ট, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha04
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha04
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha04
are released. The commits included in this version can be found here .
New documentation has also been added for how to use the Benchmark library without Gradle, both for usage with different build systems (such as Bazel or Buck), and when running in CI. For more information, see Build benchmarks without Gradle and Run benchmarks in Continuous Integration .
নতুন বৈশিষ্ট্য
- গ্রেডল প্লাগইন
- Now automatically disables test coverage, and sets the
AndroidBenchmarkRunner
by default ( b/138374050 ) - Added support for new AGP-based data copy, when running benchmarks and when using AGP 3.6+
- Now automatically disables test coverage, and sets the
- JSON format additions
- Output total benchmark test run time ( b/133147694 )
-
@Parameterized
benchmarks that use a name string (for example@Parameters(name = "size={0},depth={1}")
) now output parameter names and values per benchmark in the JSON output ( b/132578772 )
- Dry Run mode ( b/138785848 )
- Added a "dry run" mode for running each benchmark loop only once, to check for errors/crashes without capturing measurements. This can be useful eg for, for example, quickly running benchmarks in presubmit to check that they're not broken.
API changes
- Module structure has changed, splitting the library ( b/138451391 )
-
benchmark:benchmark-junit4
contains classes with JUnit dependency:AndroidBenchmarkRunner
, andBenchmarkRule
, both of which have moved into theandroidx.benchmark.junit4
package -
benchmark:benchmark-common
contains the rest of the logic, including the BenchmarkState API - This split will allow the library to support benchmarking without JUnit4 APIs in the future
-
- Configuration warnings are now treated as errors, and will crash the test ( b/137653596 )
- This is done to further encourage accurate measurements, especially in CI
- These errors can be reduced back to warnings with an instrumentation argument. For example:
-e androidx.benchmark.suppressErrors "DEBUGGABLE,LOW_BATTERY"
বাগ ফিক্স
- Errors when writing to external storage on Q devices provide more-descriptive messages, with suggestions of how to resolve the issue
- Screens are automatically turned on during benchmark runs, instead of failing when the screen is off
External contributions
- Thanks to Sergey Zakharov for contributing JSON output improvements and the fix for screen off issues!
Version 1.0.0-alpha03
জুলাই 2, 2019
androidx.benchmark:benchmark:1.0.0-alpha03
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha03
are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Expose sleep duration due to thermal throttling per benchmark in the full JSON report
বাগ ফিক্স
- The Gradle plugin should no longer be required to be applied after Android plugins and the Android block
- Adds support for benchmark reports on Android 10 devices using scoped storage
Version 1.0.0-alpha02
জুন 6, 2019
androidx.benchmark:1.0.0-alpha02
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha02
are released. The commits included in this version can be found here .
Note that we are treating the JSON schema as an API. We plan to follow the same stability constraints as other APIs: stable (with very rare exceptions) once in beta, and fixed in final release, with only additions in minor releases and changes/removals in major releases.
API changes
Overhauled JSON schema. Further changes to the JSON schema are likely to be limited to additions:
- Reorganized the result object structure to support additional metric groups in the future ( b/132713021 )
- Added test run context information, such as device and build info and whether clocks are locked, to the top-level object ( b/132711920 )
- Time metric names now have 'ns' in their name ( b/132714527 )
- Additional stats added per reported metric (maximum, median, minimum), and removed simplified 'nanos' summary stat ( b/132713851 )
Removed XML output ( b/132714414 )
Thermal throttle detection removed from
BenchmarkState.reportData
API ( b/132887006 )
বাগ ফিক্স
- Fixed
./gradlew lockClocks
not sticking on some recent OS devices ( b/133424037 ) - Throttling detection disabled for emulator ( b/132880807 )
Version 1.0.0-alpha01
7 মে, 2019
androidx.benchmark:benchmark:1.0.0-alpha01
is released. The commits included in this version are available here .
বেঞ্চমার্ক
সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | প্রার্থী মুক্তি | বিটা রিলিজ | আলফা রিলিজ |
---|---|---|---|---|
9 এপ্রিল, 2025 | 1.3.4 | - | - | 1.4.0-alpha11 |
নির্ভরতা ঘোষণা করা
To add a dependency on Benchmark, you must add the Google Maven repository to your project. আরও তথ্যের জন্য Google এর Maven সংগ্রহস্থল পড়ুন।
Macrobenchmark
To use Macrobenchmark in your project, add the following dependencies to your build.gradle
file for your macrobenchmark module :
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-macro-junit4:1.3.4" }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-macro-junit4:1.3.4") }
Microbenchmark
To use Microbenchmark in your project, add the following dependencies to your build.gradle
file for your microbenchmark module :
গ্রোভি
dependencies { androidTestImplementation "androidx.benchmark:benchmark-junit4:1.3.4" } android { ... defaultConfig { ... testInstrumentationRunner "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
কোটলিন
dependencies { androidTestImplementation("androidx.benchmark:benchmark-junit4:1.3.4") } android { ... defaultConfig { ... testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner" } }
মাইক্রোবেঞ্চমার্ক লাইব্রেরি আপনার মাইক্রোবেঞ্চমার্ক মডিউলের সাথে ব্যবহার করার জন্য একটি গ্রেডল প্লাগইনও প্রদান করে। এই প্লাগইনটি মডিউলের জন্য বিল্ড কনফিগারেশন ডিফল্ট সেট করে, হোস্টে বেঞ্চমার্ক আউটপুট কপি সেট আপ করে এবং ./gradlew lockClocks
টাস্ক প্রদান করে।
প্লাগইন ব্যবহার করতে, আপনার শীর্ষ-স্তরের build.gradle
ফাইলে `plugins` ব্লকে নিম্নলিখিত লাইনটি অন্তর্ভুক্ত করুন:
গ্রোভি
plugins { id 'androidx.benchmark' version '1.3.4' apply false }
কোটলিন
plugins { id("androidx.benchmark") version "1.3.4" apply false }
তারপর প্লাগইনটি আপনার বেঞ্চমার্ক মডিউলের build.gradle
ফাইলে প্রয়োগ করুন
গ্রোভি
plugins { id 'androidx.benchmark' }
কোটলিন
plugins { id("androidx.benchmark") }
প্রতিক্রিয়া
আপনার প্রতিক্রিয়া জেটপ্যাককে আরও ভাল করতে সাহায্য করে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন বা এই লাইব্রেরির উন্নতির জন্য ধারনা পান তাহলে আমাদের জানান। আপনি একটি নতুন তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি দেখুন৷ আপনি তারকা বোতামে ক্লিক করে একটি বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ 1.4
Version 1.4.0-alpha11
9 এপ্রিল, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha11
is released. Version 1.4.0-alpha11 contains these commits .
এপিআই পরিবর্তন
- Changed
TraceProcessor
's argument timeout: Duration to timeoutMs long for Java caller usability. ( I9fbb5 ) - Mark
TraceProcessor
constructor as internal. Callers should useTraceProcessor.startServer
orTraceProcessor.runServer
. ( Ia8c5b )
Bug Fixes
- When killing the application with
MacrobenchmarkScope.killProcess
, validate the kill command results to prevent silent failure, and timeout error. ( I84555 )
নির্ভরতা আপডেট
- This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer. ( Idb6b5 )
Version 1.4.0-alpha10
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha10
is released. Version 1.4.0-alpha10 contains these commits .
এপিআই পরিবর্তন
- Increased default timeout for
TraceProcessor
server load and querying to 120 seconds (from 60/30 previously), and made both configurable with one timeout parameter. ( Ifec87 )
Bug Fixes
- Fixed a few issues that would occur when benchmarking or capturing profiles of an app without
profileinstaller
, and it's includedBroadcastReciever
. This only affects runs on rooted devices. ( Ied308 )
Version 1.4.0-alpha09
12 মার্চ, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha09
is released. Version 1.4.0-alpha09 contains these commits .
এপিআই পরিবর্তন
- Added
TraceProcessor
and Session API with closable Handles, for easier usage with custom lifecycles. This is also a step towards enabling easier Coroutine and Java API usage. The extension functions toTraceProcessor.runServer {}
are now marked experimental, as they're likely to move, and be made non-experimental in the future. ( I358b4 )
Bug Fixes
- Fixed Benchmark and Baseline Profile capture not working with API 36 due to a change in
pgrep
toybox that now requires-a
to print the full command line. ( Idc991 ) - Filter default tracing config to reduce risk of data loss in traces on newer API levels. ( I54e8a )
- Added experimental
androidx.benchmark.killExistingPerfettoRecordings
instrumentation argument, which can be set tofalse
to allow pre existing perfetto trace capture to continue. By default pre existing perfetto trace captures on device are killed to prevent interference. ( I02a3c ) - The JSON field
context.osCodenameAbbreviated
will now beREL
for released OS versions at and above API 35, as non-numeric code names are no longer supported by the underlying platform. ( Ib17fd ) - Fixes crash in
FrameTimingMetric
when resynced frames occur. ( I7c6f4 , b/394610806 ) - No longer assume
Choreographer#doFrame
is the top of the stack frame on the main thread forFrameTimingQuery
. ( Iee0e0 , b/340206285 )
Version 1.4.0-alpha08
ফেব্রুয়ারি 12, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha08
is released. Version 1.4.0-alpha08 contains these commits .
এপিআই পরিবর্তন
- Moved
TraceProcessor.runSession()
extension APIs to be experimental, as they are likely to move to be concrete constructors eventually on Android. ( Ib0528 , b/393640753 ) - Most of the implementation of Startup Insights are now public/experimental, and move to the
TraceProcessor
artifact SeeStartupInsights
. ( I0aa00 ) - Deprecate
BenchmarkRule.runWithTimingDisabled {}
in favor ofBenchmarkRule.runWithMeasurementDisabled {}
, which more clearly describes the behavior - all metrics are paused. Additionally, expose theMicrobenchmarkScope
superclass since redeclaring therunWithMeasurementDisabled
function to open access isn't possible, since it's inline. ( I9e23b , b/389149423 , b/149979716 ) - Benchmark libraries have moved to Kotlin 2.0. ( I9d1e0 )
- Removed
androidx.benchmark.startupProfiles.enable
instrumentation argument. It is no longer useful, as it can be controlled byincludeInStartupProfile
arg inBaselineProfileRule.collect()
. ( I39eb4 )
Bug Fixes
- Reduced the amount of Microbenchmark internal functions called during profiling to make eg Method traces more clear ( Ifaed8 )
- Speculative fix for crashes: 'Failed to stop [
ProcessPid(processName=perfetto, pid=...)
]'. Now Benchmark will log a message instead of crashing when a background Perfetto process isn't able to be stopped before running the benchmark. ( I37d3e , b/323601788 ) - Fix
IllegalStateExceptions
with 'Expectedpm dump-profiles
stdout' label that were caused by overly strict output format check. ( I358dc )
Version 1.4.0-alpha07
জানুয়ারী 29, 2025
androidx.benchmark:benchmark-*:1.4.0-alpha07
is released. Version 1.4.0-alpha07 contains these commits .
নতুন বৈশিষ্ট্য
-
BaselineProfileRule
now introduces acollectWithResults(...)
API which includes a list of paths to the computed profiles. ( I056f8 ) - Added
androidx.benchmark.measureRepeatedOnMainThread.throwOnDeadline
instrumentation argument, which can be set to false to disable the throw on deadline behavior ofmeasureRepeatedOnMainThread
for local testing. Not otherwise recommended, as this increases the likelihood of ANRs during tests. ( Idbeec , b/353226476 )
এপিআই পরিবর্তন
- Added
@JvmOverloads
toMicrobenchmarkConfig
constructor. ( I13fd3 ) - Refactored
BenchmarkRule
to be built on top of coroutines, and support betteryield()
behavior. This refactor removed several experimentalBenchmarkState
APIs, but will be followed by replacements as needed. Additionally, addedrunWithMeasurementDisabled
to clarify behavior (all measurement is paused). In the future,runWithTimingDisabled
will be deprecated. ( I19837 , b/389149423 , b/311242861 ) - Move
PerfettoTraceProcessor
toTraceProcessor
in a newandroidx.benchmark:benchmark-traceprocessor
artifact, and make most of its API non-experimental. Any customTraceMetric
or anything reading from traces will need to update to the newTraceProcessor
import. The newTraceProcessor
API works exactly like the old one, but is a standalone interface library (somewhat analogous to theandroidx.sqlite
layer from Room) with an Android-specific implementation built into macrobenchmark. The new artifact can be used on JVM as well, but currently you'll need to start your own copy of theTraceProcessor
binary and offer a port to connect to it on. ( I3a767 , I62563 , b/381134564 )
Bug Fixes
- Throw a clearer error message when
MacrobenchmarkScope.startActivityAndWait
fails to launch the target process (potentially due to a crash in the target process), instead of the more ambiguous 'Unable to confirm activity launch completion' message ( I3539b ) - Fixed several syntax errors in Kotlin samples, and syntax highlighting in several Java / build.gradle samples. ( Ib3808 )
- Clarified
ArtMetric
andCaptureInfo
parameter docs. ( I96e60 )
Version 1.4.0-alpha06
11 ডিসেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha06
is released. Version 1.4.0-alpha06 contains these commits .
এপিআই পরিবর্তন
- Removed usage of
@Language("sql")
inPerfettoTraceProcessor.Session.query()
, as Studio highlighting/parsing is broken. ( Idc2fa , b/377733398 )
Bug Fixes
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I46810 , b/326456246 ) - Corrected
ArtMetric
to report class load (not init), and improved docs to clarify runtime behavior. ( I9915c ) - On Android Multiuser, execute commands as root only on rooted devices. ( I88b44 )
সংস্করণ 1.4.0-আলফা 05
13 নভেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha05
is released. Version 1.4.0-alpha05 contains these commits .
Bug Fixes
- Fixed an issue on API 34+ where
CompilationMode.None()
would have inconsistent performance not representative of initial, worst case performance. This works around a platform change which allows ART's compilation stateverify
to partially compile apps (only affecting class loading) shortly after first launch. ( Ie48d0 ) - Fixed issue where (especially short) traces could be captured that wouldn't report measurement from built-in Macrobenchmark Metrics, due to the process name being truncated within the Perfetto trace. Now macrobenchmark works around this issue by looking for the truncated package name in all built-in queries, in addition to the expected package name. Note that custom
TraceMetric
implementations or other direct callers ofPerfettoSession.query
can implement this same behavior by changingprocess.name LIKE "$packageName"
in a Perfetto query to instead be(process.name LIKE "$packageName" OR process.name LIKE "$(packageName.takeLast(15))")
. ( I5bf01 , b/377565760 )
সংস্করণ 1.4.0-আলফা 04
অক্টোবর 30, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha04
is released. Version 1.4.0-alpha04 contains these commits .
নতুন বৈশিষ্ট্য
- (Experimental) Enable Baseline Profile generation, and benchmarking on apps installed to a secondary user, for example any app on headless Android Auto devices. This support has been tested in some scenarios, but let us know with a bug if it doesn't work for you. ( I9fcbe , b/356684617 , b/373641155 )
Bug Fixes
-
isProfileable
is now always overridden in benchmark builds, andisDebuggable
is also now always overridden in both benchmark andnonMinified
(baseline profile capture) builds. ( I487fa , b/369213505 ) - Fixes compilation detection on some physical devices prior to API 28 - affects json
context.compilationMode
, as well as behavior ofandroidx.benchmark.requireAot=true
(which no longer incorrectly throws) ( Ic3e08 , b/374362482 ) - In
CpuEventCounter
metrics, throw if invalid measurements are observed (eg instructions/cpucycles==0) ( I8c503 )
সংস্করণ 1.4.0-আলফা 03
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha03
is released. Version 1.4.0-alpha03 contains these commits .
এপিআই পরিবর্তন
- Macrobenchmark : Adds
ArtMetric
, which can be used to inspect profile coverage or general Android RunTime performance. Captures number and total duration of JIT, class init (where available), and class verification. Additionally, changesCaptureInfo
to include optional ART mainline version with default. ( I930f7 ) - Add
coefficientOfVariation
to Benchmark JSON output to show stability within a given benchmark run. ( Ib14ea )
Bug Fixes
- Fixed
CollectBaselineProfileTask
when AVD device has spaces in it. ( Ia0225 , b/371642809 ) - Speculative fix for errors from
StartupMode.COLD
exceptions:Package <packagename> must not be running prior to cold start!
. Now,MacrobenchmarkScope.killProcess()
(including the one run before each iteration, used to implementStartupMode.COLD
behavior) will wait to verify that the app's processes have all stopped running. ( I60aa6 , b/351582215 ) - Fixed issue where UNLOCKED_ error would show up on some rooted emulators. ( Ic5117 )
- এই লাইব্রেরিটি এখন JSpecify nullness টীকা ব্যবহার করে, যা টাইপ-ব্যবহার। Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict
,-Xtype-enhancement-improvements-strict-mode
( I7104f , b/326456246 )
সংস্করণ 1.4.0-আলফা 02
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha02
is released. Version 1.4.0-alpha02 contains these commits .
এপিআই পরিবর্তন
- Moved Gradle tasks
lockClocks
andunlockClocks
to be on benchmark projects, instead of available at the top level. This change was necessary as there is unfortunately no way to register these as top level actions without breaking project isolation. ( I02b8f , b/363325823 )
Bug Fixes
-
BaselineProfileRule
now collects profiles for multi-process apps by signaling each running process at the end of the block to dump profiles. If a profile based compilation never successfully finds a process to broadcast to, the compilation will fail, as it's unexpected to have profile data within. Additionally, added an instrumentation argument to control dump wait duration:androidx.benchmark.saveProfileWaitMillis
( I0f519 , b/366231469 ) - From Benchmark
1.3.2
: Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. ( I2f678 , b/285187547 )
To use FTL apply the plugin to the baseline profile module in the plugin block, with:
plugins {
...
id("com.google.firebase.testlab")
}
and then configure firebase test lab with:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
Also the created FTL device needs to be added to the baseline profile extension:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.4.0-আলফা 01
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.4.0-alpha01
is released. Version 1.4.0-alpha01 contains these commits .
New Feature - App Startup Insights
- Initial version of app startup insights can be enabled in Macrobenchmark. ( 09fae38 )
To enable in a startup benchmark:
@Test
fun startup {
macrobenchmarkRule.measureRepeated(
…
packageName = "com.example.my.application.id"
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
compilationMode = CompilationMode.None(),
experimentalConfig = ExperimentalConfig(startupInsightsConfig = StartupInsightsConfig(isEnabled = true))
) {
scope.startActivityAndWait(...)
}
}
Then running your startup benchmark will analyze the trace to look for common problems, and print them after metrics to Studio test output in the benchmark tab, eg:
StartupBenchmark_startup[startup=COLD,compilationMode=None]
├── Metrics
│ ├── timeToFullDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
│ └── timeToInitialDisplayMs min 1,147.2, median 1,208.8, max 1,307.4
├── App Startup Insights
│ ├── App in debuggable mode (expected: false)
│ │ └── seen in iterations: 0(true) 1(true) 2(true) 3(true) 4(true) 5(true) 6(true) 7(true) 8(true) 9(true)
│ ├── Potential CPU contention with another process (expected: < 100000000ns)
│ │ └── seen in iterations: 4(105022546ns)
│ └── Main Thread - Binder transactions blocked (expected: false)
│ └── seen in iterations: 7(true)
└── Traces
└── Iteration 0 1 2 3 4 5 6 7 8 9
This feature is still a work-in-progress, with improvements to documentation and extensibility to follow, but feedback is welcome.
নতুন বৈশিষ্ট্য
- Added gradle property
androidx.baselineprofile.suppressWarnings
to suppress all baseline profile warnings. ( 314153a ) - Microbench metrics are now displayed in Perfetto traces as counters. ( 3214854 )
- Add experimental scripts for disabling jit (requires root / runtime restart), and resetting device perf/test state. These are not currently published as gradle tasks. ( 7c3732b )
- Added benchmark argument to skip tests when running on emulator. When
automaticGenerationDuring
build is enabled, benchmarks will also trigger baseline profile generation. This will fail, if emulators are used. With the new argumentskipBenchmarksOnEmulator
we can instead skip the test. ( 0c2ddcd ) - Change perf event enable logic to run on API 23+ ( 2550048 )
এপিআই পরিবর্তন
- Existing experimental
PerfettoConfig
argument toMacrobenchmarkRule.measureRepeated()
moved to the newExperimentalConfig
object.
Bug Fixes
- Increase
lockClocks.sh
retry count ( 99e9dac ) - Don't create
nonMinified
and benchmark build types if existing. Due to a bug, even ifnonMinified
and benchmark build types existed, they were going to be recreated. ( e75f0a5 ) - Ignore non-terminating slices from
TraceSectionMetric
results. ( a927d20 ) - Improved emulator check to consider
sdk_
prefix. ( 1587de8 ) - Treat non-running packages as cleared in
FrameTimingGfxInfoMetric
. ( 35cc79c ) - Fix
androidx.benchmark.cpuEventCounter
producing corrupt values for non-Instruction events. ( 06edd59 ) - Fix
resumeTiming/runWithTimingDisabled
to respect metric priority order, and significantly reduce impact of lower priority metric pause/resume on higher priority metric results. For example, if using cpu perf counters viacpuEventCounter.enable
instrumentation argument, timeNs is no longer significantly reduced when pause/resume occur. ( 5de0968 )
সংস্করণ 1.3
সংস্করণ 1.3.4
26 মার্চ, 2025
androidx.benchmark:benchmark-*:1.3.4
is released. Version 1.3.4 contains these commits .
Bug Fixes
- Fixed Gradle Project Isolation incompatibilities in the Benchmark Baseline Gradle Plugin. ( b/404523257 )
সংস্করণ 1.3.3
16 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.3
is released. Version 1.3.3 contains these commits .
Bug Fixes
- Fixed
CollectBaselineProfileTask
when AVD device has spaces in it ( Ia0225 , b/371642809 )
সংস্করণ 1.3.2
2 অক্টোবর, 2024
androidx.benchmark:benchmark-*:1.3.2
is released. Version 1.3.2 contains these commits .
Bug Fixes
- Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. ( I2f678 , b/285187547 )
To use FTL apply the plugin to the baseline profile module in the plugin block, with:
plugins {
...
id("com.google.firebase.testlab")
}
and then configure firebase test lab with:
firebaseTestLab {
// Credentials for FTL service
serviceAccountCredentials.set(file("credentials.json"))
// Creates one or more managed devices to run the tests on.
managedDevices {
"ftlDeviceShiba34" {
device = "shiba"
apiLevel = 34
}
}
// Ensures the baseline profile is pulled from the device.
// Note that this will be automated as well later with aosp/3272935.
testOptions {
results {
directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
}
}
}
Also the created FTL device needs to be added to the baseline profile extension:
baselineProfile {
managedDevices += "ftlDeviceShiba34"
useConnectedDevices = false
}
সংস্করণ 1.3.1
18 সেপ্টেম্বর, 2024
androidx.benchmark:benchmark-*:1.3.1
is released. Version 1.3.1 contains these commits .
Bug Fixes
- Added gradle property
androidx.baselineprofile.suppressWarnings
to suppress all baseline profile warnings ( I7c36e , b/349646646 ) - Fixed Baseline Profile Gradle Plugin to use pre-existing
nonMinified…
andbenchmark…
if created by the app instead of creating wrappers. ( Ia8934 , b/361370179 ) - Fixed
java.lang.AssertionError: ERRORS (not suppressed): EMULATOR
whenautomaticGenerationDuringBuild
is enabled on emulators. New argument is used to instead skip the test. ( If3f51 , b/355515798 ) - Microbenchmark minification - keep subclasses of
org.junit.runner.notification.RunListener
in benchmark library proguard ( Ic8ed5 , b/354264743 ) - Fix
TraceSectionMetric
to Ignore non-terminating slices. Previously these were considered to have -1 duration, eg during summation or finding minimum duration. ( If74b7 ) - Fixed an issue in
FrameTimingGfxInfoMetric
where starting the metric would crash if the process wasn't already running. ( I6e412 )
সংস্করণ 1.3.0
21 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0
is released. Version 1.3.0 contains these commits .
Microbenchmark changes since 1.2.0
- Method tracing is on by default in microbenchmarks when running on most devices
- Method tracing runs as a separate phase, after measurements - this enables accurate measurements and method traces to both be output from a single benchmark run
- Method tracing on some Android OS and ART versions will affect later measurement phases - on these versions, method tracing is off by default and a warning is printed to Studio output
- Main thread benchmarks and ANRs
- Added
measureRepeatedOnMainThread
for UI thread benchmarks (eg those that interact with Compose/View UIs) to avoid ANRs when running for many seconds. - Method traces are skipped if expected to overrun the ANR avoidance deadline. Set
androidx.benchmark.profiling.skipWhenDurationRisksAnr
to false to disable this behavior (not recommended for CI runs, as ANRs can cause problem in long CI runs).
- Added
- মিনিফিকেশন
- Embedded proguard rules to improve microbenchmarking with minification enabled
- Minification/R8 in a library module requires AGP 8.3, and can be enabled via
android.buildTypes.release.androidTest.enableMinification
in yourbuild.gradle
- Experimental
BlackHole.consume()
API added to prevent dead code elimination ( If6812 , b/286091643 )
- মেট্রিক্স
- Experimental cpu event counter feature (metrics from
perf_event_open
, which requires root on most versions of the platform), access viaInstrumentationArgument
androidx.benchmark.cpuEventCounter.enable
(can be set totrue
), andandroidx.benchmark.cpuEventCounter.events
can be set eg to (Instructions,CpuCycles
). This should be supported on some userdebug emulators, but support has not been tested across all available emulators
- Experimental cpu event counter feature (metrics from
MACRObenchmark changes since 1.2.0
- Method tracing overhaul for macrobenchmarks.
- Now method traces are scoped to the duration of the
measureBlock
, and can capture multiple sessions if the process starts multiple times. - Previously, method tracing would only work for
StartupMode.COLD
benchmarks, and capture nothing formeasureBlocks
that didn't restart the target process - Fixed method traces flush in macrobenchmark, so that method traces should be fully captured and valid, even on slower devices. ( I6349a , b/329904950 )
- Now method traces are scoped to the duration of the
- Correctly dump ART profile during individual
warmUp
iterations when process is killed soCompilationMode.Partial(warmup=N)
measurements are more accurate. ( I17923 ) - Drop Shader broadcast failure message
- Added debugging suggestions to drop shader broadcast failure message
- Add two instrumentation arguments for overriding shader dropping behavior to workaround crashes when benchmarking apps without
ProfileInstaller
1.3:-
androidx.benchmark.dropShaders.enable=true/false
: can be used to skip all shader dropping (including that done inStartupMode.Cold
launches), esp when benchmarking apps that don't yet use profileinstaller 1.3 -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: can be used to tolerate failures when trying to drop shaders, for example when benchmarking apps without profileinstaller 1.3 ( I4f573 )
-
- Added experimental
MacrobenchmarkRule#measureRepeated
variant which takes a customPerfettoConfig
for fully customized Perfetto trace recording. Note that incorrectly configured configs may cause built in Metric classes to fail. ( Idfd3d , b/309841164 , b/304038384 ) - Cancel background dexopt jobs before running a Macrobenchmark to reduce interference. ( I989ed )
- Macrobenchmark now waits for 1 second for the target application to flush an ART profile (previously it waited for 500 ms). ( I85a50 , b/316082056 )
- TraceSectionMetric overhaul
- Note :
TraceSectionMetric
changes below can affect outputs in CI usage, and may create discontinuities, or break parsing - Sum is now the default, as most usage of this metric is for repeated events, and first would discard data in these cases
- Changed to be more customizable, with more available modes
- Mode names are now embedded in metric output name (in Studio and JSON)
- Now supports slices created using
Trace.{begin|end}AsyncSection
.
- Note :
- মেট্রিক্স
- Power - Added
PowerMetric.deviceSupportsHighPrecisionTracking
,PowerMetric.deviceBatteryHasMinimumCharge()
andPowerMetric.deviceSupportsPowerEnergy()
- Renamed
Metric.getResult
togetMeasurements
to match return type - Added log.w / exception labels to all startup detection failures. This does not change current behavior (so some errors throw, and others silently fail to detect the startup), just makes it more understandable. Generally the ones that
Log.w()
and fail to report startup metrics are those where non-frame events are missing, exceptions are thrown when startup is detected except for frame timing information (from UI/RT slices). ( Id240f , b/329145809 ) - Added
frameCount
measurement toFrameTimingMetric
to aid in discovery of scenarios where measurements change because the number of frames produced changed (new animations added, invalidation issues fixed). ( I1e5aa ) - Clarified that
frameOverrunMs
is the preferred metric for tracking when available in docs, and why. ( I18749 , b/329478323 ) - Fixes issue where unterminated frames at the beginning and end of the trace could be paired together, which would incorrectly report as a single extremely long frame. ( I39353 , b/322232828 )
- Improve
FrameTimingMetric
error when frames aren't produced, and always output link to trace when failing metric parsing to assist in diagnosing problem. ( I956b9 ) - Fixed crash in
FrameTimingMetric
failing to parse frame id, especially on certain OEM devices. ( Ia24bc , b/303823815 , b/306235276 ) - Relaxed strictness of checks in
FrameMetrics
, and added more detail to error messages. ( Iadede )
- Power - Added
Baseline Profile capture / Gradle plugin changes since 1.2.0
- Increased max recommended version of AGP to 9.0.0-alpha01.
- Ensure
mergeArtProfile
andmergeStartupProfile
tasks always wait for baseline profile generation. ( I623d6 , b/343086054 ) - Generating a baseline profile successfully will output a summary of what changed ( I824c8 , b/269484510 )
- Added DSL to disable warnings ( Ic4deb , b/331237001 )
- Fix to ensure benchmarks use generated baseline profiles when
automaticGenerationDuringBuild
is off ( Ic144f , b/333024280 ) - Fix
BaselineProfile
gradle plugin property overrides to enable baseline profile generation and benchmarking when customizing anonMinified
or benchmark build type. ( Ib8f05 , b/324837887 ) - Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15. ( I1d2af , b/313992099 )
- Fixed baseline and startup profile output url at the end of generation task. ( I802e5 , b/313976958 )
Other significant changes since 1.2.0
- Trace capture
- Reduced EXITCODE 2 error when starting perfetto from an error to logged warning
- Enable AIDL tracing by default in benchmarks(requires API 28) ( Ia0af2 , b/341852305 )
- Enable porter tag tracing by default in benchmarks. This captures, for example, wakelock tracepoints. ( Icfe44 , b/286551983 )
- Increased trace capture start timeout to avoid crashes when starting tracing on slower devices ( I98841 , b/329145808 )
- Added public API
PerfettoTraceProcessor.Session.queryMetrics
APIs with JSON, textproto, and proto binary (undecoded) variants. These allow you to query metrics built intoTraceProcessor
( I54d7f , b/304038382 ) - Enable blocking start on Perfetto trace record to reduce risk of missing data at beginning of trace. Only supported on API 33+. ( Ie6e41 , b/310760059 )
- JSON output
- Added additional information in benchmark context in JSON output:
-
context.artMainlineVersion
- integer version of Art mainline module (if present on device,-1
otherwise) -
context.build.id
- Equals android.os.Build.ID -
context.build.version.codename
- Equals android.os.Build.VERSION.CODENAME -
context.build.version.abbreviatedCodename
- corresponds to first letter of pre-release codename (including on release builds) ( Ie5020 )
-
- Added
profilerOutput
list to JSON output for easier tooling around profiling traces (eg Perfetto, Method traces) ( I05ddd , b/332604449 ) - Added a warning when Android Test Orchestrator is used in benchmark modules, as this will cause per-module output JSON files to be repeatedly overwritten. ( Ia1af6 , b/286899049 )
- Throw when filenames are longer than 200 chars to avoid unclear crashes when writing or post-processing files. ( I4a5ab )
- Added additional information in benchmark context in JSON output:
সংস্করণ 1.3.0-আরসি 01
7 আগস্ট, 2024
androidx.benchmark:benchmark-*:1.3.0-rc01
is released. Version 1.3.0-rc01 contains these commits .
বাগ ফিক্স
- Fix
androidx.benchmark.cpuEventCounter
producing corrupt values for non-Instruction events ( I7386a , b/286306579 ) - Fix
resumeTiming
/runWithTimingDisabled
to respect metric priority order, and significantly reduce impact of lower priority metric pause/resume on higher priority metric results. For example, if using cpu perf counters viacpuEventCounter.enable
instrumentation argument, timeNs is no longer significantly reduced when pause/resume occur. ( I39c2e , b/286306579 , b/307445225 ) - Reduced chance of stack sampling causing
measureRepeatedOnMainThread
from hitting main thread hard timeout by moving stack sampling conversion off main thread. ( I487a8 , b/342237318 ) - Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (eg R8 version 3.3) and for all builds when using AGP 8.1 or later (eg D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. আরো বিস্তারিত জানার জন্য এই নিবন্ধটি দেখুন. ( I9496c , b/345472586 )
- Added agp version check to send package name as instr arg. Previous to AGP 8.4.0 the target app package name cannot be send to the instrumentation app via instrumentation arguments. ( 0c72a3f )
সংস্করণ 1.3.0-BETA02
10 জুলাই, 2024
androidx.benchmark:benchmark-*:1.3.0-beta02
is released. Version 1.3.0-beta02 contains these commits .
বাগ ফিক্স
- Gracefully handle EXITCODE
2
when starting Perfetto to log a warning, but proceed.
সংস্করণ 1.3.0-BETA01
জুন 12, 2024
androidx.benchmark:benchmark-*:1.3.0-beta01
is released. Version 1.3.0-beta01 contains these commits .
এপিআই পরিবর্তন
- Renamed
MethodTracing.affectsMeasurementOnThisDevice
toAFFECTS_MEASUREMENT_ON_THIS_DEVICE
for consistency. ( I1bdfa ) - Added experimental
BlackHole.consume()
api to prevent dead code elimination in microbenchmarks. ( If6812 , b/286091643 ) - Microbenchmark will now correctly throw to prevent method tracing from interfering with measurements. This occurs on certain devices when method tracing is forced on (via instrumentation args or
MicrobenchmarkConfig
), and if a measurement is attempted after a method trace. Affected devices are running API 26-30 or certain ART mainline module versions affected by this interference, and can be detected at runtime viaProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice
. ( Iafb92 , b/303660864 )
Bug Fixes
- Bumped max agp version recommended to 9.0.0-alpha01. ( I5bbb0 )
- Added compilation mode to benchmark context ( If5612 , b/325512900 )
- Enable AIDL tracing by default (requires API 28) ( Ia0af2 , b/341852305 )
- Added additional information in benchmark context in JSON output:
-
context.artMainlineVersion
- integer version of Art mainline module (if present on device, -1 otherwise) -
context.build.id
- Equalsandroid.os.Build.ID
-
context.build.version.codename
- Equalsandroid.os.Build.VERSION.CODENAME
-
context.build.version.abbreviatedCodename
- corresponds to first letter of pre-release codename (even on release builds) ( Ie5020 )
-
- Fixes
StackSampling
to respectandroidx.benchmark.profiling.sampleDurationSeconds
( Ib1d53 ) - Change macro->common dependency to be
api()
, so it's easier to use egPerfettoTrace
andPerfettoConfig
. ( Icdae3 , b/341851833 ) - Ensure
mergeArtProfile
andmergeStartupProfile
tasks always wait for baseline profile generation. ( I623d6 , b/343086054 ) - Consider variant enable state when deciding whether variant should be enabled. ( I5d19e , b/343249144 )
- Increased default start timeout for perfetto trace processor. ( I87e8c , b/329145808 )
Version 1.3.0-alpha05
14 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha05
is released. Version 1.3.0-alpha05 contains these commits .
Bug Fixes
- Throw clearer exception when macrobench metric returns zero values for all iterations ( Iab58f , b/314931695 )
- Additional workaround rules added to microbench proguard rules, including support for listener rules and other observed warnings / errors. ( I14d8f , b/329126308 , b/339085669 )
- Method tracing runs as a separate phase during a Macrobenchmark, and it no longer affects measurements. ( If9a50 , b/285912360 , b/336588271 )
- Added extra debugging suggestions to drop shader broadcast failure message. ( I5efa6 , b/325502725 )
Version 1.3.0-alpha04
1 মে, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha04
is released. Version 1.3.0-alpha04 contains these commits .
এপিআই পরিবর্তন
- Added experimental
MacrobenchmarkRule#measureRepeated
variant which takes a customPerfettoConfig
for fully customized Perfetto trace recording. Note that incorrectly configured configs may cause built in Metric classes to fail. ( Idfd3d , b/309841164 , b/304038384 ) - Rename
PowerMetric.deviceSupportsPowerEnergy
toPowerMetric.deviceSupportsHighPrecisionTracking
for clarity ( I5b82f ) - Added
PowerMetric.deviceBatteryHasMinimumCharge()
andPowerMetric.deviceSupportsPowerEnergy()
to enable changing or skipping benchmarks based on device power measurement capability. ( I6a591 , b/322121218 )
Bug Fixes
- Added comparison with previous baseline profile ( I824c8 , b/269484510 )
- Added DSL to disable warnings ( Ic4deb , b/331237001 )
- Changed exception to info log when benchmark variants are disabled ( I8a517 , b/332772491 )
- Make it simpler to capture method traces for a Macrobenchmark is scoped to the duration of the actual
measureBlock()
. Previously, it started at target process launch and only supported cold starts ( Iee85a , b/300651094 ) - Avoid crashing when perfetto trace processor is slow to start ( I98841 , b/329145808 )
সংস্করণ 1.3.0-আলফা 03
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha03
is released. Version 1.3.0-alpha03 contains these commits .
নতুন বৈশিষ্ট্য
- Adds public API
PerfettoTraceProcessor.Session.queryMetrics
APIs with JSON, textproto, and proto binary (undecoded) variants. These allow you to query metrics built into TraceProcessor ( I54d7f , b/304038382 ) - Added
profilerOutput
to JSON output for easier tooling around profiling traces (eg perfetto, method traces). ( I05ddd , b/332604449 ) - Added power tag to benchmark Perfetto Config. This captures, for example, wakelock tracepoints. ( Icfe44 , b/286551983 )
- Added inst argument
androidx.benchmark.profiling.skipWhenDurationRisksAnr
, can be set to false to avoid skipping method traces when expected duration may cause an ANR - strongly recommended to avoid in CI runs. - Added experimental inst argument
androidx.benchmark.profiling.perfCompare.enable
, set this to true to run comparison timing between measurement and profiling phases. Useful in eg evaluating overhead of method tracing. ( I61fb4 , b/329146942 )
এপিআই পরিবর্তন
- Changed
TraceSectionMetric.Mode
to sealed class to enable future expansion without breaking exhaustive when statements ( I71f7b ) - Added
TraceSectionMetric.Mode.Average
and.Count
, and reordered args so the more common argument (mode) was earlier in the arg list, reducing need for specifying parameter names. ( Ibf0b0 , b/315830077 , b/322167531 ) - Renamed
Metric.getResult
togetMeasurements
to match return type ( I42595 )
Bug Fixes
- Fix to ensure benchmarks use generated baseline profiles when
automaticGenerationDuringBuild
is off ( Ic144f , b/333024280 ) - Fix
BaselineProfile
gradle plugin property overrides to enable baseline profile generation and benchmarking when customizing anonMinified
or benchmark build type. ( Ib8f05 , b/324837887 ) - Fixed method traces flush in macrobenchmark, so that method traces should be fully captured and valid, even on slower devices. ( I6349a , b/329904950 )
- Enable blocking start on Perfetto trace record to reduce risk of missing data at beginning of trace. Only supported on API 33+. ( Ie6e41 , b/310760059 )
- Added a warning when Android Test Orchestrator is used in benchmark modules, as this will cause per-module output JSON files to be repeatedly overwritten. ( Ia1af6 , b/286899049 )
- Force ',' (comma) thousands separators for consistency in Studio output, ignoring device locale ( I3e921 , b/313496656 )
-
TraceSectionMetric
now supports slices created usingTrace.{begin|end}AsyncSection
. ( I91b32 , b/300434906 ) - Added log.w / exception labels to all startup detection failures. This does not change current behavior (so some errors throw, and others silently fail to detect the startup), just makes it more understandable. Generally the ones that
Log.w()
and fail to report startup metrics are those where non-frame events are missing, exceptions are thrown when startup is detected except for frame timing information (from UI/RT slices). ( Id240f , b/329145809 ) - Cancel background dexopt jobs before running a Macrobenchmark to reduce interference. ( I989ed )
- Added
frameCount
measurement toFrameTimingMetric
to aid in discovery of scenarios where measurements change because the number of frames produced changed (new animations added, invalidation issues fixed). ( I1e5aa ) - Clarified that
frameOverrunMs
is the preferred metric for tracking when available in docs, and why. ( I18749 , b/329478323 )
সংস্করণ 1.3.0-আলফা 02
20 মার্চ, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha02
is released. Version 1.3.0-alpha02 contains these commits .
নতুন বৈশিষ্ট্য
Experimental R8 support in microbench via embedded proguard rules. Note that this support is experimental, and requires AGP 8.3 for minification of library module tests. Use the following to enable R8 minification/optimization in your benchmark module's
build.gradle
, which should lead to a significant performance increase, depending on workload. ( I738a3 , b/184378053 )android { buildTypes.release.androidTest.enableMinification = true }
বাগ ফিক্স
- Fixes method tracing warning to be on separate line from microbench output. ( I0455c , b/328308833 )
Version 1.3.0-alpha01
ফেব্রুয়ারি 21, 2024
androidx.benchmark:benchmark-*:1.3.0-alpha01
is released. Version 1.3.0-alpha01 contains these commits.
এপিআই পরিবর্তন
- Renamed
MicrobenchmarkConfig
boolean parameters to avoid unnecessary word 'should' ( Ia8f00 , b/303387299 ) - Added
BenchmarkRule.measureRepeatedOnMainThread
so main thread benchmarks (eg ones touching Views or Compose UIs) can avoid triggering ANRs, especially during large suites in CI. ( I5c86d ) - Added
FrameTimingGfxInfoMetric
, an experimental alternate implementation ofFrameTimingMetric
with measurements coming directly from the platform, rather than extracted from the Perfetto trace. ( I457cb , b/322232828 ) - Add the ability to dump an ART profile during individual
warmUp
iterations. ( I17923 ) - Several changes to
TraceSectionMetric
API:- Add
Mode.Min
,Mode.Max
- Add label argument to override section name as metric label
- Added mode name to output to clarify metric meaning
- Changed default to sum, as most usage of this metric is for repeated events Be aware of this changes in CI usage, as it may create discontinuities or break parsing. ( Ic1e82 , b/301892382 , b/301955938 )
- Add
Bug Fixes
- Improved error message in baseline profile gradle plugin when specified managed device does not exist ( Idea2b , b/313803289 )
- Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15 ( I1d2af , b/313992099 )
- Fixed baseline and startup profile output url at the end of generation task ( I802e5 , b/313976958 )
- Adjusted data source timeouts to attempt to fix
java.lang.IllegalStateException: Failed to stop [ProcessPid(processName=perfetto, pid=...)]
( I8dc7d , b/323601788 ) - Add two instrumentation arguments for overriding shader dropping behavior to workaround crashes when benchmarking apps without
ProfileInstaller
1.3:-
androidx.benchmark.dropShaders.enable=true/false
: can be used to skip all shader dropping (including that done inStartupMode.Cold
launches), esp when benchmarking apps that don't yet use profileinstaller 1.3 -
androidx.benchmark.dropShaders.throwOnFailure=true/false
: can be used to tolerate failures when trying to drop shaders, for example when benchmarking apps without profileinstaller 1.3 ( I4f573 )
-
- Skip method tracing on UI thread when expected to take longer than a few seconds, and cleanup method traces when throwing. ( I6e768 )
- Throw when filenames are longer than 200 chars to avoid unclear crashes when writing or post-processing files. ( I4a5ab )
- Fixes issue where unterminated frames at the beginning and end of the trace could be paired together, which would incorrectly report as a single extremely long frame. ( I39353 , b/322232828 )
- Use
--skip verification
on API 30+ when reinstalling a package on API 30-33 to clear ART profiles on user builds. This helps bypass Play Protect warnings that cause failures on some class of devices. ( Ic9e36 ) - Use
am force-stop
to kill apps when not a system app like System UI or Launcher. ( I5e028 ) - Macrobenchmark now waits for
1 second
for the target application to flush an ART profile (previously it waited for500 ms
). ( I85a50 , b/316082056 ) - Improve
FrameTimingMetric
error when frames aren't produced, and always output link to trace when failing metric parsing to assist in diagnosing problem. ( I956b9 ) - Fixed crash in
FrameTimingMetric
failing to parse frame id, especially on certain OEM devices. ( Ia24bc , b/303823815 , b/306235276 ) - Relaxed strictness of checks in
FrameMetrics
, and added more detail to error messages. ( Iadede )
সংস্করণ 1.2
সংস্করণ 1.2.4
এপ্রিল 17, 2024
androidx.benchmark:benchmark-*:1.2.4
is released. Version 1.2.4 contains these commits .
Bug Fixes
- Fixes baseline profile srcset not being set up in benchmark variants. Also fixes
automaticGenerationDuringBuild
in libraries causing a circular dependency. ( I28ab7 , b/333024280 ) - Use
am force-stop
to kill apps when not a system app like System UI or Launcher. This fixesStartupMode.COLD
benchmarks crashing from "Package $package must not be running prior to cold start!" due to process kill not fully succeeding. ( I5e028 )
সংস্করণ 1.2.3
24 জানুয়ারী, 2024
androidx.benchmark:benchmark-*:1.2.3
is released. Version 1.2.3 contains these commits.
Bug Fixes
- Removed exception from Baseline Profile Gradle Plugin when AGP version is 8.3.0 or higher.
- Fix for including library baseline profiles in AAR prior to AGP 8.3.0-alpha15.
সংস্করণ 1.2.2
ডিসেম্বর 1, 2023
androidx.benchmark:benchmark-*:1.2.2
is released. Version 1.2.2 contains these commits.
Baseline Profiles
- Execution logs will show the baseline profile output file path as a local file URI ( aosp/2843918 , aosp/2853665 , b/313976958 )
সংস্করণ 1.2.1
15 নভেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.1
is released. Version 1.2.1 contains these commits.
নতুন বৈশিষ্ট্য
- Improved error message when user disables test variants ( b/307478189 )
- Added properties to support AS test run integration ( b/309805233 ), ( b/309116324 )
সংস্করণ 1.2.0
18 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0
is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
Baseline Profiles
- New Baseline Profile Gradle Plugin automates capturing and including baseline profiles in your test and build workflow.
-
BaselineProfileRule.collect
now stable, a streamlined and simplified version of the previous experimentalBaselineProfileRule.collectBaselineProfile
API- Just specify
packageName
, and drive your app
- Just specify
- For libraries generating baseline profiles, you can now filter the rules generated either in code (
BaselineProfileRule.collect
argument), or even more simply in the gradle plugin - সংশোধন করে
- Fixed baseline profile collection on Android U+ ( Id1392 , b/277645214 )
Macrobenchmark
- সংকলন
- Macrobenchmark now correctly fully resets compilation state for each compile - this requires reinstalling the APK prior to Android 14, so benchmarking on Android 14+ is strongly recommended if you want to persist state (like user login) in what's being measured.
- You can also work around this by controlling app compilation separately, and skipping compilation with
CompilationMode.Ignore()
or instrumentation argument
Instrumentation Arguments
- Support for
androidx.benchmark.dryRunMode.enable
instrumentation argument, (already available in microbenchmark) for quicker validation runs (eg when creating the benchmark, or in presubmit) - Support for
androidx.benchmark.profiling.mode=StackSampling
andMethodTracing
. - Added
androidx.benchmark.enabledRules
to allow runtime filtering baseline profile vs macrobenchmark rule tests - Added
androidx.benchmark.perfettoSdkTracing.enable
argument to enable tracing with tracing-perfetto, eg Compose recomposition tracing. Note that when used withStartupMode.COLD
, timing will be significantly affected as the tracing library is loaded and enabled during app startup.
- Support for
প্রয়োজনীয়তা
- Macrobenchmark now requires
ProfileInstaller
1.3.0 or greater in the target app, to enable profile capture / reset, and shader cache clearing.
- Macrobenchmark now requires
New Experimental Metric APIs
- Added experimental
TraceSectionMetric
, which allows for extracting simple timing fromtrace("") {}
blocks in your app, or TraceMetric for leveraging the full query capability of PerfettoTraceProcessor
. - Added experimental
PowerMetric
to capture power usage information - Added experimental
MemoryCountersMetric
to count page faults - Added experimental
PerfettoTraceProcessor
API, which is used internally to extract metrics from System traces (aka Perfetto traces)
- Added experimental
সংশোধন করে
- Fixed crashes when installing or extracting profiles from an app installed from multiple APKs (eg from app bundle).
- Fixed
FrameTimingMetric
ignoring frames with inconsistent frame IDs (generally, frames during ripples on API 31+) ( I747d2 , b/279088460 ) - Fixed parsing errors on traces > 64MB ( Ief831 , b/269949822 )
- Clarified errors when device (especially emulator) OS image not correctly configured for tracing, or compilation
- Skip battery level check for devices without battery (micro and macro)
- Improved file output, with more clear errors for invalid output directories, and safer defaults
- Improved stability of
StartupMode.COLD
by consistently dropping the shader cache (also exposed viaMacrobenchmarkScope.dropShaderCache
) - Fixed leanback fallback for
startActivityAndWait
.
Microbenchmark
- বৈশিষ্ট্য
- Profiling was moved to a separate phase, after other metrics, so one test run can display both accurate timing and profiling results.
- পরীক্ষামূলক API
- Added experimental
MicrobenchmarkConfig
API for defining custom metrics and configuring tracing and profiling. Can be used to capture method traces, or capture tracepoints (but be aware of tracing overhead). - Added experimental APIs for controlling
BenchmarkState
separately fromBenchmarkRule
, without JUnit - Added experimental
PerfettoTrace
record to enable capturing Perfetto traces, with custom configuration, separate from benchmark APIs.
- Added experimental
- সংশোধন করে
- Workaround missing leading whitespaces in Android Studio benchmark output.
- Fix issue where warnings could fail to print in Android Studio benchmark output.
- Fixed
SampledProfiling
crash on Android 13 (API 33) and higher. - Massively improved performance of
dryRunMode
by skippingIsolationActivity
and Perfetto tracing (Up to 10x faster dry run mode on older OS versions).
Version 1.2.0-rc02
6 অক্টোবর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc02
is released. Version 1.2.0-rc02 contains these commits.
Bug Fixes
- Fix Benchmark file output to no longer break
BaselineProfile
Plugin file copying. Files were generated and copied off device, but had been renamed such that the gradle plugin wouldn't see them. ( I8dbcc , b/303034735 , b/296453339 ) - Clarified
tracing-perfetto
loading error messages when injecting from macrobenchmark module into target application.
Version 1.2.0-rc01
20 সেপ্টেম্বর, 2023
androidx.benchmark:benchmark-*:1.2.0-rc01
is released. Version 1.2.0-rc01 contains these commits.
বাগ ফিক্স
- An exception (with remedy instructions) is now thrown when Perfetto SDK tracing fails to initialize in a Benchmark. ( I6c878 , b/286228781 )
- Fix OOM crash when converting ART method trace -> perfetto format. ( I106bd , b/296905344 )
- (Macrobenchmark) Clarified method tracing label when linked in Studio test output, and fixed method tracing filenames to be unique on device/host, so they won't be overwritten when more than one benchmark is run. ( I08e65 , b/285912360 )
- Ensures that the device is awake when capturing a baseline profile. ( I503fc )
Version 1.2.0-beta05
30 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta05
is released. Version 1.2.0-beta05 contains these commits.
নতুন বৈশিষ্ট্য
- The Baseline Profile Gradle Plugin now supports Android Gradle Plugin 8.3. ( aosp/2715214 )
Version 1.2.0-beta04
23 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta04
is released. Version 1.2.0-beta04 contains these commits.
নতুন বৈশিষ্ট্য
- The Baseline Profiles Gradle plugin now supports Android Gradle Plugin 8.3. ( aosp/2715214 )
Bug Fixes
- Fix failures in writing / moving and pulling files (especially those from parameterized tests) by sanitizing output file names further, avoiding '=' and ':' in output file names. ( I759d8 )
Version 1.2.0-beta03
9 আগস্ট, 2023
androidx.benchmark:benchmark-*:1.2.0-beta03
is released. Version 1.2.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added argument to filter
TraceSectionMetric
to only the target package, on by default ( Ia219b , b/292208786 )
Bug Fixes
- Renamed
fullTracing.enable
instrumentation argument toperfettoSdkTracing.enable
for consistency with artifact name, and other references.fullTracing.enable
will continue to work as a fallback. ( I7cc00 ) - Benchmark library internal tracepoints (including microbenchmark loop/phase tracing) will now show up in Studio system trace viewer, and nest under the correct process in Perfetto. ( I6b2e7 , b/293510459 )
- Removed macrobenchmark NOT-PROFILEABLE error on API 31+, and skip profileable check on eng/userdebug rooted devices. ( I2abac , b/291722507 )
- When using Dex Layout Optimizations, startup profile rules are also now considered as baseline profile rules. ( aosp/2684246 , b/293889189 )
Version 1.2.0-beta02
জুলাই 26, 2023
androidx.benchmark:benchmark-*:1.2.0-beta02
is released. Version 1.2.0-beta02 contains these commits.
এপিআই পরিবর্তন
- Added experimental APIs for microbench custom metrics and configuration (eg profiler, and tracing). ( I86101 , b/291820856 )
Bug Fixes
- Report error in macrobench when OS is misconfigured for tracing, as was recently fixed in API 26/28 ARM64 emulators. ( I0a328 , b/282191686 )
- Added detail to compilation reset failure to suggest updating emulator, as some emulators have recently fixed this issue. ( I8c815 , b/282191686 )
- Make
androidx.test.uiautomator:uiautomator:2.2.0
anapi
instead of animplementation
dependency. ( I1981e )
Version 1.2.0-beta01
18 জুলাই, 2023
androidx.benchmark:benchmark-*:1.2.0-beta01
is released. Version 1.2.0-beta01 contains these commits.
Bug Fixes
- Fix warnings being sometimes suppressed in Benchmark output in Studio, and workaround leading whitespaces from Benchmark output not showing up in Studio ( Ia61d0 , b/227205461 , b/286306579 , b/285912360 )
- Fixed comment for
FrameTimingMetric
. The submetric is namedframeDurationCpuMs
. ( Ib097f , b/288830934 ).
Version 1.2.0-alpha16
জুন 21, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha16
is released. Version 1.2.0-alpha16 contains these commits.
এপিআই পরিবর্তন
-
BaselineProfileRule.collectBaselineProfile()
API has been renamed toBaselineProfileRule.collect()
. ( I4b665 )
Bug Fixes
- Macrobenchmark support for
androidx.benchmark.profiling.mode = MethodTracing
. ( I7ad37 , b/285912360 ) - Microbenchmark profiling moved to a separate phase, so it occurs in sequence after measurement, instead of replacing it.
MethodTracing
trace sections are also now included in the captured Perfetto trace, if present. ( I9f657 , b/285014599 ) - Add count measurement to
TraceSectionMetric
withMode.Sum
. ( Ic121a , b/264398606 )
Version 1.2.0-alpha15
7 জুন, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha15
is released. Version 1.2.0-alpha15 contains these commits.
নতুন বৈশিষ্ট্য
- Added experimental
MemoryUsageMetric
for tracking memory usage of a target application. ( I56453 , b/133147125 , b/281749311 ) - Add support for fully custom Perfetto configs with
PerfettoTrace.record
( If9d75 , b/280460183 ) - Added property to skip baseline profile generation. Usage:
./gradlew assemble -Pandroidx.baselineprofile.skipgeneration
. ( I37fda , b/283447020 )
এপিআই পরিবর্তন
- The
collectBaselineProfile
API always generates stable baseline profiles. ThecollectStableBaselineProfile
API has been removed andcollectBaselineProfile
should be used instead. ( I17262 , b/281078707 ) - Changed
BaselineProfileRule
'sfilterPredicate
arg to non-null, with a equivalent default value so that the default filter behavior is more clear in docs. ( I3816e )
Bug Fixes
- Disable
IsolationActivity
and Perfetto tracing indryRunMode
to significantly improve performance, as these were majority of runtime. ( Ie4f7d ) - Support for call stack sampling in Macrobenchmarks using instrumentation test arguments
androidx.benchmark.profiling.mode=StackSampling
andandroidx.benchmark.profiling.sampleFrequency
. ( I1d13b , b/282188489 ) - Fixes crash when dropping shaders on Android U (API 34), as well as on emulators. ( I031ca , b/274314544 )
Version 1.2.0-alpha14
3 মে, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha14
is released. Version 1.2.0-alpha14 contains these commits.
বাগ ফিক্স
- Fix
FrameTimingMetric
ignoring frames with inconsistent frame IDs. This would cause some animations on recent platform versions (API 31+) to ignore many frames whileRenderThread
was animating (eg during a ripple). ( I747d2 , b/279088460 ) - Fixed trace processor parsing for traces larger than 64Mb. ( Ief831 , b/269949822 )
- Fixed baseline profile generation on Android U failing because of the different output of
pm dump-profiles
command. ( Id1392 , b/277645214 ) - Fix GPU clock locking script to compare strings correctly ( I53e54 , b/213935715 )
Version 1.2.0-alpha13
5 এপ্রিল, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha13
is released. Version 1.2.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Added profile type parameter when generating baseline profiles to support upcoming startup profile feature ( Ie20d7 , b/275093123 )
- Added new experimental
TraceMetric
API for defining fully custom metrics based on content of a Perfetto trace. ( I4ce31 , b/219851406 ) - Add an experimental metric to determine the number of page faults during a benchmark. ( I48db0 )
Version 1.2.0-alpha12
22 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha12
is released. Version 1.2.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- The new baseline profile gradle plugin is released in alpha version, making it easier to generate a baseline profile and simplifying the developer workflow.
এপিআই পরিবর্তন
- Removed Perfetto tracing support on API 21 and 22, which includes both Microbenchmarks and the experimental
PerfettoTrace
APIs. Prior to this version,UiAutomation
connections were unreliable on some devices. ( I78e8c ) - Added public experimental API for
PerfettoTraceProcessor
to enable parsing trace content. This is a step toward fully custom metrics based on Perfetto trace data. ( I2659e , b/219851406 )
Version 1.2.0-alpha11
8 মার্চ, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha11
is released. Version 1.2.0-alpha11 contains these commits.
বাগ ফিক্স
- Fixed crashes in
MacrobenchmarkRule
andBaselineProfileRule
when reinstalling or extracting profiles from an app bundle with multiple APKs. ( I0d8c8 , b/270587281 )
Version 1.2.0-alpha10
22 ফেব্রুয়ারি, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha10
is released. Version 1.2.0-alpha10 contains these commits.
নতুন বৈশিষ্ট্য
- On Android 14+, Macrobenchmark no longer reinstalls target applications to reset compilation state, thanks to a new platform feature. Previously it was necessary to have a rooted device, or to deal with all application state (eg user login) being removed before each benchmark runs. ( I9b08c , b/249143766 )
Bug Fixes
- Fix
DryRunMode
to no longer crash with empty profile, due to compilation skipping. Instead, it runs a single iteration and extracts the profile to ensure something is captured. ( I2f05d , b/266403227 ) - Fix
PowerMetric
crash when checking for powerstats presence on old API levels. ( 5faaf9 , b/268253898 )
Version 1.2.0-alpha09
11 জানুয়ারী, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha09
is released. Version 1.2.0-alpha09 contains these commits.
Bug Fixes
- Enabled passing
None
toandroidx.benchmark.enabledRules
instrumentation arg to disable all benchmarks / baseline profile generation. ( I3d7fd , b/258671856 ) - Fix
PerfettoTrace
capture in app modules (ie non-self-instrumenting test APKs) ( I12cfc ) - Fixed baseline profile adb pull argument order in Studio output ( I958d1 , b/261781624 )
- Arm emulator api 33 is now correctly recognized as such when trying to run a macrobenchmark and will correctly print the warning. ( 69133b , b/262209591 )
- Skip battery level check on devices without battery in Macrobenchmark ( fe4114 , b/232448937 )
Version 1.2.0-alpha08
December 7, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha08
is released. Version 1.2.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- পরীক্ষার আচরণ এবং কর্মক্ষমতা পরিদর্শন করতে পরীক্ষার অংশ হিসাবে পারফেটো ট্রেসগুলি (সিস্টেম ট্রেস হিসাবেও পরিচিত) ক্যাপচার করতে পরীক্ষামূলক নতুন এপিআইএস
PerfettoTrace.record {}
এবংPerfettoTraceRule
যুক্ত করা হয়েছে। ( I3ba16 ) -
BaselineProfileRule
now accepts a filter predicate instead of a list of package prefixes. This gives the test full control on filtering. ( I93240 ) - Add an experimental API
BaselineProfileRule.collectStableBaselineProfile
which waits until a baseline profile is stable for N iterations. ( I923f3 ) - Add the ability to specify an output file name prefix when generating baseline profiles using
BaselineProfileRule
. ( I7b59f , b/260318655 )
Bug Fixes
- Improve safety of file output writing, which should prevent output files from silently not being written / appended, especially on API 21/22. ( If8c44 , b/227510293 )
- Fix
simpleperf
trace output to create and place the file correctly. This should also more generally fix issues where a file is unsuccessfully pulled by gradle. ( I12a1c , b/259424099 ) - Improve profileinstaller error message printed when profileinstaller is too old. This now tells you to update profileinstaller version (1.2.1) for measuring baseline profiles on API 31 through 33, instead of saying it's not supported. ( Ia517f , b/253519888 )
- Fix several shell command failures onerror message Print needed API <=23, including failed perfetto capture binary setup and trace capture failures ( Ib6b87 , b/258863685 )
- Automatically sort generated profile rules to minimize the number of changes as they change over time (when checking-in profile rules into source control). ( Ie2509 )
- Fixed crash on unrooted builds below Android 13 (API 33) with message
Expected no stderr from echo 3 > /proc/sys/vm/drop_caches
( I6c245 , b/259508183 )
Known Issues - MacrobenchmarkScope.dropShaderCache()
may crash due to a missing broadcast registry in profileinstaller manifest, which has not yet been released. ( I5c728 , b/258619948 ) To workaround the issue in profileinstaller:1.3.0-alpha02
, add the following to your application's (not your benchmark's) AndroidManifest.xml:
<!-- workaround bug in profileinstaller 1.3.0-alpha02, remove when updating to alpha03+ -->
<receiver
android:name="androidx.profileinstaller.ProfileInstallReceiver"
android:permission="android.permission.DUMP"
android:exported="true">
<intent-filter>
<action android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
</intent-filter>
</receiver>
Version 1.2.0-alpha07
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha07
is released. Version 1.2.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Adds
PowerMetric
API for measuring energy and power in Macrobenchmarks. ( Ife601 , b/220183779 ) - Fixed
MacrobenchmarkScope.dropShaderCache()
to actually drop the shader cache. This removes roughly 20ms of noise fromStartupMode.COLD
benchmarks, as shaders are now consistently cleared each iteration. Previously,Partial
compilation using warmup iterations would report incorrectly fast numbers, as shader caching was more likely to happen during warmup. This fix requires either a rooted device, or usingprofileinstaller:1.3.0-alpha02
in the target app. ForProfileInstaller
library's API changes, please refer to ProfileInstaller 1.30-alpha02 page. ( Ia5171 , b/231455742 ) - Added
TraceSectionMode("label", Mode.Sum)
, allowing measurement of total time spent on multiple trace sections with the same label. For instance,TraceSectionMetric("inflate", Mode.Sum)
will report a metricinflateMs
for the total time in a macrobenchmark spent on inflation. Also removed API 29 requirement, asTraceSectionMetric
works together withandroidx.tracing.Trace
back to lower API levels, with the use offorceEnableAppTracing
within the target app. ( Id7b68 , b/231455742 )
Bug Fixes
- Improved safety of all internal shell commands by validating all output/errors. ( I5984d , b/255402908 , b/253094958 )
- Specify device in baseline profile
adb pull
command, so the pull command can be simply copied if multiple devices are connected (up to one emulator) ( I6ac6c , b/223359380 ) - Add error if macrobenchmark test apk isn't set up as self-instrumenting. This error prevents macrobenchmarking from within the target app's process. In process, macrobench wouldn't be able to compile/kill/cold start the app, or control its own permissions ( I4279b )
- Fixed an issue in
measureRepeated()
whereStartupMode.COLD
wouldn't kill the target process aftersetupBlock
. NowsetupBlock
interacting with the app will not leave the app process running, and an invalid cold start measurement. ( I8ebb7 )
Version 1.2.0-alpha06
24 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha06
is released. Version 1.2.0-alpha06 contains these commits.
এপিআই পরিবর্তন
-
BaselineProfileRule
no longer requires root on Android 13 (API 33), and is no longer experimental. ( Ie0a7d , b/250083467 , b/253094958 )- This change also fixes how profiles from an app are flushed to disk on unrooted devices, but requires updating the target app's profileinstaller dependency.
- To use
BaselineProfileRule
orCompilationMode.Partial(warmupIterations)
on an unrooted device, you must also update your target app to useandroidx.profileinstaller.profileinstaller:1.3.0-alpha01
. This enables flushing the profile to disk correctly, so that it can be compiled/extracted.
Bug Fixes
- Fixes
SampledProfiling
crash on API 33+. ( I40743 , b/236109374 )
Version 1.2.0-alpha05
5 অক্টোবর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha05
is released. Version 1.2.0-alpha05 contains these commits.
বাগ ফিক্স
- Fix frame breakdown in Studio system trace viewer for benchmark captured traces ( I3f3ae , b/239677443 )
- Correct
FrameTimingMetric
to listFrameOverrun
as requiring API 31 instead of 29 ( I716dd , b/220702554 ) - Set iteration in
BaselineProfileRule
, and throw clearly if target package not installed (was already done for MacrobenchmarkRule). ( Ic09a3 , b/227991471 )
Version 1.2.0-alpha04
21শে সেপ্টেম্বর, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha04
is released. Version 1.2.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
Add support for
dryRunMode.enable
instrumentation argument to macrobenchmark (already available in micro) for faster local development, and validating app automation (eg in presubmit). This overrides iterations to 1, skips compilation, suppresses all configuration errors , and disables measurement .json file output. ( Ib51b4 , b/175149857 )On Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.dryRunMode.enable=true
In build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.dryRunMode.enable', 'true' } }
Bug Fixes
- Fixed
StartupTimingMetric
to no longer require measured Activities to be launched throughMacrobenchmarkScope.startActivityAndWait()
. This means the metric can pick up launches from eg notifications,Context.startActivity()
, in-app Activity based navigation, or shell commands. ( Ia2de6 , b/245414235 ) - Fix bug where
startActivityAndWait
would timeout trying to wait for launch completion on emulators by reducing strictness of frame detection. ( Ibe2c6 , b/244594339 , b/228946895 )
Version 1.2.0-alpha03
September 7, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha03
is released. Version 1.2.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added experimental APIs for using
BenchmarkState
independently, separate fromBenchmarkRule
/JUnit4
. ( Id478f , b/228489614 )
Bug Fixes
- Added Leanback fallback for
startActivityAndWait
. ( 01ed77 , b/242899915 )
Version 1.2.0-alpha02
24 আগস্ট, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha02
is released. Version 1.2.0-alpha02 contains these commits.
এপিআই পরিবর্তন
- Default to
am force stop
forMacrobenchmarkScope.killProcess()
, even when rooted, except during Baseline Profile generation. This can be overridden with an optional boolean argument. ( 02cce9 , b/241214097 )
Bug Fixes
- Support baseline profile generation for System apps. ( I900b8 , b/241214097 )
- Support checking for ODPM power metrics on unrooted devices. ( a38c78 , b/229623230 )
Version 1.2.0-alpha01
জুলাই 27, 2022
androidx.benchmark:benchmark-*:1.2.0-alpha01
is released. Version 1.2.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- New tracing-perfetto-common component allowing tooling to enable Perfetto SDK tracing in an app that exposes it ( I2cc7f )
Added
androidx.benchmark.enabledRules
instrumentation argument to enable filtering macrobenchmark runs to just benchmarks, or just baseline profile generation. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when just generatingBaselineProfiles
on an emulator. Comma-separated list also Supported. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
এপিআই পরিবর্তন
- Added new
PowerMetric
for measuring energy and power tasks in benchmarks. ( I9f39b , b/220183779 ) - Added a new compilation mode
CompilationMode.Ignore
to skip profile reset and compilation. ( Ibbcf8 , b/230453509 ) - Added a new parameter to
BaselineProfileRule#collectBaselineProfile
to filter output file by package names ( If7338 , b/220146561 ) - Enables developer to discharge device to measure power drain. ( I6a6cb )
- Added the ability to clear shader cache in
MacrobenchmarkScope
. ( I32122 ) - Enables developer to configure display of metric type and detail desired subsystem categories. ( I810c9 )
- Previously an
UnsupportedOperationException
was thrown in the benchmark if run on an unsupported device. Now UOE only occurs if the metric is used on the unsupported device (ie:PowerMetric.configure
). ( I5cf20 , b/227229375 ) - Added
TotalPowerMetric
andTotalEnergyMetric
for measuring total power and energy in each system category in macrobenchmarks. ( I3b26b , b/224557371 )
Bug Fixes
- Fixed an issue where compiled methods were not correctly being reset between each macrobenchmark on unrooted builds. This unfortunately requires reinstalling the apk each iteration, which will clear application data for each macrobenchmark. ( I31c74 , b/230665435 )
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 , b/227510293 , b/227512788 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
Version 1.1.1
Version 1.1.1
9 নভেম্বর, 2022
androidx.benchmark:benchmark-*:1.1.1
is released. Version 1.1.1 contains these commits.
Bug Fixes
- Fixes
android.system.ErrnoException: open failed: EACCES
which would occur on some Android11 (API 30)+ devices. This is a cherry-pick of a fix from1.2.0-alpha01
. ( aosp/2072249 )
সংস্করণ 1.1.0
সংস্করণ 1.1.0
15 জুন, 2022
androidx.benchmark:benchmark-*:1.1.0
is released. Version 1.1.0 contains these commits.
- This version is identical to
androidx.benchmark:benchmark-*:1.1.0-rc03
.
Important changes since 1.0.0
Support for Jetpack Macrobenchmarks, which allows you to measure whole-app interactions like startup and scrolling , provides the ability to capture traces & measure trace sections .
Support for Baseline Profiles
-
CompilationMode.Partial
to measure the effectiveness of Baseline Profiles. -
@BaselineProfileRule
to automatically generate Baseline profiles for a given critical user journey.
-
Support for Allocation metrics & profiling during Microbenchmark runs.
Version 1.1.0-rc03
জুন 1, 2022
androidx.benchmark:benchmark-*:1.1.0-rc03
is released. Version 1.1.0-rc03 contains these commits.
বাগ ফিক্স
Avoid reinstalling the target package on every benchmark iteration. ( aosp/2093027 , b/231976084 )
Remove the
300ms
delay frompressHome()
. ( aosp/2086030 , b/231322975 )Improve Macrobenchmark iteration speed by optimizing Shell commands used under the hood. ( aosp/2086023 , b/231323582 )
Support for Managed Gradle Devices when generating Baseline Profiles with Macrobenchmarks. ( aosp/2062228 , b/228926421 )
Version 1.1.0-rc02
May 11, 2022
androidx.benchmark:benchmark-*:1.1.0-rc02
is released. Version 1.1.0-rc02 contains these commits.
- Note that this release includes a behavior change, as apps are now fully reinstalled in between each benchmark to ensure accurate measurements.
Bug Fixes/Behavior Changes
Fixed an issue where app compilation was not correctly reset between macrobenchmarks, and not reset at all on unrooted builds. This fixes many cases where running multiple tests would result in
CompilationMode
having little to no effect on measurements. To workaround this problem, the target app is now fully reinstalling each test method, which will clear application data between each macrobenchmark. ( I31c74 , b/230665435 )As this prevents apps from setting up state before tests, it is now possible to skip compilation / reinstallation to enable working around this. You can for example fully compile the target with a shell command
cmd package compile -f -m speed <package>
, and then bypass macrobenchmark's compilation step.Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.compilation.enabled, 'false' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.compilation.enabled=false
Made it possible to share a module between macrobenchmarks and baseline profile generating tests by adding
androidx.benchmark.enabledRules
instrumentation argument. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, eg when generatingBaselineProfiles
on an emulator. ( I756b7 , b/230371561 )Eg in Your macrobenchmark's build.gradle:
android { defaultConfig { testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile' } }
Or from the Gradle command line:
./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
Version 1.1.0-rc01
20 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-rc01
is released. Version 1.1.0-rc01 contains these commits.
Bug Fixes
- Baseline profile output links in Android Studio now use a unique file name. This way the output always reflects the latest results of using a
BaselineProfileRule
. ( aosp/2057008 , b/228203086 )
Version 1.1.0-beta06
6 এপ্রিল, 2022
androidx.benchmark:benchmark-*:1.1.0-beta06
is released. Version 1.1.0-beta06 contains these commits.
Bug Fixes
- Fix trace recording crash on API 21/22 ( If7fd6 , b/227509388 )
- Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. ( Ia517c )
- Fix startup metrics for Macrobenchmarks when
CompilationMode.None()
is used. Before this change,CompilationMode.Partial()
would appear to be slower thanCompilation.None()
. ( 611ac9 ).
Version 1.1.0-beta05
23 মার্চ, 2022
androidx.benchmark:benchmark-*:1.1.0-beta05
is released. Version 1.1.0-beta05 contains these commits.
Bug Fixes
- Kill package after skipping profile installation when using
CompilationMode.None
. ( aosp/1991373 ) - Fixed an issue where Macrobenchmarks is unable to collect startup metrics when using
StartupMode.COLD
. ( aosp/2012227 b/218668335 )
Version 1.1.0-beta04
23 ফেব্রুয়ারি, 2022
androidx.benchmark:benchmark-*:1.1.0-beta04
is released. Version 1.1.0-beta04 contains these commits.
Bug Fixes
Fix missing metrics on Android 10, and
NoSuchElementException
caused by process names not being captured correctly in traces. ( Ib4c17 , b/218668335 )Use
PowerManager
for thermal throttling detection on Q (API 29) and higher. This significantly reduces frequency of false positives in thermal throttling detection (benchmark retry after 90 second cooldown), and speeds up benchmarks significantly on user builds. It also provides throttle detection even when clocks are locked (if they're locked too high for the device's physical environment). ( I9c027 , b/217497678 , b/131755853 )Filter simpleperf sampled profiling to
measureRepeated
thread only to simplify inspection ( Ic3e12 , b/217501939 )Support metrics from named UI subprocesses in multi-process apps ( Ice6c0 , b/215988434 )
Filter Baseline Profile rules to target Android 9 (SDK 28). aosp/1980331 b/216508418
Skip Profile Installation when using
Compilation.None()
. Additionally, report warnings when the app is using an older version ofandroidx.profileinstaller
and Android Gradle Plugin. aosp/1977029
Version 1.1.0-beta03
ফেব্রুয়ারী 9, 2022
androidx.benchmark:benchmark-*:1.1.0-beta03
is released. Version 1.1.0-beta03 contains these commits.
এপিআই পরিবর্তন
- Added
AudioUnderrunMetric
into macrobenchmark library under experimental flag to allow detection of audio underruns ( Ib5972 ) BaselineProfileRule
no longer accepts asetup
block as this functioned the same as theprofileBlock
. ( Ic7dfe , b/215536447 )যেমন
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, setupBlock = { startActivityAndWait() }, profileBlock = { // ... } ) }
@Test fun collectBaselineProfile() { baselineRule.collectBaselineProfile( packageName = PACKAGE_NAME, profileBlock = { startActivityAndWait() // ... } ) }
Bug Fixes
- Fixed issue where microbench profiler traces would fail to be updated in subsequent runs when linked in Studio output ( I5ae4d , b/214917025 )
- Prevent compilation shell commands on API 23 ( Ice380 )
- Renamed
FrameCpuTime
->FrameDurationCpu
,FrameUiTime
->FrameDurationUi
to clarify these are durations, not timestamps, and to match prefixes. ( I0eba3 , b/216337830 )
Version 1.1.0-beta02
জানুয়ারী 26, 2022
androidx.benchmark:benchmark-*:1.1.0-beta02
is released. Version 1.1.0-beta02 contains these commits.
Bug Fixes
- Microbenchmark Stack Sampling / Method Tracing Profile results are now linked in Studio output, similar to other profiling outputs, and do not suppress the allocation metric. ( Idcb65 , b/214440748 , b/214253245 )
- BaselineProfileRule now prints the
adb pull
command in logcat and Studio output for pulling generated BaselineProfile text file. ( f08811 )
Version 1.1.0-beta01
জানুয়ারী 12, 2022
androidx.benchmark:benchmark-*:1.1.0-beta01
is released. Version 1.1.0-beta01 contains these commits.
বাগ ফিক্স
- Fixes profiler argument enable being ignored. ( I37373 , b/210619998 )
- Removed deprecated
CompliationModes
( I98186 , b/213467659 ) - Switched baseline profile arg of
CompilationMode.Partial
to enum for clarity. ( Id67ea )
Version 1.1.0-alpha13
15 ডিসেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha13
is released. Version 1.1.0-alpha13 contains these commits.
এপিআই পরিবর্তন
- Add low-overhead System Tracing to microbench output on Android Q (API 29+). Note that this does not currently capture custom tracing (via
android.os.Trace
orandroidx.tracing
Jetpack APIs) to avoid affecting results. This tracing should be useful in diagnosing instability, especially from sources outside the benchmark. ( I298be , b/205636583 , b/145598917 ) - Clarify
CompilationModes
into three classes - Full, None, Partial. Previously they were inconsistently named after compilation arguments (which we now treat as implementation details) and features. This makes the tradeoffs, potential combinations, and behavior across platform versions more clear. ( I3d7bf , b/207132597 ) - Setup and measure are now always in pairs, in order. You can now query the package name and iteration (though the iteration may be
null
in certain warmup scenarios). ( Id3b68 , b/208357448 , b/208369635 )
Bug Fixes
- Fixed
CompilationMode.Speed
incorrectly treated asNone
( I01137 )
Version 1.1.0-alpha12
নভেম্বর 17, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha12
is released. Version 1.1.0-alpha12 contains these commits.
নতুন বৈশিষ্ট্য
- Add experimental TraceSectionMetric for custom trace-based timing measurements. ( I99db1 , b/204572664 )
Bug Fixes
- Wake device each iteration, to ensure UI can be tested - requires lockscreen is disabled. ( Ibfa28 , b/180963442 )
- Fixes multiple crashes in StackSampling profiling mode on emulators and non-rooted devices ( Icdbda , b/202719335 )
- Removed 0.5 second sleep at the end of each iteration - if you see missing metrics with this change, please file a bug. ( Iff6aa )
- Reduce chances of dropped data, and lower memory overhead from tracing ( Id2544 , b/199324831 , b/204448861 )
- Reduce trace size by ~40% by switching to compact sched storage format. ( Id5fb6 , b/199324831 )
- Updated implementations of startup metrics to always end at end of renderthread. This will be more contistent across platform versions, and more closely map to in-app measurements. ( Ic6b55 )
Version 1.1.0-alpha11
3 নভেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha11
is released. Version 1.1.0-alpha11 contains these commits.
এপিআই পরিবর্তন
- Macrobenchmark now has a
minSdkVersion
of23
. ( If2655 ) - Adds a new experimental
BaselineProfileRule
which is capable of generating baseline profiles for app's critical user journey. Detailed documentation to follow. ( Ibbefa , b/203692160 ) - Removes measureRepeated interface variant, which was added for java callers, as it caused ambiguity in completing/resolving the method. Java callers will again need to return Unit.Instance from measureRepeated. If this is an inconvenience, please file a bug, we can revisit this in a future version. ( Ifb23e , b/204331495 )
Version 1.1.0-alpha10
27 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha10
is released. Version 1.1.0-alpha10 contains these commits.
এপিআই পরিবর্তন
- Backport StartupTimingMetric to work back to API 23. This new implementation also better handles reportFullyDrawn() to wait until corresponding content has been rendered. ( If3ac9 , b/183129298 )
- Added JvmOverloads to multiple MacrobenchmarkScope methods for Java callers. ( I644fe , b/184546459 )
- Provide alternative MacrobenchmarkRule.measureRepeated function that uses a
Consumer<MacrobenchmarkScope>
for idiomatic usage in Java language. ( If74ab , b/184546459 )
Bug Fixes
- Fix for traces not starting early enough, and missing metric data. This is expected to fix "Unable to read any metrics during benchmark" exceptions that were caused by the library itself. ( I6dfcb , b/193827052 , b/200302931 )
- FrameNegativeSlack has been renamed to FrameOverrun to clarify its meaning - how much the frame went over its time budget. ( I6c2aa , b/203008701 )
Version 1.1.0-alpha09
13 অক্টোবর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha09
is released. Version 1.1.0-alpha09 contains these commits.
Bug Fixes
- Support dropping Kernel page cache without root on API 31/S+, which will increase accuracy of StartupMode.COLD launches. ( Iecfdb , b/200160030 )
Version 1.1.0-alpha08
সেপ্টেম্বর 29, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha08
is released. Version 1.1.0-alpha08 contains these commits.
এপিআই পরিবর্তন
- Enable scrolling macrobenchmarks to run back to API 23 ( If39c2 , b/183129298 )
- Add new type of sampled metric to UI and JSON output, focused on percentiles of multiple samples per iteration. ( I56247 , b/199940612 )
- Switch to floating point metrics throughout the benchmark libraries (truncated in the Studio UI). ( I69249 , b/197008210 )
Version 1.1.0-alpha07
1 সেপ্টেম্বর, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha07
is released. Version 1.1.0-alpha07 contains these commits.
এপিআই পরিবর্তন
- Raised min API to 21 to reflect the intended lowest API level to be supported in the future. Current min API supported continues to be conveyed via RequiredApi(), and is currently 29 ( I440d6 , b/183129298 )
Bug Fixes
- Fixes
ProfileInstaller
to make it easier for apps using baseline profiles to run MacroBenchmarks usingCompilationMode.BaselineProfile
. ( I42657 , b/196074999 ) NOTE: requires also updating toandroidx.profileinstaller:profileinstaller:1.1.0-alpha04
or greater. -
StartupMode.COLD
+CompilationMode.None
benchmarks are now more stable. ( I770cd , b/196074999 )
Version 1.1.0-alpha06
18 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha06
is released. Version 1.1.0-alpha06 contains these commits.
এপিআই পরিবর্তন
- Added
androidx.benchmark.iterations
instrumentation argument to allow manual overriding of iteration count when testing/profiling locally. ( 6188be , b/194137879 )
Bug Fixes
- Switched to Simpleperf as default sampling profiler on API 29+. ( Ic4b34 , b/158303822 )
পরিচিত সমস্যা
-
CompilationMode.BaselineProfile
is a work in progress. Avoid using it to determine how good a profile is for now.
Version 1.1.0-alpha05
4 আগস্ট, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha05
is released. Version 1.1.0-alpha05 contains these commits.
1.1.0-alpha04
was cancelled before release due to a sporatic crash. b/193827052
এপিআই পরিবর্তন
- Switched startActivityAndWait to invoke launch via
am start
, which reduces the time of each measurement iteration by approximately 5 seconds, at the cost of no longer supporting intent parcelables. ( I5a6f5 , b/192009149
Bug Fixes
- Reduce aggressiveness of thermal throttle detection, and recompute baseline if throttles are detected frequently. ( I7327b )
- Fixes FrameTimingMetric to work on Android S beta ( Ib60cc , b/193260119 )
- Use an
EmptyActivity
to bring the target app out of a force-stopped state to better supportCompilationMode.BaselineProfile
. ( Id7cac , b/192084204 ) - Changed trace file extension to
.perfetto-trace
to match platform standard. ( I4c236 , b/174663039 ) - StartupTimingMetric now outputs the "fullyDrawnMs" metric to measure time until your application has completed rendering. To define this metric for your app, call Activity.reportFullyDrawn when your initial content is ready, such as when your initial list items are loaded from DB or network. (reportFullyDrawn method available without build version checks on ComponentActivity). Note that your test must run long enough to capture the metric (startActivityAndWait doesn't wait for reportFullyDrawn). ( If1141 , b/179176560 )
- Reduce cost of appending Ui metadata to traces by 50+ ms ( Ic8390 , b/193923003 )
- Drastically increased polling frequency when stopping tracing, which can reduce eg startup benchmark runtime by 30+% ( Idfbc1 , b/193723768 )
Version 1.1.0-alpha03
16 জুন, 2021
androidx.benchmark:benchmark-*:1.1.0-alpha03
is released. Version 1.1.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added a new
CompilationMode.BaselineProfile
to support profiles installed using the Jetpack ProfileInstaller library . ( aosp/1720930 )
Bug Fixes
The sample Gradle code for suppressing benchmark errors has been updated to use a non-deprecated API with a syntax that also supports .gradle.kts users.
যেমন,
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"
Version 1.1.0-alpha02
18 মে, 2021
Benchmark version 1.1.0-alpha02 brings a big component to benchmarking - Macrobenchmark. In addition to benchmark allowing you to measure CPU loops, macrobenchmark allows you to measure whole-app interactions like startup and scrolling, and capture traces. For more information see the library documentation .
androidx.benchmark:benchmark-*:1.1.0-alpha02
is released. Version 1.1.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
Macrobenchmark artifacts added ( androidx.benchmark:benchmark-macro-junit4
and androidx.benchmark:benchmark-macro
)
- Capture startup, scrolling/animation performance metrics from your app, locally or in CI
- Capture and inspect traces from within Android Studio
Bug Fixes
- Workaround shell permissions issue with output directory on Android 12 (Note - may require updating Android Gradle Plugin to 7.0.0 canary and Android Studio to Arctic Fox (2020.3.1), to continue capturing output files on affected devices). ( Icb039 )
- Support configuration caching in BenchmarkPlugin ( 6be1c1 , b/159804788 )
- Simplified file output - on by default, in a directory that doesn't require
requestLegacyExternalStorage=true
( 8b5a4d , b/172376362 ) - Fixes library printing logcat warnings about not finding JIT thread on platform versions where it is not present. ( I9cc63 , b/161847393 )
- Fix for reading device max frequency. ( I55c7a )
Version 1.1.0-alpha01
জুন 10, 2020
androidx.benchmark:benchmark-common:1.1.0-alpha01
, androidx.benchmark:benchmark-gradle-plugin:1.1.0-alpha01
, and androidx.benchmark:benchmark-junit4:1.1.0-alpha01
are released. Version 1.1.0-alpha01 contains these commits.
New Features of 1.1
- Allocation Metric - Benchmarks now run an additional phase after warmup and timing, capturing allocation counts. Allocations can cause performance problems on older versions of the platform (140ns in O became 8ns in M - measured on Nexus5X, with locked clocks). This metric is displayed in Android Studio console output, as well as in the
- Profiling support - You can now capture profiling data for a benchmark run, to inspect why your code may be running slowly. Benchmark supports capturing either method tracing, or method sampling from ART. These files can be inspected with the Profiler inside Android Studio using File > Open .
- The Benchmark Gradle plugin now provides defaults for simpler setup:
-
testBuildType
is set to release by default, to avoid using dependencies with code coverage built-in. The release buildType is also configured as the default buildType, which allows Android Studio to automatically select the correct build variant when opening a project for the first time. ( b/138808399 ) -
signingConfig.debug
is used as the default signing config ( b/153583269 )
-
** Bug Fixes **
- Significantly reduced the warmup transition overhead, where the first measurement for each benchmark was artificially higher than others. This issue was more pronounced in very small benchmarks (1 microsecond or less). ( b/142058671 )
- Fixed
InstrumentationResultParser
error printed for each benchmark when running from command line. ( I64988 , b/154248456 )
পরিচিত সমস্যা
- Command line, gradle invocations of Benchmark do not print out results directly. You can work around this by either running through Studio, or parsing the JSON output file for results.
- Benchmark reporting fails to pull the report from devices that have an app installed with an applicationId ending with either “android” or “download” (case insensitive). Users hitting this issue should upgrade the Android Gradle Plugin to 4.2-alpha01 or later.
সংস্করণ 1.0.0
Benchmark Version 1.0.0
নভেম্বর 20, 2019
androidx.benchmark:benchmark-common:1.0.0
, androidx.benchmark:benchmark-gradle-plugin:1.0.0
, and androidx.benchmark:benchmark-junit4:1.0.0
are released with no changes from 1.0.0-rc01. Version 1.0.0 contains these commits .
Major features of 1.0.0
The Benchmark library allows you to write performance benchmarks of app code and get results quickly.
It prevents build and runtime configuration issues and stabilizes device performance to ensure that measurements are accurate and consistent. Run the benchmarks directly in Android Studio , or in Continuous Integration to observe code performance over time, and to prevent regressions.
প্রধান বৈশিষ্ট্য অন্তর্ভুক্ত:
- Clock stabilization
- Automatic thread prioritization
- Support for UI performance testing, such as in the RecyclerView Sample
- JIT-aware warmup and looping
- JSON benchmark output for post-processing
Version 1.0.0-rc01
23 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-rc01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-rc01
, and androidx.benchmark:benchmark-junit4:1.0.0-rc01
are released. Version 1.0.0-rc01 contains these commits .
নতুন বৈশিষ্ট্য
- Added systrace tracing to benchmarks
বাগ ফিক্স
- Fixed metric instability issue where JIT wouldn't finish before warm up due to deprioritization ( b/140773023 )
- Unified JSON output directory across Android Gradle Plugin 3.5 and 3.6
Version 1.0.0-beta01
9 অক্টোবর, 2019
androidx.benchmark:benchmark-common:1.0.0-beta01
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-beta01
, and androidx.benchmark:benchmark-junit4:1.0.0-beta01
are released. Version 1.0.0-beta01 contains these commits .
নতুন বৈশিষ্ট্য
- Run garbage collection before each warmup to reduce memory pressure from one benchmark to leak to the next ( b/140895105 )
বাগ ফিক্স
- Added
androidx.annotation:android-experimental-lint
dependency, so that Java code will correctly produce lint errors when experimental API is not used, similar to what is provided by the Kotlin experimental annotation for Kotlin callers. - Now correctly detects usage of
additionalTestOutputDir
instrumentation argument for output in Android Gradle Plugin 3.6, to know when AGP will handle data copy. - Fix undetected clock frequency in JSON to correctly print
-1
( b/141945670 ).
Version 1.0.0-alpha06
সেপ্টেম্বর 18, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha06
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha06
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha06
are released. Version 1.0.0-alpha06 contains these commits .
নতুন বৈশিষ্ট্য
- Added a check for incorrectly using the old package for the test runner, which now provides a more-helpful error message
API changes
- The experimental annotation
ExperimentalAnnotationReport
is now correctly public. Usage of the experimental BenchmarkState#report API now requires this annotation
Version 1.0.0-alpha05
5 সেপ্টেম্বর, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha05
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha05
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha05
are released. The commits included in this version can be found here .
API changes
-
BenchmarkState.reportData
API is now marked experimental
বাগ ফিক্স
- Fix for the clock-locking script, which would fail on devices that were either missing the
cut
orexpr
shell utilities. - Fixed an issue with
./gradlew lockClocks
task that would hang on devices that were rooted with an older version of the su utility, which did not support the-c
flag.
Version 1.0.0-alpha04
7 আগস্ট, 2019
androidx.benchmark:benchmark-common:1.0.0-alpha04
, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha04
, and androidx.benchmark:benchmark-junit4:1.0.0-alpha04
are released. The commits included in this version can be found here .
New documentation has also been added for how to use the Benchmark library without Gradle, both for usage with different build systems (such as Bazel or Buck), and when running in CI. For more information, see Build benchmarks without Gradle and Run benchmarks in Continuous Integration .
নতুন বৈশিষ্ট্য
- গ্রেডল প্লাগইন
- Now automatically disables test coverage, and sets the
AndroidBenchmarkRunner
by default ( b/138374050 ) - Added support for new AGP-based data copy, when running benchmarks and when using AGP 3.6+
- Now automatically disables test coverage, and sets the
- JSON format additions
- Output total benchmark test run time ( b/133147694 )
-
@Parameterized
benchmarks that use a name string (for example@Parameters(name = "size={0},depth={1}")
) now output parameter names and values per benchmark in the JSON output ( b/132578772 )
- Dry Run mode ( b/138785848 )
- Added a "dry run" mode for running each benchmark loop only once, to check for errors/crashes without capturing measurements. This can be useful eg for, for example, quickly running benchmarks in presubmit to check that they're not broken.
API changes
- Module structure has changed, splitting the library ( b/138451391 )
-
benchmark:benchmark-junit4
contains classes with JUnit dependency:AndroidBenchmarkRunner
, andBenchmarkRule
, both of which have moved into theandroidx.benchmark.junit4
package -
benchmark:benchmark-common
contains the rest of the logic, including the BenchmarkState API - This split will allow the library to support benchmarking without JUnit4 APIs in the future
-
- Configuration warnings are now treated as errors, and will crash the test ( b/137653596 )
- This is done to further encourage accurate measurements, especially in CI
- These errors can be reduced back to warnings with an instrumentation argument. For example:
-e androidx.benchmark.suppressErrors "DEBUGGABLE,LOW_BATTERY"
বাগ ফিক্স
- Errors when writing to external storage on Q devices provide more-descriptive messages, with suggestions of how to resolve the issue
- Screens are automatically turned on during benchmark runs, instead of failing when the screen is off
External contributions
- Thanks to Sergey Zakharov for contributing JSON output improvements and the fix for screen off issues!
Version 1.0.0-alpha03
জুলাই 2, 2019
androidx.benchmark:benchmark:1.0.0-alpha03
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha03
are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Expose sleep duration due to thermal throttling per benchmark in the full JSON report
বাগ ফিক্স
- The Gradle plugin should no longer be required to be applied after Android plugins and the Android block
- Adds support for benchmark reports on Android 10 devices using scoped storage
Version 1.0.0-alpha02
জুন 6, 2019
androidx.benchmark:1.0.0-alpha02
and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha02
are released. The commits included in this version can be found here .
Note that we are treating the JSON schema as an API. We plan to follow the same stability constraints as other APIs: stable (with very rare exceptions) once in beta, and fixed in final release, with only additions in minor releases and changes/removals in major releases.
API changes
Overhauled JSON schema. Further changes to the JSON schema are likely to be limited to additions:
- Reorganized the result object structure to support additional metric groups in the future ( b/132713021 )
- Added test run context information, such as device and build info and whether clocks are locked, to the top-level object ( b/132711920 )
- Time metric names now have 'ns' in their name ( b/132714527 )
- Additional stats added per reported metric (maximum, median, minimum), and removed simplified 'nanos' summary stat ( b/132713851 )
Removed XML output ( b/132714414 )
Thermal throttle detection removed from
BenchmarkState.reportData
API ( b/132887006 )
বাগ ফিক্স
- Fixed
./gradlew lockClocks
not sticking on some recent OS devices ( b/133424037 ) - Throttling detection disabled for emulator ( b/132880807 )
Version 1.0.0-alpha01
7 মে, 2019
androidx.benchmark:benchmark:1.0.0-alpha01
is released. The commits included in this version are available here .