v icon indicating copy to clipboard operation
v copied to clipboard

This code is in time out

Open b-bruno opened this issue 2 years ago • 10 comments

V doctor:

V full version: V 0.4.5 24af002.20fd795
OS: linux, "Arch Linux"
Processor: 8 cpus, 64bit, little endian, 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz

getwd: /home/bruno/Documents/Dev/V
vexe: /home/bruno/Téléchargements/v/v
vexe mtime: 2024-04-20 10:34:12

vroot: OK, value: /home/bruno/Téléchargements/v
VMODULES: OK, value: /home/bruno/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.44.0
Git vroot status: weekly.2024.16.1-20-g20fd795b (1 commit(s) behind V master)
.git/config present: true

CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5

What did you do? v run edigit.v 250001

Tested from this bench source : https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/edigits/1.v

What did you expect to see?

n (fish: Job 1, './edigit 250001' terminated by signal SIGKILL (Force to quit))

What did you see instead?

3168427472	:168110
7650606466	:168120
6718600137	:168130
0704927405	:168140
0011212395	:168150
9226548517	:168160
2912147784	:168170
0523153801	:168180
5835652547	:168190
3067609608	:168200
6150407445	:168210
4791937856	:168220
1640700638	:168230
1393893601	:168240
1467305470	:168250
6727596822	:168260
0685527416	:168270
2392937851	:168280
8038323760	:168290
5854728325	:168300
1656492206	:168310
8169034179	:168320
8795437061	:168330
9195956458	:168340
4781683172	:168350
9889146105	:168360
2667199748	:168370
1102891149	:168380
8530875725	:168390
6515826828	:168400
7022313035	:168410
2203928541	:168420
9867659582	:168430
5273063378	:168440
0229549466	:168450
0644956226	:168460
5989585451	:168470
0858684033	:168480
4394693907	:168490
0246045022	:168500
4658313082	:168510
8810070153	:168520
5744737554	:168530
3554251955	:168540
7181842983	:168550
2169366719	:168560
6521477692	:168570
0678198616	:168580
8217714329	:168590
5332066657	:168600
8134949373	:168610
0152061703	:168620
6183515312	:168630
6070353325	:168640
2651301515	:168650
8430548265	:168660
5080805719	:168670
4108959465	:168680
2675903720	:168690
3096846464	:168700
6577032873	:168710
7023261791	:168720
6695725703	:168730
0515219105	:168740
6947912116	:168750
3942045968	:168760
1170989290	:168770
9506885081	:168780
1264695494	:168790
9038914253	:168800
0786635150	:168810
6469166843	:168820
3200712166	:168830
6646417972	:168840
3678198130	:168850
8123257761	:168860
8147686118	:168870
1736442192	:168880
8240348075	:168890
5425952932	:168900
6423909401	:168910
8679675723	:168920
0646419640	:168930
0083625622	:168940
3692542658	:168950
4899434258	:168960
....
...


> [!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.

b-bruno avatar Apr 20 '24 11:04 b-bruno

Try v up. It works for me on Manjaro with latest V:

...
6478007018      :24880
2766336227      :24890
9781045463      :24900
3113129404      :24910
4833570134      :24920
8695851652      :24930
6745951518      :24940
7680033395      :24950
5224105481      :24960
8176786777      :24970
2152798270      :24980
2501171958      :24990
1657760354      :25000
9               :25001[jalon@7950x ~]$ 

JalonSolov avatar Apr 20 '24 14:04 JalonSolov

Hello,

i use the last version V 0.4.5 24af002.20fd795, I need to update again?

Thanks

b-bruno avatar Apr 20 '24 14:04 b-bruno

Yes, you need to update again.

Delta456 avatar Apr 20 '24 14:04 Delta456

Latest V is V 0.4.5 a1497c0. Your version is from 3 weeks ago, and is 132 commits behind the current.

Since V is still changing often, it is always best if you see an error to immediately do v up then check again. It may have already been fixed.

JalonSolov avatar Apr 20 '24 14:04 JalonSolov

image In my arch linux, it's always a same problem

b-bruno avatar Apr 20 '24 17:04 b-bruno

Latest V is V 0.4.5 a1497c0. Your version is from 3 weeks ago, and is 132 commits behind the current.

Since V is still changing often, it is always best if you see an error to immediately do v up then check again. It may have already been fixed.

I launch "v up" 3x or 4x times by day, so it's strange ;)

b-bruno avatar Apr 20 '24 17:04 b-bruno

That screenshot is too dark for me to read, so I'm not sure what you're saying is the problem, there.

JalonSolov avatar Apr 20 '24 18:04 JalonSolov

250001

Please try with 250001 not

Try v up. It works for me on Manjaro with latest V:

...
6478007018      :24880
2766336227      :24890
9781045463      :24900
3113129404      :24910
4833570134      :24920
8695851652      :24930
6745951518      :24940
7680033395      :24950
5224105481      :24960
8176786777      :24970
2152798270      :24980
2501171958      :24990
1657760354      :25000
9               :25001[jalon@7950x ~]$ 

Please try with 250001, on your capture you miss one 0

b-bruno avatar Apr 20 '24 19:04 b-bruno

How much RAM do you have? I did start it with the higher number, and let it run for a couple of hours... still no output.

So I checked free memory, and saw it going down bit-by-bit over time. That's what happens with recursive routines like you have.

However, Ctrl-C stopped it immediately, no problem.

So I tried running with different numbers.

With 30000, I saw

0187500302      :30000

real    0m3.528s
user    0m3.544s
sys     0m0.044s

With 50000, it got much worse... as it in has been running over an hour, and hasn't finished, yet.

$ time v run edigit.v 50000
^CTerminated by signal  2 (SIGINT)

real    79m28.884s
user    79m19.146s
sys     0m6.845s
$

Quite a jump from 3.5 minutes to 1 hour 19 1/2 minutes for only 20000 more...

JalonSolov avatar Apr 21 '24 02:04 JalonSolov

How much RAM do you have? I did start it with the higher number, and let it run for a couple of hours... still no output.

So I checked free memory, and saw it going down bit-by-bit over time. That's what happens with recursive routines like you have.

However, Ctrl-C stopped it immediately, no problem.

So I tried running with different numbers.

With 30000, I saw

0187500302      :30000

real    0m3.528s
user    0m3.544s
sys     0m0.044s

With 50000, it got much worse... as it in has been running over an hour, and hasn't finished, yet.

$ time v run edigit.v 50000
^CTerminated by signal  2 (SIGINT)

real    79m28.884s
user    79m19.146s
sys     0m6.845s
$

Quite a jump from 3.5 seconds to 1 hour 19 1/2 minutes for only 20000 more...

I have 16G ram , but go version is executed instantly, see time Executed in 234.57 millis fish external usr time 230.67 millis 197.00 micros 230.47 millis sys time 80.87 millis 59.00 micros 80.81 millis

You can check here ; https://programming-language-benchmarks.vercel.app/problem/edigits

b-bruno avatar Apr 21 '24 02:04 b-bruno