Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bananas compile time with termux #22671

Open
0dminnimda opened this issue Oct 27, 2024 · 3 comments
Open

Bananas compile time with termux #22671

0dminnimda opened this issue Oct 27, 2024 · 3 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@0dminnimda
Copy link
Contributor

0dminnimda commented Oct 27, 2024

Describe the bug

I've cloned the repo and ran make. After that followd the tutorial. The compile times were quite disappointingly long.

module main

import vweb
import time

struct App {
	vweb.Context
}

fn main() {
	app := App{}
	vweb.run(app, 8081)
}

fn (mut app App) time() vweb.Result {
	return app.text(time.now().format())
}

@['/index']
pub fn (mut app App) index() vweb.Result {
    message := 'Hello, world from Vweb!'
	return $vweb.html()
}

->

$ time v src/main.v

real    0m5.025s
user    0m4.244s
sys     0m0.834s

After that I investigated. And even the hello world takes some time to compile.

fn main() {
    println('hello world')
}

->

$ time v src/hello.v

real    0m1.608s
user    0m1.271s
sys     0m0.336s

And cold cache is not the problem, those are the following compilations

$ time v src/hello.v

real    0m1.574s
user    0m1.257s
sys     0m0.336s
$ time v src/hello.v -stats
        V  source  code size:      16937 lines,     449893 bytes,   145 types,     5 modules,    62 files
generated  target  code size:      13470 lines,     445970 bytes
compilation took: 1532.703 ms, compilation speed: 11050 vlines/s

real    0m1.569s
user    0m1.237s
sys     0m0.353s

Using tcc from pkg install tcc does not seem to help much:

$ time v src/hello.v -cc tcc

real    0m1.569s
user    0m1.244s
sys     0m0.358s

Though when I symlink tcc executable into v/thirdparty/tcc/tcc.exe compile times are much better

time v src/hello.v

real    0m0.215s
user    0m0.197s
sys     0m0.054s

But unfortunaly it seems to break when gc is needed:

$ time v src/main.v

real    0m0.861s
user    0m0.558s
sys     0m0.352s
$ ./src/main
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/home/.../src/main": library "libgc.so" not found: needed by main executable

After I export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib:$LD_LIBRARY_PATH another error shows up:

$ ./src/main
CANNOT LINK EXECUTABLE "./src/main": cannot locate symbol "__builtin_nanf" referenced by "/data/data/com.termux/files/home/.../src/main"...

Now I don't think I can do much here.

Reproduction Steps

shown above

Expected Behavior

Faster compilation time

Current Behavior

Slow compilation time

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.8 e59115e

Environment details (OS name and version, etc.)

Linux localhost 5.10.101-android12-9-00001-g1b6eff567cae-ab8943976 #1 SMP PREEMPT Sat Aug 13 08:16:31 UTC 2022 aarch64 Android
termux

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Huly®: V_0.6-21120

@0dminnimda 0dminnimda added the Bug This tag is applied to issues which reports bugs. label Oct 27, 2024
@phcreery
Copy link
Contributor

What is the output of v -showcc src/main.v and v doctor?

@0dminnimda
Copy link
Contributor Author

0dminnimda commented Nov 1, 2024

v doctor output:

V full version: V 0.4.8 e59115e
OS: termux, 5.10.101-android12-9-00001-g1b6eff567cae-ab8943976, #1 SMP PREEMPT Sat Aug 13 08:16:31 UTC 2022
Processor: 8 cpus, 64bit, little endian

getwd: /data/data/com.termux/files/home
vexe: /data/data/com.termux/files/home/repos/v/v
vexe mtime: 2024-10-27 15:44:08

vroot: OK, value: /data/data/com.termux/files/home/repos/v
VMODULES: OK, value: /data/data/com.termux/files/home/.vmodules
VTMP: OK, value: /data/data/com.termux/files/usr/tmp/v_10207                                                                                             

Git version: git version 2.47.0
Git vroot status: weekly.2024.43-44-ge59115ed (42 commit(s) behind V master)
.git/config present: true

CC version: clang version 19.1.2
thirdparty/tcc status: thirdparty-unknown-unknown de82a130

@0dminnimda
Copy link
Contributor Author

v -showcc src/main.v prints:

