All Projects → AgoraIO-Community → Moonlight

AgoraIO-Community / Moonlight

Licence: mit
MoonLight is a performance test kit on iOS and macOS. It can capture App Memory, App CPU, System CPU and GPU accurately and easily.

Projects that are alternatives of or similar to Moonlight

Heapinspector For Ios
Find memory issues & leaks in your iOS app without instruments
Stars: ✭ 1,819 (+1015.95%)
Mutual labels:  cocoapods, performance
Watchdoginspector
Shows your current framerate (fps) in the status bar of your iOS app
Stars: ✭ 497 (+204.91%)
Mutual labels:  cocoapods, performance
Bluetonium
Bluetooth mapping in Swift
Stars: ✭ 159 (-2.45%)
Mutual labels:  cocoapods
Learning Pwa
📱some samples and blogs about how to start with your first PWA
Stars: ✭ 162 (-0.61%)
Mutual labels:  performance
Laravel Mix Preload
Add preload and prefetch links based your Mix manifest
Stars: ✭ 162 (-0.61%)
Mutual labels:  performance
Version
Represent and compare versions via semantic versioning (SemVer) in Swift
Stars: ✭ 160 (-1.84%)
Mutual labels:  cocoapods
Powershell ipv4networkscanner
Powerful asynchronus IPv4 network scanner for PowerShell
Stars: ✭ 161 (-1.23%)
Mutual labels:  performance
Androidperformancetools
Android Performance Tools!
Stars: ✭ 159 (-2.45%)
Mutual labels:  performance
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (+0.61%)
Mutual labels:  cocoapods
Blog
Our open source benchmarks and code samples
Stars: ✭ 162 (-0.61%)
Mutual labels:  performance
Zap
An asynchronous runtime with a focus on performance and resource efficiency.
Stars: ✭ 162 (-0.61%)
Mutual labels:  performance
Are We Fast Yet
Are We Fast Yet? Comparing Language Implementations with Objects, Closures, and Arrays
Stars: ✭ 161 (-1.23%)
Mutual labels:  performance
Shoppingcartexample
A simple shopping cart example iOS App
Stars: ✭ 160 (-1.84%)
Mutual labels:  cocoapods
Tosmbclient
An Objective-C binding around the libDSM SMB client library.
Stars: ✭ 162 (-0.61%)
Mutual labels:  cocoapods
Kubestone
Performance benchmarks for Kubernetes
Stars: ✭ 159 (-2.45%)
Mutual labels:  performance
Caliper
Caliper is an instrumentation and performance profiling library
Stars: ✭ 162 (-0.61%)
Mutual labels:  performance
Zkudid
Generate and save permanent UDID with IDFV and keychain in iOS device.
Stars: ✭ 159 (-2.45%)
Mutual labels:  cocoapods
Campcotcollectionview
Collapse and expand UICollectionView sections with one method call.
Stars: ✭ 161 (-1.23%)
Mutual labels:  cocoapods
Swiftaudio
Audio player for iOS
Stars: ✭ 160 (-1.84%)
Mutual labels:  cocoapods
Forecastio
A Swift library for the Forecast.io Dark Sky API
Stars: ✭ 164 (+0.61%)
Mutual labels:  cocoapods

MoonLight

English | 中文

What is MoonLight?

MoonLight is a performance test kit for iOS/macOS app which can be integrated into your app to implement performance data captured easily. MoonLight can provide App CPU, System CPU, App Memory, System GPU and GPU info accuratly.

Why named it as MoonLight?

We name it as MoonLight because we hope it can make performance test easier and more efficient, just like the tranquil moonlight guides wanderers in the dark night and gives us a feeling of serenity and comfort.

MoonLight has low performance consumption and is easy to use. The performance data captured by MoonLight is accurately. It will help dev team locate the performance problems more quickly and accurately to promote the performance optimization. Help test team get performance data faster and more accurately to improve test efficiency.

Comparison

Instruments

