https://github.com/nativescript/android-snapshot
Feeding the Android Runtime with V8 heap snapshots
https://github.com/nativescript/android-snapshot
Last synced: about 1 month ago
JSON representation
Feeding the Android Runtime with V8 heap snapshots
- Host: GitHub
- URL: https://github.com/nativescript/android-snapshot
- Owner: NativeScript
- License: other
- Created: 2016-04-22T07:48:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-15T10:16:58.000Z (over 8 years ago)
- Last Synced: 2024-10-29T15:51:55.236Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 66.2 MB
- Stars: 11
- Watchers: 39
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Deprecated
The plugin is now deprecated. V8 heap snapshot generation is now integrated with Webapck bundling being an optional optimization step after code bundling. We recommend migrating your apps to use `nativescript-dev-webpack`with enabled snapshot generation. More info on how to setup Webpack bundling in NativeScript you can find [here](https://docs.nativescript.org/tooling/bundling-with-webpack).
This repo provides tools to generate and distribute [V8 heap snapshot](https://v8project.blogspot.bg/2015/09/custom-startup-snapshots.html) packages of the [Core NativeScript](https://github.com/NativeScript/NativeScript) / [NativeScript+Angular](https://github.com/NativeScript/nativescript-angular) modules to reduce the startup time of the [NativeScript Android Runtime](https://github.com/NativeScript/android-runtime).
For more information follow [NativeScript#1563](https://github.com/NativeScript/NativeScript/issues/1563) and look at the [Android Runtime docs](https://docs.nativescript.org/runtimes/android/advanced-topics/V8-heap-snapshots).
## What You'll Find
* [`/bundler`](./bundler) - A JavaScript module bundler and tool to create snapshot packages.
* [`/plugin`](./plugin) - NativeScript plugin that downloads the correct snapshot package and prepares the app for using it.
## Getting Started
To install [the plugin](./plugin):
```shell
tns install android-snapshot
```
## Results
Startup time tested on a Nexus 5 device:
| Configuration | Core NativeScript | NativeScript+Angular |
| ------------------------- | ----------------: | ---------------------: |
| Non-bundled | 2350ms | 4000ms |
| Bundled | 2100ms | 3600ms |
| Bundled with snapshot | 1600ms | 2100ms |
## Requirements
* NativeScript CLI 2.1
* NativeScript Runtime for Android 2.1
## Limitations
* APK file size will be increased with 1.5MB (6MB with Angular).
* The installed application size will be increased with an additional 1.2MB (5MB with Angular).
* It is not possible to step into the embedded script from VS Code. You must use the CLI if you want to debug it.
* LiveSyncing may work in most cases, but is not officially supported.
* Snapshots are not compatible with the [NativeScript webpack plugin](https://github.com/NativeScript/nativescript-dev-webpack).