https://github.com/nativescript/sample-ios-profiling
Performance comparison of popular cross-platform frameworks
https://github.com/nativescript/sample-ios-profiling
Last synced: about 1 month ago
JSON representation
Performance comparison of popular cross-platform frameworks
- Host: GitHub
- URL: https://github.com/nativescript/sample-ios-profiling
- Owner: NativeScript
- Created: 2015-05-26T12:04:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-10T12:09:58.000Z (over 9 years ago)
- Last Synced: 2024-10-29T15:51:53.092Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://www.nativescript.org
- Size: 980 KB
- Stars: 29
- Watchers: 43
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iOS
### Scrolling UITableView
A constantly scrolling UITableView. Has different row heights. Has custom cells with recycling, three UILabels in each cell. Objective-C code implementation is compared with the same JavaScript code in NativeScript for iOS. The apps were designed to keep constant 60 FPS.
Projects:
- _iOS/TNSScriptList_ - Objective-C implementation
- _iOS/TNSNativeList_ - NativeScript for iOS implementation (without modules)
- _iOS/TNSCrossList - NativeScript for iOS implementation (with modules)
For the _TNSScriptList_ app you will have to execute `tns platform add ios`, `tns prepare ios` and use the generated Xcode project in `platforms\ios`.
The CPU and GPU samples are taken with the Xcode instruments. Open the Xcode projects go to Product > Profile. The Memory usage is recorded in Xcode with the projects built in Release. The
The device used is iPhone 5S with iOS8.1.3
#### Native (Objective-C)
- Memory: ~6.4MB
- CPU Activity: 31.3% Foreground, ~27% Graphics
- GPU Driver FPS: ~59
#### NativeScript without modules (NativeScript for iOS)
- Memory: ~13MB and raises to flat at 48MB
- CPU: 38% Foreground, ~27% Graphics
- GPU Driver FPS: ~59
#### NativeScript with modules (NativeScript for iOS + Cross Platform Modules)
- Memory: ~27.5MB
- CPU Activity: 39% Foreground, ~17% Graphics
- GPU Driver FPS: ~59
#### XamarinList (Xamarin application without Xamarin.Forms)
- Memory: ~19MB (Instruments > Allocation > Persistent)
- CPU Activity: 35.5% Foreground, ~27% Graphics
- GPU Driver FPS: ~59
#### Summary
Overall the additional memory consumed is due to the JS heap and the way JavaScript objects retain the native Objective-C objects.
At such a simple scenario the modules does not add excessive overhead, they even add the benefit of clipping the content under the status bar for you, and use somewhat smaller CPU Activity: Graphics processing.
The CPU usage with NativeScript for iOS is about 21% higher than using pure Objective-C.