The peformance data captured by MoonLight is the same as Instruments. The specific advantages and disadvantages are as follows.

  1. Instruments can not be implemented to performance test automation and can not get the specific data to be analysed scientifically. By comparison, MoonLight can provide the performance data accuratly and can support to implement performance test automation.

  2. Instruments can not to be implemented to test remotely. You can not test your app in your home while the device in your company. Therefore, you can not test plenty of devices at the same time. By comparison, MoonLight can support it.

  3. Low system iOS devices cannot by tested on the latest version Insturuments. By comparison, MoonLight doesn't have the limitaion.

  4. Insturments on macOS doesn't support gpu captureing. By comparison, MoonLight supports. The Moonlight's gpu info is the same as the activity monitor on macOS.

  5. Instruments also has advantages, such as the Allocations and Leaks to provide memory leaks testing. Instruments can also provide data visualization. By comparison, MoonLight is programmable. Developers can use MoonLight to implement data visualization and automated test need.

GT

GT is an opensource performance test project from Tencent. And GT also has many disvantages.

  1. GT is not support macOS. By comparison, MoonLight supports.

  2. GT's App Memory is not the same as Instruments. And GT can not output GPU and System CPU. By comparison, MoonLight supports.

  3. When GT is integrated in user's app, the app should add too many dependent frameworks and should disable Bitcode support. Moreover, GT‘s package size is much bigger than MoonLight. MoonLight only needs to add one framework on iOS and does not need to add any framework on macOS.

Perfdog

Perfdog is a closed source performance test tool from Tencent. And it does have many disvantages.

  1. Perfdog cannot sppport macOS app.

  2. Perfdog is not a automated performance test tool. It needs user to point UI button to start or stop performance testing. Perfdog's advantage is data visualization.

  3. Perfdog is not an open source project. And it did have serious bug on iOS14 that the App CPU captured by Perfdog is wrong. If use Perfdog to test your app, maybe you will find a new serious bug in the future because we do not konw Pefdog's source code.

Requirements

  • iOS 8.0+
  • macOS 10.11+

Installation

Cocoapods

  • iOS:

Warning! For iOS, do not use it on AppStore release. Recommend use it on debug mode.

pod 'MoonLight_iOS', :configurations => ['Debug']
  • macOS:
pod 'MoonLight_macOS'

Usage

// Step1: create MoonLight instance and set sampling interval.
	_moonLight = [[MoonLight alloc]initWithDelegate:self timeInterval:1];

// Step2: start timer.
	[_moonLight startTimer];


// Step3: through the callback, you can get all the performance data per interval.
- (void)captureOutputAppCPU:(float)appCPU systemCPU:(float)systemCPU appMemory:(float)appMemory gpuUsage:(float)gpuUsage gpuInfo:(NSString *)gpuInfo {
	NSLog(@"appMemory:%f", appMemory);
	NSLog(@"appCPU:%f", appCPU);
	NSLog(@"gpuUsage:%f", gpuUsage);
	NSLog(@"systemCPU:%f", systemCPU);
	NSLog(@"gpuInfo:%@", gpuInfo);
}

// Step4:if you want to stop capturing the performance data, use "stopTimer".
	[_moonLight stopTimer];

Test Result

The performance consumption of MoonLight is very low. It's almost negligible. App CPU, System CPU, App Memory and iOS GPU are the same as Instruments and the macOS GPU is the same as Activity Monitor.

MoonLight VS Instruments

  • iOS

avatar

  • macOS

avatar

Comment:CPU(MoonLight) = CPU(Instruments) / Core Num

The Perforamnce Consumption of MoonLight

Test case: Use Instruments, Open your app, enable MoonLight detection and get the performance data1. Than, open your app again, do not enable MoonLight detection and get the performance data2. And the performance consumption = data2 - data1.

  • iOS

App Memory = 7.38 - 7.34 = 0.04Mb, App CPU = (2.1%-0.1%)/ (6 core) = 0.33%, GPU = 0%.

Device: iPhone XS iOS14.2 , Core number: 6

  • macOS

App Memory = 14.42-14.36 = 0.06Mb, App CPU = (0.08% - 0.0%) / (4 core) = 0.02%, GPU = 0%.

Device: Macbook Pro 2017 13.3 Intel i5 , System: BigSur 11.0.1

Author

Echoo J

License

MoonLight is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].