react-native-v8 icon indicating copy to clipboard operation
react-native-v8 copied to clipboard

feature request: support bytecode bundles

Open noomorph opened this issue 4 years ago • 3 comments

Hi, @Kudo!

First of all, thank you for your hard and useful work.

I was wondering if there is a way to make your V8 fork of RN generate and consume bytecode bundles instead of parsing plain JS text bundles, to speed up cold launch time?

If there is one, I'm sorry for asking something obvious, but could you point to an example of how to set this up?

I have on my mind things like bytenode, v8-compile-cache and code caching article. However, I'm not deep into this subject, but I hope I managed to convey what I mean.

noomorph avatar Jul 10 '19 09:07 noomorph

For bytecode caching, should find a chance to call V8's CreateCodeCache() to generate the cache and load the CacheData accordingly.

For V8 snapshot (which may like the bytecode bundle), my thought is about to use V8's mksnapshot to convert plain JS text into native bytecode format. However, it may need to modify more RN internal code. This is in my plan and will have a time to do this experiment.

Kudo avatar Jul 10 '19 11:07 Kudo

Hey @Kudo, cold start time is a big concern for us right now, is there any way we can help move this issue along? Even if we could just run an experiment/benchmark to see if bytecode caching is worth implementing into react-native-v8.

sirsavary avatar Apr 10 '20 20:04 sirsavary

1+ for this

arasrezaei avatar Oct 28 '21 09:10 arasrezaei