> C compiler cmd: 'cc' '@/data/data/com.termux/files/usr/tmp/v_10207/main.01JBMW11P3KHMVXYHBB9FHEPZY.tmp.c.rsp'
> C compiler response file "/data/data/com.termux/files/usr/tmp/v_10207/main.01JBMW11P3KHMVXYHBB9FHEPZY.tmp.c.rsp":
  "/data/data/com.termux/files/home/.vmodules/.cache/10/10727db8001bc580f36609b204eba4c9.module.json.o" "/data/data/com.termux/files/home/.vmodules/.cache/9a/9ab4a84a8caf6a8847911ca168323a84.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/fb/fb7ffdd1468a2dcf7a65f3c58cb303ca.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/e1/e1d40eb484e68b4d04d12a7a2e183c00.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/df/df0c39ba2b3f7eb979b607a196b158e6.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/31/31cf08b7adacded76d23bd785e3a5d99.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/e0/e0605d51da04e4366b9f86e9bb635622.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/06/06a397a3b312d3c6db177e3e82d61b68.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ce/cefe1bed19fbeb9fe2b30707203aaf30.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/09/098b9f6691c2925da30b4de3d5cc6832.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/71/71dab4af050f1387797a868a0578b241.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/b1/b1db69bc07c4499f7a760bd65c6cf557.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/0a/0a70b2eaf4ebd0e0d487d3452ac4bb6c.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/df/df7694eeac36078b86ffa32214cd078d.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ad/ad320eb8d5ff3bc7b00c31d73cd077c4.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/0e/0ed314f879bf6928372ea0c3256230a6.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/5d/5d6e44f74b6d389000faea5e57f554f9.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/c1/c1a92548d9ae481eebafdb95e31bb704.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/53/53b7572ce4db28841db7d5b55854aeb9.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/af/af059085e0ffac6007a580380ce9b439.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/54/5482932279d7f64be003900cf863556f.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/06/0687821540e7c77ee49bc4a1e83d1433.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/c0/c0c44a3f97a91c464ef1def26da1c963.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/41/41ba91ca7bbda8741a1cc3b7ff799175.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/27/279d73a59c9a9fbc4c2fda5ba62bcfbc.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/4b/4b0fb61a36cb766f536f7b3913c25fcf.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ac/ac700d925ead4e83d7f5ae00afbf0d0a.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/f8/f84b6c300df6b6cee189dcdf8fcb1342.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/1b/1b8c677af427feff56ed4795703b5116.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/5a/5a305b51d9326b60a9e2c148e824e026.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/9c/9caac239eaa1e031dae1a323d7c81b97.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/d8/d891bf72d4d5a581a6cae78fba406b8e.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/16/16441ef6d29c492445ed5f468f497a56.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/7d/7deb41844ab5660530c50deb32573e72.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/20/20d18b30bd6c5a7fc68e6ebb598eddd9.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/e4/e4ad656f785593c53916b8d5b5e384ee.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/02/021d62f6d71e5d36db162fded6a5f194.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/7d/7d995611cc8315bfd37695e8f9da6008.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ac/ace17e9b37612a81ed2af31921870805.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/81/81a72dce19bcbe6d24ee1bfa186c3bf6.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/58/584a35b2a81560c740309e7a288ca664.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/6d/6de895503fb4e7d29873358177d9a0ca.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/4e/4e6bd300945ee32868f05781ba396ce5.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/b7/b78abc1568cc6a57130e68df4eae26e5.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/70/70c979a2e44857133112d87e9a71ee73.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ab/ab541bc32c2f118fa8bbf9e388b40fae.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/0e/0ea92cde9f668e0def2d004200f8b143.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/e8/e83b69f4e2150e9777f6cc2ad426c539.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/79/794e44d511691b7b2dfbb5d2e6f81fe9.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/3f/3f5fcc75892be6b8c3433b1f3b332eff.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/68/689540ee874b5dd4fc131dcb5f4cad46.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/5f/5f6f2619490a1a739a0607e9dc5f107b.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ef/ef0e8ec539441a279ff35142ae6b72fe.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/73/73663962057806fa17a6801f581333b8.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/da/da75c71b31628dcbe06580cf5a8a0709.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/7f/7fb003f34b98588de15daae275b2699a.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/a4/a4cea994361b773c83df516e8182c35c.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/3a/3adfff34d8ef32dffac5969493433242.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/c3/c30377494bb7d2df0ac8847d69e805a1.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/51/5121c7d3a5d1737af58b62d6cd2c21e7.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/f2/f24193db6d39012d7e47afd7ecd864ad.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/6b/6b4320348e4083ecedef81323d324a22.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/1e/1e4ef66beaf578f248c1cb77e819cfc4.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ed/ed2de16e7fbd98ccd96b0c03c3d7af5a.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/6d/6db897bd31eacdbca014b241f5f577ef.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/61/613a3350648eb76c25feb8a6311b8f80.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/10/10e9226b3a4ad26b84787678afc9f2ba.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/d4/d413a8b0231a2c812cde44570c5501cf.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/1b/1b2d8c2ff050eb7afca3e15b5286d2e1.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/a3/a325d5a012f37b61e29b964d4d0a0ab6.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/05/0512df64f2e2a01fc8a9c51126e12275.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/bd/bd6ebfcd7de3a3ee8ec128b35d003dd5.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ce/cec217f36300a23e0bbe9f7ac3b4d068.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/f0/f07c16f1a9f16d786954844846b73bba.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/b8/b82984aefca6a0717040e7dcab9069ab.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/27/27e2f7ca6efcdb7baecda5f26f042281.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/50/509dee0a79a7d63043032b278c78c0b2.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/1b/1b1c67a92978544c802133f366ceb47b.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/2a/2a96e16c05804215c91baeb575ec200a.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/91/91861b068548a8d8bde1a0701640f8d4.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/c0/c074441b62d66020d14e180faa79aa23.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/c4/c40ea40c6a9d46daf05b4e69e9d0f7ca.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/4b/4bc2a9be0d3209ec979fb93692c58ca0.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/84/8440c700147de744a607bb945b4de73f.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/66/6654a3b9483ab8496ead063a6d08770b.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/05/053acf9eb6d7dc48b57bbf8402298745.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/d3/d37c3800deaaa4f38a9437e8b7bd3a7d.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/13/13d0728bd3aba8a48d0b72a596689407.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/4c/4cfcca8bd5ffefe38429aa9a8c8c6592.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/57/57b7acd04af4cf9054ec190c6f0225ae.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/de/deef35933c9b173a7be6edfd0836af1e.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ed/ed35f5bf11e26a7294c65c490abff25d.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/7b/7b1fb58e8eb8bec6bbff195e4323967b.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/11/117e9e60d9f7e32e5bdfd2bcb365fcf6.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/bc/bc452f30418f8ca1bbe8e72d65459b18.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/ba/ba748ec9a069443adbc749551c008012.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/a9/a9ef5c1db2648a4d6fceb44292c6c369.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/13/13f8e86c850bbc53cb87df72af9782c4.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/b3/b33b7f1228e6d676eb6f856df6a1fd0b.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/b2/b205cb410ea0909f9ed21a9c2a8b8fe7.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/62/62f311968843cfa22e04741abb64e7a0.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/d2/d2cbfc8bfdf21aafabe10cc8839dd135.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/55/55b3851e75aca1a2aa7bf5eefa831b53.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/92/92fd22e6e8fb5f70365111885e2b13a9.module.net.mbedtls.o" "/data/data/com.termux/files/home/.vmodules/.cache/2c/2cf519a30631d3df6370526437bbad33.module.net.mbedtls.o" -o "/data/data/com.termux/files/home/test_v/src/main" -D GC_THREADS=1 -D GC_BUILTIN_ATOMIC=1 -I "/data/data/com.termux/files/home/repos/v/thirdparty/cJSON" -I "/data/data/com.termux/files/home/repos/v/thirdparty/stdatomic/nix" -I "/data/data/com.termux/files/home/repos/v/thirdparty/mbedtls/library" -I "/data/data/com.termux/files/home/repos/v/thirdparty/mbedtls/include" -I "/data/data/com.termux/files/home/repos/v/thirdparty/mbedtls/3rdparty/everest/include" -I "/data/data/com.termux/files/home/repos/v/thirdparty/mbedtls/3rdparty/everest/include/everest" -I "/data/data/com.termux/files/home/repos/v/thirdparty/mbedtls/3rdparty/everest/include/everest/kremlib" "/data/data/com.termux/files/usr/tmp/v_10207/main.01JBMW11P3KHMVXYHBB9FHEPZY.tmp.c" -std=c99 -D_DEFAULT_SOURCE -lgc -lpthread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants