Comments (11)
@capezzbr I found some low hanging fruit and picked it. It improves the speed by 4x.
Test on my emulator with 0.4.5:
02-17 10:07:12.581 26359-26359/? I/RESULT: LiquidCore run in 120ms
02-17 10:07:12.621 26359-26359/? I/RESULT: V8Runner run in 3ms
Test on my emulator with latest changes:
02-17 10:03:51.498 26239-26239/? I/RESULT: LiquidCore run in 38ms
02-17 10:03:51.529 26239-26239/? I/RESULT: V8Runner run in 3ms
Test with 0.4.5 on real hardware (Lenovo Tablet, API 23):
02-17 11:13:31.568 8094-8094/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 786ms
02-17 11:13:31.699 8094-8094/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 11ms
Test with changes on tablet (much better than 4x):
02-17 11:47:54.168 10264-10264/? I/RESULT: LiquidCore run in 170ms
02-17 11:47:54.258 10264-10264/? I/RESULT: V8Runner run in 10ms
Pixel, 0.4.5:
02-17 11:39:31.324 5993-5993/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 444ms
02-17 11:39:31.379 5993-5993/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 12ms
Pixel, latest:
02-17 11:37:39.979 5673-5673/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 166ms
02-17 11:37:40.044 5673-5673/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 14ms
It is checked in if you'd like to try it. Obviously LQ is still an order of magnitude slower. I will have to dig into the Java side to see if there are ways to reduce the overhead.
from liquidcore.
I've been thinking about this, though I haven't been able to dedicate time to it yet. jv8 also uses reflection, albeit at a much simpler level. Thanks for putting the project together. I will try put some time into it this weekend.
from liquidcore.
I have released version 0.4.6. Made some more big improvements. I can see some more opportunities for improvement, but it would require a pretty invasive re-write of the C++ code, so I will just leave that as a project for later. Latest tests with release version:
Emulator:
03-11 09:28:43.255 3820-3820/? I/RESULT: V8Runner run in 5ms
03-11 09:28:43.277 3820-3820/? I/RESULT: LiquidCore run in 10ms
Ancient Samsung Galaxy Nexus (API 18):
03-11 10:30:43.918 5423-5423/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 101ms
03-11 10:30:44.215 5423-5423/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 200ms
So, for this particular test, LiquidCore is still about half the speed as J2V8, but obviously much closer in performance.
Let me know if you have any issues with this version!
from liquidcore.
👋 @ericwlange, sorry for the bump, just wondering if you could think at a way I could improve the performances?
from liquidcore.
@ericwlange thanks for looking into that, let me know if I can help somehow, I'll be more than happy to test any future implementation 👍
from liquidcore.
@ericwlange wow, that looks promising. Just updated the app I'm working on to use com.github.LiquidPlayer:LiquidCore:master-SNAPSHOT
, and the speed improvements are definitely noticeably, great work 👏.
I will have to dig into the Java side to see if there are ways to reduce the overhead.
That would be awesome, I feel that if LQ would be as performant as jv8 I'll be definitely able to switch to use LQ in production, since it is way more stable and I like the fact that I can use almost the same API I'm using on the twin iOS app 👍 let me know if there is anything I could help with 🙏
from liquidcore.
Just a quick update on this. I found many sources of the slowness, and most all if it is related to reflection. I have a version that is twice as fast as the one I sent you last (not checked in yet), but there is still more to do. I will spend some time on it this weekend and let you know when something is ready to test.
from liquidcore.
That sounds fantastic, thanks again for looking into that 👍
from liquidcore.
Ok, please give the latest a try ...
My emulator:
03-04 12:19:18.477 16198-16198/? I/RESULT: V8Runner run in 4ms
03-04 12:19:18.511 16198-16198/? I/RESULT: LiquidCore run in 17ms
There is obviously still some difference between the two, but J2V8 is an incredibly thin (and hence, less feature-rich) wrapper around V8 so it will be difficult to achieve quite that level. I do think there is some more that I can do, but it will all be on the margin at this point. Can you see if this meets your needs? I will test it some more and put it into a release if you're satisfied.
Thanks!
from liquidcore.
Hey @ericwlange, just tested your latest improvements on the app I'm working on, and the performance improvement are fantastic 👏
There is obviously still some difference between the two, but J2V8 is an incredibly thin (and hence, less feature-rich) wrapper around V8 so it will be difficult to achieve quite that level.
That makes totally sense 👍
from liquidcore.
Hey @ericwlange thanks a lot for the hard work on investigating on those performance improvements 👏 Will definitely check out the new version soon and let you know if I find anything off 👍
from liquidcore.
Related Issues (20)
- Use jsexport methods in microservice js file
- How to build liquidcore-xxx-x.x.x.aar files? HOT 2
- use of undeclared identifier 'ftello'; did you mean 'ftell'?
- ArrayIndexOutOfBoundsException calling into javascript function
- Integrate with Android Studio via implementation
- Is there some way to choose which version of Node is used? HOT 1
- PLEASE correct your github package information HOT 2
- Cannot import liquidcore in java code HOT 1
- Fix like this please! Pass null value from JS to native causes an exception
- Can't figure out how to install modules please help HOT 1
- java.util.Set com.google.gson.JsonObject.keySet()
- How to better debug JS code in flutter environment
- String length limitations?
- Serious memory leak (Android liquidcore) HOT 4
- Android - zsh: parse error near `\n
- xcode build failed (iOS) HOT 4
- How can I get the running log? HOT 2
- Xcode build failed at LiquidCore-headers
- Running Angular / NodeJS app as standalone on macOS, iOS and Android
- BUILD FAILED in 16s
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquidcore.