Userland: Debian and Ubuntu command line usage is slow

Created on 23 Nov 2018  路  5Comments  路  Source: CypherpunkArmory/UserLAnd

My problem

First, thanks a lot for that incredible initiative :slightly_smiling_face: .

I'm a heavy user of Termux. I do Web development locally on my Samsung S8. In comparison, a UserLand Debian or Ubuntu instance is a lot slower. For instance, doing a yarn install is more than 10x faster with a 4G connection using Termux than using UserLand. But it's not only the network that is slow : yarn start (which compiles the JS files with Webpack) is also ~5 times slower. I can run more precise benchmarks if that helps.

Is that expected ? What's the difference between Termux and a debian UserLand that makes such a big performance difference ? Is it an optimization problem specific to my device ?

I could not try Samsung Linux on Dex yet, but it could be a good third element in the benchmark.

Device Information

Device: Samsung Galaxy S8 Exynos version
Android Version: Oreo
UserLAnd Version: 1.0.1
Additional context : I'm using UserLand in Dex mode.

Most helpful comment

When running in UserLAnd or in Ubuntu under termux, you are running everything attached to PRoot. PRoot is expensive to start with, but PRoot also supports extensions. It is probably something we are doing in our extensions different than termux which is causing worse performance. My goal was to get everything working and then double back and improve performance. We are getting close that that time. I think the main issue is we emulate a multiuser system more completely. I am certain there is something we can do here, but not sure the tradeoffs yet.

All 5 comments

I also noticed this, except that it's not limited to command line. When compared to the ubuntu installed through termux, userland is significantly slower. I first noticed it while installing the packages but it's also slower running X. It takes 2-4 times as long to open a big app (inkscape, gimp, libreoffice) in userland.
Why the difference? What is different?
I would really like for this to be fixed, if possible, as userland has the best /proc support on Oreo and is the only proot environment where I have managed to run the libreoffice.

@corbinlc can provide a better explanation than I can. The gist of it, however, is that we're simply doing more than Termux is to a provide a true multi-user environment emulation. We have more extensions active in PRoot which causes some of this slow-down.

When running in UserLAnd or in Ubuntu under termux, you are running everything attached to PRoot. PRoot is expensive to start with, but PRoot also supports extensions. It is probably something we are doing in our extensions different than termux which is causing worse performance. My goal was to get everything working and then double back and improve performance. We are getting close that that time. I think the main issue is we emulate a multiuser system more completely. I am certain there is something we can do here, but not sure the tradeoffs yet.

It's great that it's actively being worked on / considered. Feature - wise, the userland environment is trully the best. While your level of support for a true multi-user system is great (sudo is working as it should) and is an extremely commendable acheavement, in everyday use I didn't see much difference from the termux implementation. There I can also 'su' to a nonprivilaged user to run tigervnc (can't sudo back as easily, though). For me, that difference is not worth the very significant speed penalty. The better /proc bind, on the other hand is worth it as it allows me to run programs I otherwise wouldn't be able to (LibreOffice). I am amazed that I can run desktop programs on my phone and that they actually run faster than on my i5 iMac (mostly due to a much faster storage but even the cpu benchmarks compare favourably). My phone is actually faster than my 5y old desktop (on termux). Speed optimisation is important as this is no longer a cool gimmick but a viable alternative to a linux notebook.

This is much improved for new filesystems only. It involved a major PRoot change that is not compatible with the version being used previously. We are going to create a path for migrating through major PRoot changes in the not so distant future. But, the performance is much better now. Probably about as good as it will get.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RonCan picture RonCan  路  7Comments

mkevinam picture mkevinam  路  4Comments

ghost picture ghost  路  7Comments

JohnWang1023 picture JohnWang1023  路  4Comments

MaffSi picture MaffSi  路  9Comments