GithubHelp home page GithubHelp logo

Comments (11)

ericwlange avatar ericwlange commented on May 11, 2024 2

@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.

ericwlange avatar ericwlange commented on May 11, 2024 1

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.

ericwlange avatar ericwlange commented on May 11, 2024 1

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.

capezzbr avatar capezzbr commented on May 11, 2024

👋 @ericwlange, sorry for the bump, just wondering if you could think at a way I could improve the performances?

from liquidcore.

capezzbr avatar capezzbr commented on May 11, 2024

@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.

capezzbr avatar capezzbr commented on May 11, 2024

@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.

ericwlange avatar ericwlange commented on May 11, 2024

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.

capezzbr avatar capezzbr commented on May 11, 2024

That sounds fantastic, thanks again for looking into that 👍

from liquidcore.

ericwlange avatar ericwlange commented on May 11, 2024

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.

capezzbr avatar capezzbr commented on May 11, 2024

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.

capezzbr avatar capezzbr commented on May 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.