René's URL Explorer Experiment


Title: Enable modules snapshot for Android · Issue #1563 · NativeScript/NativeScript · GitHub

Open Graph Title: Enable modules snapshot for Android · Issue #1563 · NativeScript/NativeScript

X Title: Enable modules snapshot for Android · Issue #1563 · NativeScript/NativeScript

Description: The Story In a nutshell - since in Android application loading time is one of the areas that need improvement, we've made a POC implementation that takes advantage of V8's startup snapshots feature to see what may be achieved with it. Th...

Open Graph Description: The Story In a nutshell - since in Android application loading time is one of the areas that need improvement, we've made a POC implementation that takes advantage of V8's startup snapshots feature...

X Description: The Story In a nutshell - since in Android application loading time is one of the areas that need improvement, we've made a POC implementation that takes advantage of V8's startup snapshots...

Opengraph URL: https://github.com/NativeScript/NativeScript/issues/1563

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enable modules snapshot for Android","articleBody":"# The Story\n\nIn a nutshell - since in Android application loading time is one of the areas that need improvement,\nwe've made a POC implementation that takes advantage of V8's [startup snapshots](http://v8project.blogspot.bg/2015/09/custom-startup-snapshots.html) feature to see what may be achieved with it. The results are quite promising and we may gain literally more than **1 second !** of an improvement by saving all the modules.\n# Technical Details\n\nDue to the V8 API specifics, we need to bundle the entire modules JS into one single file and pass it to the [V8::CreateSnapshotDataBlob](http://v8.paulfryzel.com/docs/master/classv8_1_1_v8.html#a05f6c30582cc654b5fb09fab98a0dbbb) method. What V8 does when making the snapshot is to parse, compile and run this script into a new Context and then to save the state of the heap into a binary representation. Then, upon next application runs, this binary file may be used to load the whole representation of the modules directly within memory. \n\nHere is my proposal for taking advantage of this feature:\n# Distribute pre-generated BLOBs\n\nThe snapshot is CPU-architecture dependent. Hence, if we want to distribute pre-generated version of the snapshot we will need to package three files, saved against the three available architectures - `armeabi-v7a`, `x86` and `arm64-v8a`. The average size of one file is ~3 MB but it compresses very well and an archived version is about 400 KB. \n\n**This is the most efficient way performance-wise. It adds further optimization by skipping the extraction of numerous JS files initially**\n# Tasks:\n- [x] Ensure modules are snapshot-ready. This is already done - https://github.com/NativeScript/NativeScript/pull/1407\n- [x] Write a custom bundler that puts all the modules content within a single JS file. I've already done a custom Node task for the POC but we may go with [webpack](https://webpack.github.io/) for example (as @hdeshev) suggested.\n- [x] Think how to automate snapshot generation against the three CPU architectures.\n- [x] Think how to distribute (package) these three binary files. For example we may have two packages - `tns-core-modules` and `tns-core-modules-snapshot`. Or we may package all into one package.\n- [x] Since the debugger does not work with snapshots, we will need to rely on the snapshot for release builds ONLY. Hence, there will be some effort on the CLI side. Plus, for release builds the CLI should not pack the modules JavaScript files but only the BLOBs  (ping @teobugslayer, @ligaz).\n- [x] Enable the Android Runtime to consume such a BLOB directly, depending on the current CPU architecture. We may use the same convention as for the native part of the Runtime itself, for example:\n  \n  ```\n  tns_modules\n  ├── snapshot\n  │   ├── armeabi-v7a\n  │   │   ├── snapshot.blob\n  │   ├── arm64-v8a\n  │   │   ├── snapshot.blob\n  │   ├── x86\n  │   │   ├── snapshot.blob\n  \n  ```\n","author":{"url":"https://github.com/atanasovg","@type":"Person","name":"atanasovg"},"datePublished":"2016-02-16T16:56:25Z","url":"https://github.com/NativeScript/NativeScript/issues/1563"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fb45dc58-4fd9-7a0e-42be-7b9641fc15e4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD24C:38E318:F72F6B:1372F2C:6B014730
html-safe-nonceb9f1945e4fd9a7c18fb302a02101822045ba9e1680cd9d074084ec3264501b02
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjRDOjM4RTMxODpGNzJGNkI6MTM3MkYyQzo2QjAxNDczMCIsInZpc2l0b3JfaWQiOiI0MzE0MTMxODI4NDE3MDU0NTEyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac101d49a3b9d5014c50759fd9e8527d504a2a7686d25b95b9d0cda55085ab969a
hovercard-subject-tagissue:134034614
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/1563/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1012f072863d10223e36c68ae0ca45533d7cefba352f53d66b60de873b157bcc/NativeScript/NativeScript/issues/1563
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1012f072863d10223e36c68ae0ca45533d7cefba352f53d66b60de873b157bcc/NativeScript/NativeScript/issues/1563
og:image:altThe Story In a nutshell - since in Android application loading time is one of the areas that need improvement, we've made a POC implementation that takes advantage of V8's startup snapshots feature...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameatanasovg
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/issues/1563#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fissues%2F1563
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fissues%2F1563
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/issues/1563
Reloadhttps://github.com/NativeScript/NativeScript/issues/1563
Reloadhttps://github.com/NativeScript/NativeScript/issues/1563
NativeScripthttps://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Codehttps://github.com/NativeScript/NativeScript
Issues231 (231)https://github.com/NativeScript/NativeScript/issues
Pull requests107 (107)https://github.com/NativeScript/NativeScript/pulls
Discussionshttps://github.com/NativeScript/NativeScript/discussions
Actionshttps://github.com/NativeScript/NativeScript/actions
Projectshttps://github.com/NativeScript/NativeScript/projects
Wikihttps://github.com/NativeScript/NativeScript/wiki
Security and qualityhttps://github.com/NativeScript/NativeScript/security
Insightshttps://github.com/NativeScript/NativeScript/insights
https://github.com/NativeScript/NativeScript
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/NativeScript/issues/1563
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/NativeScript/issues/1563
Enable modules snapshot for Androidhttps://github.com/NativeScript/NativeScript/issues/1563#top
donehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22done%22
featurehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22feature%22
severity: highhttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22severity%3A%20high%22
2.1https://github.com/NativeScript/NativeScript/milestone/18
https://github.com/atanasovg
atanasovghttps://github.com/atanasovg
on Feb 16, 2016https://github.com/NativeScript/NativeScript/issues/1563#issue-134034614
startup snapshotshttp://v8project.blogspot.bg/2015/09/custom-startup-snapshots.html
V8::CreateSnapshotDataBlobhttp://v8.paulfryzel.com/docs/master/classv8_1_1_v8.html#a05f6c30582cc654b5fb09fab98a0dbbb
Atanasovg/snapshot refactorings #1407https://github.com/NativeScript/NativeScript/pull/1407
webpackhttps://webpack.github.io/
@hdeshevhttps://github.com/hdeshev
@teobugslayerhttps://github.com/teobugslayer
@ligazhttps://github.com/ligaz
Nexthttps://github.com/NativeScript/NativeScript/issues/1563?timeline_page=1
atanasovghttps://github.com/atanasovg
severity: highhttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22severity%3A%20high%22
featurehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22feature%22
on Feb 16, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-552306804
atanasovghttps://github.com/atanasovg
on Feb 16, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-552306818
https://github.com/NathanaelA
NathanaelAhttps://github.com/NathanaelA
on Feb 17, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-185340695
https://github.com/x4080
x4080https://github.com/x4080
on Feb 19, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-186136060
https://github.com/vjoao
vjoaohttps://github.com/vjoao
on Feb 20, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-186607047
https://github.com/fealebenpae
fealebenpaehttps://github.com/fealebenpae
on Feb 20, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-186660681
https://github.com/NathanaelA
NathanaelAhttps://github.com/NathanaelA
on Feb 21, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-186705929
atanasovghttps://github.com/atanasovg
on Feb 22, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-559491741
atanasovghttps://github.com/atanasovg
backloghttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22backlog%22
on Feb 22, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-559491835
https://github.com/borovaka
borovakahttps://github.com/borovaka
on Mar 22, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-199710585
@atanasovghttps://github.com/atanasovg
https://github.com/atom/node-mksnapshothttps://github.com/atom/node-mksnapshot
https://github.com/jasssonpet
jasssonpethttps://github.com/jasssonpet
on Apr 11, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-208331406
Sourcehttps://github.com/hdeshev/bundle-test/blob/a73dc048fe4ac3896a5b8622125701c0f1602b4e/app/app.component.ts
Sourcehttps://github.com/NativeScript/nativescript-angular/blob/c2224b9d6f0f94a7ff3b27018b7fb58b40d30d32/ng-sample/app/examples/renderer-test.ts
patchhttps://gist.github.com/anonymous/fa490f821d3a86c36bf6cb7fd2b536b5
webpackhttps://webpack.github.io/
mksnapshothttps://github.com/NativeScript/android-v8/blob/4.7.80/src/snapshot/mksnapshot.cc#L156
nw-snapshothttps://github.com/nwjs/v8/blob/nw12/src/nwjc.cc#L78
CPUFeatures::Probe(bool cross_compile)https://github.com/NativeScript/android-v8/blob/4.7.80/src/assembler.h#L206
Octane benchmark on NativeScripthttps://gist.github.com/jasssonpet/20ab386d34a6f89cad0a
this patchhttps://github.com/NativeScript/android-v8/commit/e205c1c19e163b50f71642b3a113ab343ee131ab
WarmUpSnapshotDataBlob()https://github.com/NativeScript/android-v8/commit/f507bc1c7242d338b04d6bba5ea78cbb42cf0e13
herehttps://github.com/NativeScript/android-runtime/compare/jasssonpet/warmup-snapshot?expand=1
V8 ARM/ARM64 simulatorhttps://github.com/v8/v8/wiki/Cross-compiling-for-ARM#building-using-scons-with-snapshot
nativescript-angular-snapshothttps://github.com/NativeScript/nativescript-angular-snapshot
nativescript-angularhttps://github.com/NativeScript/nativescript-angular
tns-core-moduleshttps://github.com/NativeScript/NativeScript
ng-todo samplehttps://github.com/NativeScript/sample-ng-todomvc
groceries samplehttps://github.com/NativeScript/sample-Groceries/tree/angular-end
NativeScript#2031https://github.com/NativeScript/NativeScript/pull/2031
@atanasovghttps://github.com/atanasovg
@KristinaKoevahttps://github.com/KristinaKoeva
https://github.com/NathanaelA
NathanaelAhttps://github.com/NathanaelA
on Apr 11, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-208353455
jasssonpethttps://github.com/jasssonpet
on Apr 27, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-642797536
Update package.jsonhttps://github.com/NativeScript/tns-core-modules-widgets/commit/d666343d50e11e6ef6bf907e6d63909ab3636f89
d666343https://github.com/NativeScript/tns-core-modules-widgets/commit/d666343d50e11e6ef6bf907e6d63909ab3636f89
https://github.com/jasssonpet
jasssonpethttps://github.com/jasssonpet
on Apr 28, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-215450385
https://github.com/NativeScript/android-snapshothttps://github.com/NativeScript/android-snapshot
https://github.com/jasssonpet
jasssonpethttps://github.com/jasssonpet
on May 5, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-217134785
@x4080https://github.com/x4080
https://github.com/x4080
x4080https://github.com/x4080
on May 5, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-217290846
https://github.com/jasssonpet
jasssonpethttps://github.com/jasssonpet
on May 13, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-219070279
mksnapshot toolhttps://github.com/NativeScript/android-v8/blob/4.7.80/tools/gyp/v8.gyp#L2072-L2095
jasssonpethttps://github.com/jasssonpet
in progresshttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22in%20progress%22
backloghttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22backlog%22
on May 25, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-671573734
jasssonpethttps://github.com/jasssonpet
2.1https://github.com/NativeScript/NativeScript/milestone/18
on May 25, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-671581645
jasssonpethttps://github.com/jasssonpet
ready for testTSC needs to test this and confirm against live production apps and automated test suiteshttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22ready%20for%20test%22
in progresshttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22in%20progress%22
on Jun 16, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-694318163
hshristovhttps://github.com/hshristov
completedhttps://github.com/NativeScript/NativeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 1, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-710129909
https://github.com/NathanaelA
NathanaelAhttps://github.com/NathanaelA
on Jul 1, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-230005472
https://github.com/jasssonpet
jasssonpethttps://github.com/jasssonpet
on Jul 2, 2016https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-230100412
@NathanaelAhttps://github.com/NathanaelA
https://github.com/NativeScript/android-snapshothttps://github.com/NativeScript/android-snapshot
https://www.npmjs.com/package/nativescript-dev-android-snapshothttps://www.npmjs.com/package/nativescript-dev-android-snapshot
https://github.com/NativeScript/android-runtime-docs/blob/master/advanced-topics/V8-heap-snapshots.mdhttps://github.com/NativeScript/android-runtime-docs/blob/master/advanced-topics/V8-heap-snapshots.md
vchimevhttps://github.com/vchimev
donehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22done%22
ready for testTSC needs to test this and confirm against live production apps and automated test suiteshttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22ready%20for%20test%22
on Aug 31, 2016https://github.com/NativeScript/NativeScript/issues/1563#event-773247714
https://github.com/apps/lock
lockhttps://github.com/apps/lock
on Aug 29, 2019https://github.com/NativeScript/NativeScript/issues/1563#issuecomment-526271493
lockhttps://github.com/apps/lock
on Aug 29, 2019https://github.com/NativeScript/NativeScript/issues/1563#event-2594678719
Sign up for freehttps://github.com/signup?return_to=https://github.com/NativeScript/NativeScript/issues/1563
Sign in to commenthttps://github.com/login?return_to=https://github.com/NativeScript/NativeScript/issues/1563
donehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22done%22
featurehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22feature%22
severity: highhttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22severity%3A%20high%22
2.1https://github.com/NativeScript/NativeScript/milestone/18
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.