#fast2.v

1 messages Β· Page 3 of 1

hushed plank
#

my Dockerfoo is lacking

shrewd jackal
#

so the previous steps should be cached in the future

#

I accidentally had it at the very top, so it pulled down everything again for each update

shrewd jackal
hushed plank
#

oof, that is mostly from 2016

#

The official recommendation for pinning exact package versions is to keep your own mirror / repository with all the specific package and their versions that you may want to use.

fresh remnant
#

GitHub allows you to set up webhooks, which can send a message whenever a repo is updated (amongst a great many other things...). Might be worthwhile checking into that, instead of regular polling.

hushed plank
#

that will need setup by @icy agate

#

afaik only he can add/change hooks

fresh remnant
#

Yes, but it would only need to be set up once. I did it for work repos... they gave me permissions to set it up, I did, then they took the permissions away... which didn't affect the webhook at all.

hushed plank
#

nice

shrewd jackal
#

it pulling newer versions should no longer happen, since docker caches old build steps
is it time to reprocess all 15k commits again? πŸ˜„

fresh remnant
#

I mirrored the company public repos internally (this was before we went all-in on github). Even kept track of deleted archives by moving the internal mirror to an "archived" tree.

hushed plank
#

well I hope he will do it; having notifications here in discord for all github repo events will be nice too, not just for the commits to master, in a separate channel

hushed plank
fresh remnant
#

Of course, I wrote that code in Go... this was a few years before V got started.

shrewd jackal
hushed plank
#

i.e. update the graphs gradually, not just as a clean slate

#

nice

shrewd jackal
#
enum ResultState {
    pending
    success
    failed                   // generic error during measurements
    failed_too_old           // no cmd/v
    failed_vc_compile        // vc compile failed by oldv
    failed_vboostrap_compile // vc boostrap failed
    failed_vself_compile     // vself compile failed
    queued                   // success, but queued for re-processing
}
hushed plank
#

I'll have to modify commits.state = 1 in the report query too?

fresh remnant
#

"failed_vboostrap_compile" -> "failed_vbootstrap_compile"? πŸ™‚

fresh remnant
#

Probably not worth the change now, though.

shrewd jackal
hushed plank
#

are the numbers stable?

#

commits.state = 1 or commits.state = 7 ?

fresh remnant
#

int in the database is fine, but if it changes the column name...

shrewd jackal
hushed plank
#

cool

#

changing

shrewd jackal
#

@[table: 'commits']
struct Commit {
    commit_hash string @[primary]
    date        time.Time
mut:
    tested                 time.Time
    state                  ResultState
        // ...
}
fresh remnant
#

Back to the docker thing... yes, it caches all the layers from the previous build, and only creates new ones from any change point to the end. It can't just do one in the middle because of how the layers are built on top of the previous.

hushed plank
#

oh, the DB is ~14.5MB now

shrewd jackal
fresh remnant
#

Yup

#

I was just confirming. πŸ™‚

hushed plank
#

sqlite supports name in (1,7), nice

shrewd jackal
#

name renxSUS

hushed plank
#

pushed

#

it seems to work locally

#

just merged a commit

#

lets see when it will be visible in the graphs

#

495adc9cee03aa711b96f1b41b32073670375b91

shrewd jackal
#

so once its done with those and then a 10min delay

hushed plank
#

I think that changing gcc/libc versions are not enough to explain the last jump πŸ€”

#

because while they could potentially explain the speed differences, that can not be, for the size of the generated .c file

#

I think V for some reason started to produce larger .c files in the container

#

according to that graph

#

but locally, I can not see it:

#0 10:55:11 ^ master /v/oo>./v -o - examples/hello_world.v |wc
   1943    5225   45548
#

i.e. ~46KB, not 200KB as it is in the graph for the latest commits

#

on the other hand:

#0 10:55:13 ^ master /v/oo>./v -cc musl-gcc -o - examples/hello_world.v |wc
   5665   21589  200000
#

which is a lot closer

#

it could be, that V started to detect the environment as a musl one, instead of a libc one πŸ€”

#

which could potentially be caused by changes to Alpine and its packages πŸ€”

#

is there a /etc/alpine-release file inside the container?

#

and what is the output of ls -l /proc/self/map_files/ ?

#

oh, interesting ... ./v -cc gcc -o - examples/hello_world.v |wc is also close to 200KB

#

there is definitely something weird going on ... the size for the generated .c file for -cc tcc and -cc gcc on the same system, should be ~ equal

#

passing -d no_backtrace reduces the size a lot

#

I think the backtrace code for compilers != tcc, has string interpolation, and other v features that later can not be eliminated by markused

shrewd jackal
#

It processed the 2 new commits automatically

shrewd jackal
#

I have an idea

#

I added β€”fresh_tcc=false

#

So because no compiler is explicitly passed

#

It now builds for gcc instead of tcc (because it can’t find tcc)

hushed plank
#

do you pass -cc when doing the measurements for the generated c size for the hello world?

shrewd jackal
#

No

hushed plank
#

but then it should be closer to what ./v -o - examples/hello_world.v |wc produces (i.e. 46KB)

hushed plank
shrewd jackal
hushed plank
#

the problem is that the generated code for gcc/clang is big, not that the one for tcc is small

#

I've improved it a bit

#

but there are still some problems to solve

hushed plank
#

seems to be working fine now

#

for tcc, the generated .c file continues to be ~45KB

#

while for != tcc, the generated .c file for hello world is now not 200KB, but just ~55KB

#

which hopefully will speed up more the CI jobs that run with clang/msvc/gcc too

#

because of the many small _test.v files there

#

I still have to fix the windows jobs though

shrewd jackal
#

currently working on the "design" of regression/improvement messages

#

example:

#

5f3ced7213

Performance has improved πŸ“ˆ
-# Commited <t:1597435052>, Tested <t:1735589209>

self is as expected

-# 189642857 total

hello world has improved πŸ“ˆ

  • total 45.285ms -> 39.642ms πŸ“ˆ
    -# 39642857 total
#

or for a more recent commit:

#

84fbe2728d

Performance has improved πŸ“ˆ
-# Commited <t:1716271916>, Tested <t:1733831379>

self has improved πŸ“ˆ

- total 1.272s -> 1.087s πŸ“ˆ
- check 281.941ms -> 205.179ms πŸ“ˆ
- cgen 587.563ms -> 483.025ms πŸ“ˆ
- total_stages 1.185s -> 999.627ms πŸ“ˆ
-# 1087539885 total, 59539285 scan, 250174929 parse, 205179217 check, 29616142 transform, 483025641 cgen, 999627716 total_stages

hello world has improved πŸ“ˆ

- total 112.274ms -> 101.812ms πŸ“ˆ
- check 17.431ms -> 13.819ms πŸ“ˆ
- cgen 46.303ms -> 39.813ms πŸ“ˆ
- total_stages 101.984ms -> 91.609ms πŸ“ˆ
-# 101812714 total, 6860071 scan, 30981357 parse, 13819785 check, 3133357 transform, 39813571 cgen, 91609071 total_stages

hushed plank
#

do you use a hysteresis and some smoothing window?

shrewd jackal
#

no; it's currently just >10% improvement over previous commit

hushed plank
#

you do have dedicated hardware, so it is probably good enough

#

the noise is probably smaller than 10%

#

and the values are already averaged, so should be relatively stable

shrewd jackal
#

why did twemoji make the chart upwards red πŸ“ˆ and trend down blue πŸ“‰

hushed plank
#

what is twemoji ?

#

perhaps the association is up -> hot -> red, and down -> cold -> blue

#

is there a == chart?

#

although without it (since most commits will be like that) the output may be clearer to scan

shrewd jackal
#

Made by twitter

#

Because each OS does their own rendering, and it standardizes things

shrewd jackal
fresh remnant
#

red up makes sense from a "it's heating up!" meaning getting better/faster, where blue down implies "cooling down"... losing the upward momentum.

#

So ... twemoji == TWitterEMOJIs. Does help to standardize... if everyone uses them.

hushed plank
#

as the old saying goes, the good thing about standards is that there are many to choose from

shrewd jackal
#

Looks like Apple made the same choice

#

So it probably is indeed related to temperature

#

Im thinking of replacing it with a green/red up/down arrow

hushed plank
#

please no

#

red/blue is a better combo

shrewd jackal
#

I mean like πŸ”ΌπŸ”½ but colored

hushed plank
#

red/blue is both mnemonic (two people independently came to the same conclusion in this very thread)

idle furnace
hushed plank
#

refresh the page

shrewd jackal
#

it will work eventually after a few refreshes

idle furnace
#

Worked the 2nd time

shrewd jackal
#

2dd65872dc

Performance has degraded πŸ“‰
-# Commited <t:1730802922>, Tested <t:1736180569>

self has degraded πŸ“‰

- Total 1.102s -> 1.261s (+13%) πŸ“‰
- parse 296.536ms -> 330.806ms (+10%) πŸ“‰
- check 186.961ms -> 211.311ms (+12%) πŸ“‰
- cgen 458.623ms -> 555.326ms (+17%) πŸ“‰
- Total Stages 1.008s -> 1.165s (+13%) πŸ“‰
-# 1.261s Total, 65.121ms scan, 330.806ms parse, 211.311ms check, 37.975ms transform, 555.326ms cgen, 1.165s Total Stages

hello world has degraded πŸ“‰

- Total 105.054ms -> 121.348ms (+13%) πŸ“‰
- parse 34.624ms -> 39.102ms (+11%) πŸ“‰
- check 14.343ms -> 18.079ms (+21%) πŸ“‰
- cgen 37.935ms -> 45.647ms (+17%) πŸ“‰
- Total Stages 94.414ms -> 110.601ms (+15%) πŸ“‰
-# 121.348ms Total, 7.422ms scan, 39.102ms parse, 18.079ms check, 3.592ms transform, 45.647ms cgen, 110.601ms Total Stages

#

(regression was fixed a few commits later)

hushed plank
#

can you please make it process the last 2 days?

shrewd jackal
#

done, it's not picking up new commits by itself because it's reprocessing old ones

hushed plank
#

I do not care about the old ones (they are already done, and are curious only for finding anomalies)

#

I care about the new ones

#

can it be setup to always process the new ones, at least once a day?

#

the current last commit is af1ef92917ae318bff759d945d439582e67fac84 from 2025-01-05

#

and today is 2025-01-07

shrewd jackal
#

making it sync every 10th commit now πŸ‘

hushed plank
#

excellent

#

is that ~ every 30 minutes?

shrewd jackal
#

more like once an hour

#

it depends wildly

#

iirc it's more like 4 mins per commit atm, so every 40mins

hushed plank
#

nice

#

I hoped for 1 day, but once per hour is even better

shrewd jackal
#

time per commit: 3:35.530

#

so every 35mins

#

(assuming my code works)

#

the regression "detector" is now also running (the one that produces the messages comparing new commits to the previous one)

hushed plank
#

nice

shrewd jackal
#

will test it for a bit and then ask alex for a webhook in here

shrewd jackal
#

nice cgen drop

#

from your gcc markused

hushed plank
#

thanks

shrewd jackal
#

V panic: : failed to get latest commit: db.sqlite.SQLError: out of memory (21) (SELECT commit_hash, date, tested, state, sysname, nodename, release, version, machine, cc_version, compiler_size, v_self_default_id, v_self_skip_unused_id, v_self_no_skip_unused_id, v_hello_default_id, v_hello_skip_unused_id, v_hello_no_skip_unused_id FROM commits WHERE state = ?1 OR state = ?2 ORDER BY date DESC LIMIT ?3;)

#

welp

#

there's 60gb free πŸ˜„

hushed plank
#

does it work, if you restart it?

shrewd jackal
#

and it works locally

#

well it crashes the container and it restarts automatically

#

so no

hushed plank
#

perhaps the container has some limit, and it hits it

shrewd jackal
#

just for more context: this is the new regression detector

hushed plank
#

what do the system logs say (on the host)?

shrewd jackal
#

nothing

hushed plank
#

they may have more details about what exact limit was reached

shrewd jackal
#

and it works locally

#

these are all the logs:

2025-01-07T13:36:22.973420057Z 2025-01-07T13:36:22.973350Z [FATAL] failed to get latest commit: db.sqlite.SQLError: out of memory (21) (SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = ?1 OR `state` = ?2 ORDER BY `date` DESC LIMIT ?3;)
2025-01-07T13:37:23.251752447Z 2025-01-07T13:37:23.251682Z [FATAL] failed to get latest commit: db.sqlite.SQLError: out of memory (21) (SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = ?1 OR `state` = ?2 ORDER BY `date` DESC LIMIT ?3;)
2025-01-07T13:37:23.251792671Z V panic: : failed to get latest commit: db.sqlite.SQLError: out of memory (21) (SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = ?1 OR `state` = ?2 ORDER BY `date` DESC LIMIT ?3;)
2025-01-07T13:37:23.251812276Z v hash: ca6e3a3
2025-01-07T13:37:23.251817179Z backtrace_symbols is missing => printing backtraces is not available. 2025-01-07T13:37:23.251821396Z Some libc implementations like musl simply do not provide it. ```
(double timestamps due to `-t` in `docker logs`)
hushed plank
#

try state in ( x, y )

#

instead of state = x or state = y

shrewd jackal
#

don't think that is supported by the orm

hushed plank
#

do not use the orm

shrewd jackal
#

sqlite cli has no issue:

sqlite> SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = 1 OR `state` = 7 ORDER BY `date` DESC LIMIT 1;
63db71b650a4467e007a2752a76f807e084f17be|1736255999|1736256566|1|Linux|e97439752b4b|6.8.0-47-generic|#47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024|x86_64|cc (Alpine 14.2.0) 14.2.0|4138064|63897|63897|63896|63899|63899|63898
hushed plank
#

pass the query directly to db.exec()

#

to make sure that it is well formed, and to eliminate 1 level of indirection

shrewd jackal
#

the query is well formed, I just ran it manually

hushed plank
#

some DBs do not support binding parameters in some parts of a query

#

you ran an expanded version probably

#

without bindings

#

try running db.exec() with that exact query (the one you ran locally)

#

but on the container

#

I suspect that the sqlite version on the container is != the one you have locally

#

and that will help eliminate one possible cause

#

although, if that was the case, it would not have worked till now

#

so it is most likely to be something else, related to more recent changes

shrewd jackal
#

query also failed

#

I exec'ed into the normal fast container and sqlite in there and the query worked

#

so it's not the sqlite version of alpine

#

I have this:

    println(db.exec('SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = 1 OR `state` = 7 ORDER BY `date` DESC LIMIT 1;') or { panic(err) })

and it panics with the same OOM

hushed plank
#

are you using the same sqlite file, but shared to different containers?

shrewd jackal
#

locally, it prints

[sqlite.Row{
    vals: ['af1ef92917ae318bff759d945d439582e67fac84', '1736064711', '1736078401', '1', 'Linux', '8af2e92c43f5', '6.8.0-47-generic', '#47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024', 'x86_64', 'c
c (Alpine 14.2.0) 14.2.0', '4198144', '60589', '60589', '60588', '60591', '60591', '60590']
}]
shrewd jackal
#

the webserver has no issues

hushed plank
#

try copying the file beforehand to a different place/name

#

and then let one of the containers operate on the copy

hushed plank
shrewd jackal
#

made a copy, same issue

hushed plank
#

I think that one of the containers may be locking the file

#

hm, then it is not that

shrewd jackal
shrewd jackal
#

the 502s are it not accepting connections

hushed plank
#

it could in the same container, but it may have problems doing it across several

shrewd jackal
#

ok the CLI is close to OOM too

#

I used .stats on and got

#
sqlite> .timer on
sqlite> .stats on
sqlite> .mode list
sqlite> SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = 1 OR `state` = 7 ORDER BY `date` DESC LIMIT 1;
63db71b650a4467e007a2752a76f807e084f17be|1736255999|1736256566|1|Linux|e97439752b4b|6.8.0-47-generic|#47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024|x86_64|cc (Alpine 14.2.0) 14.2.0|4138064|63897|63897|63896|63899|63899|63898
Memory Used:                         2188120 (max 2287320) bytes
Number of Outstanding Allocations:   833 (max 842)
Number of Pcache Overflow Bytes:     2022120 (max 2030320) bytes
Largest Allocation:                  87360 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                74 (max 123)
Successful lookaside attempts:       181
Lookaside failures due to size:      4
Lookaside failures due to OOM:       124
Pager Heap Usage:                    2102616 bytes
Page cache hits:                     2
Page cache misses:                   1101
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   3320 bytes
Statement Heap/Lookaside Usage:      41056 bytes
Fullscan Steps:                      19099
Sort Operations:                     1
Autoindex Inserts:                   0
Virtual Machine Steps:               173472
Reprepare operations:                0
Number of times run:                 1
#

it's probably the ORDER BY that is causing the entire commits table to be loaded into memory to be sorted

#

and the V sqlite wrapper is using prepared statements or something that uses 100kb more RAM

hushed plank
#

but it is not very big, it is under 100MB

#

I wonder what limits it

shrewd jackal
#

oh, the max isn't the limit is it

hushed plank
#

I think that only the available RAM should be the limit

#

unless it is hitting some docker/containerization thing before that

idle furnace
#

You cannot share a single sqlite file among processes or threads

shrewd jackal
idle furnace
#

I had to put locks around mine to prevent deadlocking

hushed plank
idle furnace
#

Be interesting if the V version is safe from that.

hushed plank
#

I think it is some docker/sqlite interaction

#

the locking may not work well across containers

#

and have edge cases

idle furnace
#

May not

#

I had a single thread/process handle all DB calls so the locking could be centralized

hushed plank
#

shared filesystems are notorious for locking bugs

idle furnace
#

Setup a restful api to get and save data to a central container handling the DB calls. That way other containers in theory could talk to it.

hushed plank
#

but still, it is a bit surprising that the error is not a more sensible one

#

and it also happened when the .db file was copied to a separate one

#

so presumably only one embedded sqlite in its own processs tried to use it

idle furnace
#

So long as the copy does not have an active lock. My experience though is SQLite creates .journal file while processing

hushed plank
#

sqlite supports indexes for sorting too

#

so another thing to try is to add one, for date desc

#

so that most queries will hopefully use that, and limit the amout of used resources/locking time

#

something like this:
CREATE INDEX date_idx on commits (date desc);

#

after that, if I run:

explain SELECT `commit_hash`, `date`, `tested`, `state`, `sysname`, `nodename`, `release`, `version`, `machine`, `cc_version`, `compiler_size`, `v_self_default_id`, `v_self_skip_unused_id`, `v_self_no_skip_unused_id`, `v_hello_default_id`, `v_hello_skip_unused_id`, `v_hello_no_skip_unused_id` FROM `commits` WHERE `state` = 1 OR `state` = 7 ORDER BY `date` DESC LIMIT 1;
#

I get 4 OpenRead 2 3893 0 k(2,-,) 0 root=3893 iDb=0; date_idx

#

beside many other lines that I do not understand, but probably it means that the index is used

#

the query plan at least, is certainly shorter than before

idle furnace
#

Excellent plan

hushed plank
#

it fits in 1 page now

#

while it was 2 screens before

#

and before it had also: 4 Explain 4 0 0 SCAN commits 0

#

while now it is: 5 Explain 5 0 0 SCAN commits USING INDEX date_idx 0

#

before the index:
Memory Used: 2185744 (max 2286176) bytes
after the index, for the same query (in a fresh sqlite3 instance):
Memory Used: 168992 (max 169864) bytes

fresh remnant
#

I do prefer "state in (1, 7)" to "state = 1 OR state = 7"... if for no other reason that it is shorter. SQL statements are crazy long anyway, so any method of shortening them is a good method. πŸ™‚

#

Also... is there really a need to list every field individually? Other than having to make the struct slightly larger with any other fields (if you're using ORM), I don't see why you can't just "ignore" the ones you don't care about in that query.

hushed plank
#

the query was generated by the ORM

fresh remnant
#

Ah, gotcha. Ugh. ORM definitely needs work...

hushed plank
#

and it selects only those columns, that are present in the struct on the V side

#

potentially the table can have many more columns

fresh remnant
#

That last one could've been just

SELECT * FROM `commits` WHERE `state` in (1, 7) ORDER BY `date` DESC LIMIT 1;
hushed plank
#

select * is shorter, but can transfer a lot more data

#

imho the * form is suitable for human written queries

fresh remnant
#

Yep, it can... but it's certainly unlikely compared to all those individual fields. πŸ˜•

hushed plank
#

while the version with the explicitly listed fields is easy for machines to generate

#

and even if more verbose, it is a one time cost, while sending the multiple results can dominate the processing/decoding time

fresh remnant
#

Possibly, yes. Possibly no, depending on the efficiency of the SQL parser, etc.

hushed plank
#

most likely yes - you could have a query that returns many millions of rows

fresh remnant
#

Or only 1.

hushed plank
#

anything that can save you from processing even 1 field in them

#

will have disproportionate effects

fresh remnant
#

Yep. Trade-offs everywhere.

hushed plank
#

in which case the parsing time increase can be more

#

but it also depends on whether the DB decided to cache the query, and how it did so

fresh remnant
#

One of the goals of optimizing database stuff is to improve queries such that fewer rows are returned, meaning less processing of rows after the query. If you only get back exactly what you wanted, you don't have to have if/else blocks to decide what to do with the rows.

hushed plank
#

the same applies to the columns

fresh remnant
#

In this particular case, you do something with all of them, but it could likely still be cut down by querying `date` BETWEEN...

#

Especially on the "last 30 days", etc. charts.

hushed plank
#

those use "AND commits.date > ${cutoff_ts}" in the WHERE part of the query

#

hopefully they will also benefit from the new index

fresh remnant
#

Yes indeed. Anywho, nice side discussion... back to the regularly scheduled fast2 talk. πŸ˜‰

hushed plank
hushed plank
#

I've added the .sql files in the oldv_charts repo, and pushed

hushed plank
#

fast2.v works very nicely now, when it comes to the latest commits

#

I've merged some this morning, and they are already visible in the graphs

#

excellent work @shrewd jackal, thank you

shrewd jackal
#

@hushed plank NVM, that did not actually fix it

#

what fixed it was that I did not specify -prod

#

with -prod it still OOMs sqlite

#

but works without

hushed plank
#

are you using gcc or clang?

shrewd jackal
#

gcc

#

it's alpine

#

on my mac it works with both on clang

hushed plank
#

try also with -prod -cflags -fno-inline-small-functions

shrewd jackal
#

i'll try with gcc on my mac

hushed plank
#

in the alpine container

shrewd jackal
#

well, nix-shell -p libgcc doesn't work for some reason, so no gcc testing on mac ig

hushed plank
#

you can try passing -d dynamic_boehm on macos

#

I have not used nix on either linux nor macos

#

(personally I consider it a waste of time, and mostly a source of bugs)

hushed plank
#

on alpine?

shrewd jackal
#

yes

hushed plank
#

thanks

#

I think that not passing -prod at all is the better solution

#

the script itself is not very performance sensitive afaik

#

it only measures external programs

shrewd jackal
#

that's an entirely different script

hushed plank
#

do you pass -prod for the webserver?

shrewd jackal
#

we have 3 scripts now:
- fast; does all the measurements
- web; the webserver
- regret; the new regression "detector" (which OOMs sqlite and now works)

#

all 3 are with -prod

hushed plank
#

oh, ok

shrewd jackal
#

(on my private git instance)

shrewd jackal
#

Waiting for a new commit

hushed plank
#

2020?

#

or for 2025?

shrewd jackal
#

A new one for the regressions

hushed plank
shrewd jackal
hushed plank
#

done

shrewd jackal
#

I’ll let you know how it goes

shrewd jackal
#

cc7caf4384

Performance is as expected
-# Commited <t:1736438369>, Tested <t:1736439109>

#

The exact stats for hello/self are missing

shrewd jackal
#

even weirder, all printlns are missing from the logs somehow
it worked since the webhook fired, so renxSHRUG

#

hello world/self stats are missing if they're unavailable (eg the column is NULL)

#

erm

hushed plank
#

try adding unbuffer_stdout() at the start of your program

shrewd jackal
#
Commit{
    commit_hash: 'ba9d358d5f170f40e46234ae6b9ad788270189be'
    date: 2025-01-09 16:15:05
    tested: 2025-01-09 16:44:44
    state: success
    sysname: Option(none)
    nodename: Option(none)
    release: Option(none)
    version: Option(none)
    machine: Option(none)
    cc_version: Option(none)
    compiler_size: Option(none)
    v_self_default: Option(none)
    v_self_skip_unused: Option(none)
    v_self_no_skip_unused: Option(none)
    v_hello_default: Option(none)
    v_hello_skip_unused: Option(none)
    v_hello_no_skip_unused: Option(none)
}
#

I think sqlite stil has issues

#

all of those are set

#

works localy

hushed plank
#

does it work without -prod?

shrewd jackal
#

it does indeed

#

so sqlite with prod on alpine is just broken?

#

but it works for fast and the webserver

#

time to wait for next commit

hushed plank
#

you could also try -cflags -O2

#

but imho just do not use -prod - I doubt the benefits are worth the trouble for those programs, since they are not realtime, and most of the time spend in them is in executing other programs anyway

#

you will get faster feedback, and less problems like this one without it

shrewd jackal
#

that works

#

so does -O3

#

-O3 was suspiciously fast (2.4s)

hushed plank
#

I think that -prod uses -O3 -flto

#

-0 != -O

shrewd jackal
#

O3 obv

#

-O3 -flto was 2.7s and also works

hushed plank
#

do you pass -cc gcc too?

#

without -prod, you will have to specify the compiler explicitly

shrewd jackal
#

good point, it may be using tcc

hushed plank
#

otherwise you will get them passed to tcc

#

and it mostly just ignores them

shrewd jackal
#

yeah it was using tcc, I will try base gcc first

fresh remnant
#

That would explain why it was "suspiciously fast". πŸ™‚

shrewd jackal
#

ok base gcc works, time to tune it

fresh remnant
#

-prod is the equivalent to -cc cc -O3 -flto, so it will use whatever /usr/bin/cc links to.

shrewd jackal
#

even just base gcc takes 14s

fresh remnant
#

For me, it is lrwxrwxrwx 1 root root 3 Sep 10 09:07 /usr/bin/cc -> gcc

hushed plank
#

on alpine?

shrewd jackal
#

gcc with -O3 -flto causes sqlite OOMs again

#

trying -O2 now

#

-O2 works fine

#

I get lrwxrwxrwx 1 root root 3 Jan 9 10:31 /usr/bin/cc -> gcc on alpine

#

what does -flto do?

#

ah link time optimizations

#

trying just -O3 now

#

that also works

fresh remnant
#

So a problem in linking on alpine? Odd...

shrewd jackal
#

which somehow doesn't affect the other scripts renxSHRUG

#

anyway

#

time for new commits

hushed plank
#

you should ping @tall isle πŸ™‚

#

or we should find & fix some doc typos/inconsistencies - they are usually fast to pass review/merge, since they do not trigger too many CI jobs

shrewd jackal
#

TLDR; when compiled with -prod (or -cflags "-O3 -flto") sqlite throws OOM errors: #1312494584151933001 message
with -cflags -fno-inline-small-functions SELECT returns partial results #1312494584151933001 message

tall isle
#

hmm

shrewd jackal
#

and only on alpine

fresh remnant
#

... which is musl based.

#

Perhaps it might hit other musl based systems... if there are any. πŸ™‚

shrewd jackal
#

3b31699a0d

Performance is as expected
-# Commited <t:1736500936>, Tested <t:1736502314>

self is as expected

  • check 206.469ms -> 203.574ms (+1%)
  • markused 65.957ms -> 63.833ms (+3%)
    -# 1.184s Total, 61.383ms scan, 313.491ms parse, 203.574ms check, 40.677ms transform, 432.296ms cgen, 63.833ms markused, 1.012s Total Stages

hello world is as expected

  • cgen 10.068ms -> 10.647ms (-5%) πŸ“‰
    -# 82.539ms Total, 7.058ms scan, 35.791ms parse, 15.169ms check, 3.876ms transform, 10.647ms cgen, 1.049ms markused, 68.831ms Total Stages
#

The +/- for the % are inverted

#

So is the emoji

hushed plank
#

I think it is too sensitive - in my experience, launching small executables on linux can vary within 1ms

#

not sure about cgen

shrewd jackal
#

It is saying it’s as expected

#

The tolerances for showing as a difference and counting as improvement/degradation are different

hushed plank
#

oh, ok

shrewd jackal
#

3b31699a0d

Performance is as expected
-# Commited <t:1736500936>, Tested <t:1736502314>

self is as expected

- check 206.469ms -> 203.574ms (-1%)
- markused 65.957ms -> 63.833ms (-3%)
-# 1.184s Total, 61.383ms scan, 313.491ms parse, 203.574ms check, 40.677ms transform, 432.296ms cgen, 63.833ms markused, 1.012s Total Stages

hello world is as expected

- cgen 10.068ms -> 10.647ms (+5%) πŸ“ˆ
-# 82.539ms Total, 7.058ms scan, 35.791ms parse, 15.169ms check, 3.876ms transform, 10.647ms cgen, 1.049ms markused, 68.831ms Total Stages

#

fixed it

hushed plank
#

nice

shrewd jackal
#

no wait, the emoji was correct NotLikeThis

hushed plank
#

do you want them to always show the better direction for the metric?

#

or to reflect 100% the actual change data?

#

both could be valuable alternatives, as long as they are consistent

shrewd jackal
#

it shows whatever changed by more than 1%

#

eg for when skip-unused became default, there were positive and negative changes (cgen down, markused up)

hushed plank
#

if they show "the better direction" (i.e. up is always whatever is good/more performant/smaller code size etc), the report would be easier to scan at a high level

#

if they always reflect 100% the actual change, you would have to think about what each emoji infographic actually means for each metric

shrewd jackal
#

there's 3 kinds of metrics internally:
- performance (lower is better)
- reverse performance (higher is better, just vlines/s)
- size (lower is better)

#

entire current source code

tall isle
#

no change in the current table vision of results?

shrewd jackal
#

you mean this?

#

hello (examples/hello_world.v) on 3b31699a0d (2025-01-10 09:22:16)

      names      mean                stddev       min       max  samples  noisy  unit
 ----------  --------  --------------------  --------  --------  -------  -----  ----------------
    timings
       scan   7.058ms   Β± 54.507us (0.77%)   6.988ms   7.152ms       14
      parse  35.791ms  Β± 260.206us (0.73%)  35.283ms  36.314ms       14
      check  15.169ms  Β± 100.008us (0.66%)  15.021ms  15.336ms       14
  transform   3.876ms   Β± 29.303us (0.76%)   3.835ms   3.936ms       14
   markused   1.049ms    Β± 5.229us (0.50%)   1.041ms   1.058ms       14
       cgen  10.647ms  Β± 113.253us (1.06%)  10.426ms  10.801ms       14
 all stages  68.831ms  Β± 464.683us (0.68%)  68.154ms  69.843ms       14
      total  82.539ms  Β± 507.705us (0.62%)  81.696ms  83.551ms       14

  v  source
  v    size    469235          Β± 0 (0.00%)    469235    469235       20         bytes
  v   lines     17666          Β± 0 (0.00%)     17666     17666       20         lines
  v lines/s    214037       Β± 1314 (0.61%)    211439    216240       14         lines per second
  v   types       150          Β± 0 (0.00%)       150       150       20         types
  v modules         5          Β± 0 (0.00%)         5         5       20         modules
  v   files        65          Β± 0 (0.00%)        65        65       20         files

    c  code
    c  size     57141          Β± 0 (0.00%)     57141     57141       20         bytes
    c lines      2342          Β± 0 (0.00%)      2342      2342       20         lines

tall isle
shrewd jackal
#

ah yes, the website doesn't have tables currently

#

only the charts

hushed plank
#

you can download the database itself

#

and analyze the numbers as you wish

#

perhaps we should put it at the top too

#

since it is hard to see now without scrolling

shrewd jackal
#

36154b8631

Performance is as expected
-# Commited <t:1736511315>, Tested <t:1736512160>

self is as expected

- check 203.574ms -> 205.670ms (+1%)
- markused 63.833ms -> 65.590ms (+3%)
-# 1.186s Total, 61.198ms scan, 312.992ms parse, 205.670ms check, 40.780ms transform, 430.703ms cgen, 65.590ms markused, 1.012s Total Stages

hello world is as expected

-# 82.347ms Total, 7.021ms scan, 35.720ms parse, 15.088ms check, 3.895ms transform, 10.590ms cgen, 1.044ms markused, 68.590ms Total Stages

#

lgtm

tall isle
#

good work

shrewd jackal
#

@icy agate can we get a channel with a webhook similar to #git-commits for performance of each commit?

shrewd jackal
#

bed28d1e8b

Performance is as expected
-# Commited <t:1736588673>, Tested <t:1736588961>

self is as expected

-# 1.184s Total, 60.918ms scan, 310.808ms parse, 206.737ms check, 40.453ms transform, 429.738ms cgen, 65.435ms markused, 1.010s Total Stages

hello world is as expected

-# 82.250ms Total, 6.988ms scan, 35.575ms parse, 15.096ms check, 3.883ms transform, 10.623ms cgen, 1.044ms markused, 68.461ms Total Stages

shrewd jackal
#

It didn’t pick up the other commit, I think I forgot a desc in the sql query

hushed plank
#

the other one does not change the compiler, it should be more or less the same

shrewd jackal
#

Indeed, but it’s supposed to post a message for every commit and it got skipped because they were too close together

#

No wait, it got skipped because the other one got processed first

#

Uh, this will be annoying. I need to update fast to process older commits first

hushed plank
#

can it make a new query, after each commit is re-processed?

shrewd jackal
#

Id prioritise pending over queued in that case

hushed plank
#

or sort them by 2 fields - first the recent ones (by date), and then by status

#

so that the most recent new ones will be always first

idle furnace
#

Priority queue is that a possibility?

shrewd jackal
#

it's a SQL select statement...

idle furnace
#

Ahh okay

shrewd jackal
#

better prioritization is implemented πŸ‘

#

entirety of 2024 is reprocessed with gcc instead of tcc now

tall isle
#

cool

#

how long it was?

shrewd jackal
#

around 6 days

#

Β± one or two hours

fresh remnant
#

Once it's all finally settled, hopefully will NOT have to go back and reprocess older ones.

shrewd jackal
#

ideally, c gen wouldn't be different for tcc/gcc

fresh remnant
#

Ideally... but it is in at least a few places.

hushed plank
#

did it pickup all the recent commits?

#

although it is probably too early to tell πŸ€”

#

I'll wait for a few hours

shrewd jackal
#

1c2f1a3504

Performance is as expected
-# Commited <t:1736616349>, Tested <t:1736618238>

self is as expected

-# 1.186s Total, 61.036ms scan, 310.829ms parse, 206.588ms check, 40.626ms transform, 431.259ms cgen, 66.032ms markused, 1.011s Total Stages

hello world is as expected

  • markused 1.044ms -> 1.056ms (+1%)
    -# 82.316ms Total, 7.014ms scan, 35.604ms parse, 15.161ms check, 3.874ms transform, 10.589ms cgen, 1.056ms markused, 68.596ms Total Stages
#

Not gonna post every commit unless there’s an actual impact

shrewd jackal
#

added a min delta of 1ms instead of only >1% difference to reduce noise

#

since a lot of the listed changes is something being 10 microseconds faster than last time

icy agate
#

how do i set up the hook?

shrewd jackal
#

I’ll set it up when I’m home

icy agate
#

done πŸ™‚

shrewd jackal
#

it's live

idle furnace
#

Can we all see it?

fresh remnant
#

For now, it's a private channel. Will likely be opened after it's proven to show what it should.

icy agate
#

done, it's public now

shrewd jackal
#

For anyone who didn’t read the entire history: the delay is currently up to 40mins for new commits
This is because we’re also retesting old commits at the same time and only check for new commits every 10 processed commits

Once the backlog is once again cleared (in 2-3 weeks), the delay should be consistently below 15mins

#

10min Sleep between git pulls of the repo, 4 mins for processing and 1min sleep between checking for new results
10mins can be optimized in the future using GitHub webhooks, but we can tackle that in 3 weeks when it becomes relevant

hushed plank
#

I just merged a PR.

#

it triggered

#

#fast message

shrewd jackal
#

That was quick

fresh remnant
#

That's the thing about checking on a schedule... if the merge happens just before the check is done, it triggers right away. If the merge happens just after the check it done, it has to wait the full period until the next check is done.

#

That's why events are a good thing... no time will be wasted getting the signal that a merge has happened, and no cpu time will be wasted checking for merges to happen when they didn't.

shrewd jackal
#

it's currently not wasting time checking for merges, it's busy benchmarking old commits

#

and every 10 commits it does a check for new ones

#

each commit taking ~3 to 3.5mins makes the worst case 35mins

fresh remnant
#

That's expected until it finally all settles down. Once all the old stuff is benchmarked, and it is all caught up with the current commits, all it will have to do is wait for now ones after that. And that's much simpler with a listen on a port waiting for an event.

shrewd jackal
#

that's a problem for future me

shrewd jackal
#

we finished yesterday with 2023

hushed plank
#

nice

#

it seems to be a bit faster than before

shrewd jackal
#

took 6 days and 2 hours

hushed plank
#

but it may be only my impression

shrewd jackal
#

sounds about the same as last time

hushed plank
#

I like how there are no gaps now

#

and everything looks mostly smoother now, except for the rarer spikes

#

it makes it much easier to find the outliers

#

we should soon work on optimizing parsing and removing support for old features like fn f<T>() etc

#

and moving more checks from it to the checker

#

I think it can improve its performance a lot

#

and especially for small programs, it is now the dominant factor

#

because of all the reparsing of builtin, strconv and strings that happens for even just hello world

#

not doing it at all, based on some caching mechanism, could be even better

#

but it would have to be very reliable

icy agate
#

that's a lot more even than i expected

hushed plank
#

that is the value of graphs

#

throughout the history of the project, the relative slowness of the different stages changed several times, but currently the parser dominates for small programs

shrewd jackal
#

didn't get to adding commit messages

#

rescheduled to this saturday

shrewd jackal
#

2022 done since 6h ago

hushed plank
#

the graphs seem nice to me, without obvious surprises

shrewd jackal
#

working on it now

shrewd jackal
#

done

#

also backfilled all old commits

hushed plank
#

nice

shrewd jackal
#

so you could add it to the graphs now too

#

the column is just commit_title

shrewd jackal
#

2021 done as of 12h ago

hushed plank
#

nice

hushed plank
#

@shrewd jackal I have a local patch, that will change the output of -stats like this:

#0 15:33:15 ^ master ~/code/v>./v -stats examples/hello_world.v
        V  source  code size:      17627 lines,      82343 tokens,     468173 bytes,   148 types,     5 modules,    64 files
generated  target  code size:       1923 lines,      45410 bytes
compilation took: 260.961 ms, compilation speed: 67546 vlines/s, cgen threads: 3
#

(note the new tokens metric)

#

will it be a problem for the current setup?

shrewd jackal
#

no

hushed plank
#

ok

#

thanks

shrewd jackal
#

but if you want to track it, I should add it first or we'll need to reprocess

hushed plank
#

no, I am not interested in tracking it for now

shrewd jackal
hushed plank
#

it is mostly useful for now, to consider the impact of changing some of token.Token's fields to use less bits

shrewd jackal
#

the parser should be fine if you add anything, as long as you don't rename anything

hushed plank
#

very nice

#

the rest are not changed, so it will work

shrewd jackal
#

We’re done

hushed plank
#

no 2020?

shrewd jackal
#

up to 2020-04-21

#

that's the last supported one

hushed plank
#

my bad, I should have looked at the Total, ms chart

#

I forgot that the Stages, ms one depends on stuff that became available later

shrewd jackal
#

technically the same thing is happening with total as well, but it falls back to measuring the full execution time

shrewd jackal
#

somehow the container is leaking thousands of zombie git processes thonk

#

a restart fixes it but it's weird

hushed plank
#

how do you call git?

#

with os.system, os.execute or something else?

shrewd jackal
#

combination of os.system and os.execution depending on if I need the output

#

they might also be from oldv

#

I simply don't know

#

shouldn't ps -A have listed the arguments too? πŸ€”

hushed plank
#

can it show the full command path?

#

I think it should

shrewd jackal
#

it does on macos but not on ubuntu renxSHRUG

hushed plank
#

for me it does

#

perhaps the docker ps has different options?

#

or the alpine one, not sure where you are running it

shrewd jackal
#

I am running it on the host which is ubuntu

#

it's not logging the commands for any process though

#

so it's not related to docker

hushed plank
#

no idea then

shrewd jackal
#

cat /proc/xxx/cmdline is also empty

#

for the zombie git processes

hushed plank
#

try running /usr/bin/true abcdef

#

with both os.system, and with os.execute

#

to see if you can reproduce it on the host

#

in a loop, say 20 times

#
import os
for _ in 0..20 {
    os.execute('/usr/bin/true abcdef execute')
}
for _ in 0..20 {
    os.system('/usr/bin/true abcdef system')
}
println('done')
#

this for me passed, without creating zombies

shrewd jackal
#

what if the program doesn't exit

hushed plank
#

if the program does not exit, it will not be a zombie

shrewd jackal
#

I mean the v program which spawns them

hushed plank
#

it will be either running or paused

hushed plank
#

but it is easy to test

#

it can just wait at the end

shrewd jackal
#

everything is empty

#

I fear the kernel already removed everything useful

#

:/

hushed plank
#

proc files are often like that

#

try ls -lart /proc/self/

#

the content is generated on access

#

so it can not show the filesize in advance

shrewd jackal
#

oh true

#

but the fd file has a size on self

#

but cmdline and env are empty for the git processes but not for self

hushed plank
#

for me, everything is 0s

#

try catting /proc/PID/cmdline

shrewd jackal
#

I also get 0 except for fd, regardless

shrewd jackal
#

/proc/PID/env too

#

and every file I tried aswell

#

all symlinks are dead

#

eg cwd, exe

hushed plank
#

why is /bin/busybox ?

#

is that on Alpine?

shrewd jackal
#

yes this is inside the container

#

but from outside the container it's the same thing

hushed plank
#

try running the program from above in the container

#

perhaps the behaviour of glibc is different than that of musl

shrewd jackal
#

sh: /usr/bin/true: not found

#

πŸ˜„

hushed plank
#

try with ls

#

I hope it has at least that

#

or busybox true abcdef

shrewd jackal
#

it's /bin/true, not /usr/bin/true

#

no zombies

hushed plank
#

try running git status

shrewd jackal
#

kept the program alive (os.input()) and checked with different shell, also no zombies

hushed plank
#

could it be that git itself starts sub processes

#

that it does not wait for

#

but that would have been caught much earlier πŸ€” so it is unlikely

shrewd jackal
#

no zombies

#

I'll try running oldv

#

because oldv with -s is used for updating git

#

oh dear lord

#

yeah it's caused by oldv

hushed plank
#

try ps auxwww | grep 'Z'

shrewd jackal
#

that only greps itself

#

I don't think alpine ps supports those options

hushed plank
#

it does not on Ubuntu

shrewd jackal
#

i'll run from ubuntu

#

yep that gets all the zombies

#
root     3084130  0.0  0.0      0     0 ?        Zs   13:41   0:00 [git] <defunct>
root     3084137  0.0  0.0      0     0 ?        Zs   13:41   0:00 [git] <defunct>
root     3084160  0.0  0.0      0     0 ?        Zs   13:41   0:00 [git] <defunct>
root     3084167  0.0  0.0      0     0 ?        Zs   13:41   0:00 [git] <defunct>
root     3084191  0.0  0.0      0     0 ?        Zs   13:41   0:00 [git] <defunct>
root     3084198  0.0  0.0      0     0 ?        Zs   13:41   0:00 [git] <defunct>
#

small snipped

hushed plank
shrewd jackal
#

each oldv -s adds 2 new zombies

hushed plank
#

I'll test locally

#

lol

#

on ubuntu it does not πŸ€”

#

I'll setup an alpine container

shrewd jackal
#

is VERBOSE=1 supposed to work for -s?

hushed plank
#

I'll use Dockerfile.alpine

#

yes, since it uses the scripting module

#

you can also pass -v explicitly

#

but that shows less details

shrewd jackal
#

oh it was because I was using .execute facepalm

#

it runs exactly two git processes and there's 2 new zombies...

hushed plank
shrewd jackal
#

but it waits for them to finish and they're successful

hushed plank
#

the zombies are for git pull --quiet ?

shrewd jackal
#

there are no other git commands being ran

hushed plank
#

weird

#

is git an executable or a script on alpine?

shrewd jackal
#

/usr/bin/git: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, BuildID[sha1]=ce140b8e440c6869ada79dfd2d4427fc18c8e280, stripped

hushed plank
#

can you try running git pull --quiet in the script above

#

to see what will happen (on Alpine)

#

it may need to be in a folder, for which you have run git init first

shrewd jackal
#

yeah that adds a zombie

shrewd jackal
hushed plank
#

for both os.execute and os.system, or for just os.execute?

shrewd jackal
#

rewrote it just to call os.system once because speed

hushed plank
#

(I am still waiting for the alpine container to build, so I can not yet test myself)

shrewd jackal
#

…………………………………

#

ok just running git -C /root/.cache/oldv/vc pull myself also does it

hushed plank
#

i.e. git itself zombifies?

shrewd jackal
#

yes

#

status works fine

hushed plank
#

or perhaps busybox does it

#

in certain situations

#

can you try installing bash in alpine

#

and then do the same check, after starting bash

shrewd jackal
#

done and it also does it

hushed plank
#

so it is a git specific problem, on alpine

#

interesting

shrewd jackal
#

appears to be

#

guess I will just restart the container once a week

#

or do nothing at all, don't think it's causing any issues

hushed plank
#

no, it just clutters your ps output afaik

#

I wonder if it does it for all git pull commands, or just for those that make network connections

#

the build process finished for me

#

there are no zombies

#
7f2354e1f09e:/opt/vlang$ cat /etc/alpine-release
3.20.6
#
7f2354e1f09e:/opt/vlang$ git version
git version 2.45.3
#

I've build the container with: docker build -t vlang_alpine - < Dockerfile.alpine

#

from the main V repo

#

perhaps for that particular alpine/git combination, the bug is fixed?

#

I'll try running oldv too

#

(in docker run -it vlang_alpine bash)

#

oof, I do not have rsync in that container

shrewd jackal
hushed plank
#

because of a "message of the day" ?

#

afaik you can touch ~/.hushlogin to stop them

hushed plank
#

sorry for the delay; just finished rebuilding the container and then running oldv in it

#

I think that for that particular version of alpine, git is ok

#

there are no zombies after it runs

shrewd jackal
#

alpine ps doesn't support those options

#

or do the ps command from outside the container (preferably using a second shell to make sure the container doesn't exit)

shrewd jackal
#

nvm ps -a should've logged them

#

I would upgrade the image but then you'll complain that numbers change

lofty monolith
#

My comment is late, it seems you have already found a solution. At my work we once faced a similar problem with zombies, which only appeared in Alpine, only calling python subprocesses. I don't remember the details exactly, but it was in musl, we started using tini https://github.com/krallin/tini as PID 1 in the container and this solved the problem

hushed plank
#

wait for it to exit all the while reaping zombies and performing signal forwarding.

#

yeah, that would solve it

#

perhaps the init process in alpine was fixed in the later versions too

#

or musl changed their wait4 implementation

hushed plank
#

or reboot the vps once a week

#

since upgrading the container will probably change the compiler versions too etc

hushed plank
#

@shrewd jackal will it be a problem, if I change the shortened hash in the vlang/vc commit messages to a full hash?

#

i.e. have for example not:
[v:master] a826feb - v.builder: remove forgotten b.show_parsed_files/0 call
but:
[v:master] a826febf5e3fc716c9478b4c4a3ca2f26a8531c9 - v.builder: remove forgotten b.show_parsed_files/0 call

shrewd jackal
#

Idk

hushed plank
#

currently it is produced by git rev-parse --short HEAD

shrewd jackal
#

fast is always passing the full hash

hushed plank
#

so it should be unique, according to its documentation

#

but the full hash is probably more useful for automation tools anyways

shrewd jackal
#

The only time it’s truncated is in #fast (Link itself still has full length)

#

Otherwise always full length

hushed plank
#

excellent, I will change gen_vc_ci.yml then

hushed plank
#

perfect ... everything works fine

static scarab
#

Also trying to fill a struct because of a custom sql query. Does this code actually work for you? I'll have this one: error: cannot assign an Option value to a non-option variable in line 11

shrewd jackal
#

consider using #help

shrewd jackal
#

A

shrewd jackal
#

looks like we're leaking a bit of memory

#

and 7349 zombie processes

#

but it's manageable

#

will restart on next week's sunday anyway (first sunday each month is patch sunday)

hushed plank
#

is it the old issue, or a new one?

shrewd jackal
#

The zombie processes is old (git on alpine)

#

And never really cared about memory, so might be old aswell

shrewd jackal
#

started monitoring cpu & memory usage

hushed plank
#

are the spikes for the RAM usage corresponding to -prod compilations?

#

hm, the last graph looks a bit weird to me πŸ€” - it had only one big peak, and the level at the end was lower than that at the start

shrewd jackal
#

both cpu and ram spikes are it doing benchmarking

#

the last spike is when it runs oldv -sync every 10mins to check for new commits

#

because it's recompiled on every run (v run'ed), I should probably AOT that

shrewd jackal
#

zoomed out version

#

memory consumption just jumps by 200mb "randomly"

#

seems to coincide with the fetches every 10mins

#

set the memory limit to 2gb, so the container should get killed once it exceeds that

#

(just for testing)

hushed plank
#

does it have swap?

#

if it does, it may not be

shrewd jackal
#

looks like that's off by default

#

nvm it defaults to same amount as RAM

#

so it'd swap 2gb as well

#

looks like there's no way to change the swap limit using docker compose :/

#

oh there is, but it's different than the normal memory limit because docker moment

shrewd jackal
#

oldv is now compiled in the build process, so the spikes every 10mins should be gone

#

did someone break time.Duration.str() IIRC this should show 10m instead of the ns

shrewd jackal
#

spikes remain, so it's not the compilation done by v run that's causing it

#

probably just git coping with 18k+ commits

hushed plank
#
import time
d := time.Duration(600_000_000_000)
dump(d)
dump(d.str())

this shows for me:

[a.v:4] d: 10:00.000
[a.v:5] d.str(): 10:00.000
#

I guess there could be an i64 cast in the sleeping for message πŸ€”

#

because if I add:

i := i64(d)
dump(i)
dump(i.str())

I get the long literal too

shrewd jackal
#

Oh it’s d := 10 * time.minute

#

I could swear that returns a time.Duration though

fresh remnant
#

time.Duration is just a type alias for u64.

shrewd jackal
#

With a special str() method

hushed plank
#

if you happen to remember when did it work differently, we could try bisecting to find the change

shrewd jackal
#

I could also just be imagining things because I wrote too much go

hushed plank
#

and then think about if it is an improvement or a silent regression

shrewd jackal
#

looks like we leak ~170mb per test

#

that could be anywhere, from the ORM to os.execute

#

after the first commit it dropped down to before levels

#

so only the 2nd test leaked? renxSHRUG

hushed plank
#

hm, why was not it here #1312494584151933001 message ?

shrewd jackal
#

I have no idea

#

I am grasping at straws

hushed plank
#

lets see if it will remain after more merged commits

hushed plank
#

does it keep leaking after the latest commits?

shrewd jackal
#

no but then it decided to leak on its own

hushed plank
#

try doing free && sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free in the running container

#

and on the host too

shrewd jackal
#

tee: /proc/sys/vm/drop_caches: Read-only file system

#

outside of the container:

$ free && sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free
               total        used        free      shared  buff/cache   available
Mem:        65617100     4980336    50350996      230152    11249168    60636764
Swap:       33520636         768    33519868
3
               total        used        free      shared  buff/cache   available
Mem:        65617100     4666344    60308892      230236     1528980    60950756
Swap:       33520636         768    33519868
#

memory cached dropped to 0, but used memory stays the same

#

cache dropped by 9gb system wide

hushed plank
#

if you run htop outside the container, and sort by memory, which processes are at the top?
(F6, then choose PERCENT_MEM)

shrewd jackal
hushed plank
#

is fast compiled without gc?

shrewd jackal
#

htop agrees

shrewd jackal
hushed plank
#

if you restart it, what is the initial RAM usage?

shrewd jackal
#

339M

shrewd jackal
#

we're up to 1gb again

shrewd jackal
#

just realized I accidentally removed the memory limit

shrewd jackal
#

looks like we stabilized at 2.18 GiB of leaked memory? renxSHRUG

#

(spikes are GCC)

fierce jetty
shrewd jackal
#

It has leaked to 5gb+ in the past
Also 2.18B is above 31bit limit

fierce jetty
shrewd jackal
#

No, that’s the memory usage of only the fast container

shrewd jackal
#

Thinking of adding a thread in #fast with the full details of each commit (which are currently posted to a private channel)

#

Talking about these messages:

#

hello (examples/hello_world.v) on c3dfe62d7b (2025-07-17 07:14:01)

      names      mean                stddev       min       max  samples  noisy  unit
 ----------  --------  --------------------  --------  --------  -------  -----  ----------------
    timings
       scan   7.410ms   Β± 63.149us (0.85%)   7.272ms   7.517ms       14
      parse  36.092ms  Β± 277.716us (0.77%)  35.583ms  36.644ms       14
      check  14.869ms  Β± 112.774us (0.76%)  14.668ms  15.042ms       14
  transform   3.986ms   Β± 32.058us (0.80%)   3.927ms   4.039ms       14
   markused   1.107ms    Β± 6.355us (0.57%)   1.100ms   1.118ms       14
       cgen  10.111ms  Β± 124.674us (1.23%)   9.891ms  10.276ms       14
 all stages  68.560ms  Β± 390.802us (0.57%)  67.815ms  69.143ms       14
      total  83.385ms  Β± 433.914us (0.52%)  82.500ms  84.037ms       14

  v  source
  v    size    489074          Β± 0 (0.00%)    489074    489074       20         bytes
  v   lines     18241          Β± 0 (0.00%)     18241     18241       20         lines
  v lines/s    218761       Β± 1139 (0.52%)    217059    221103       14         lines per second
  v   types       154          Β± 0 (0.00%)       154       154       20         types
  v modules         5          Β± 0 (0.00%)         5         5       20         modules
  v   files        67          Β± 0 (0.00%)        67        67       20         files

    c  code
    c  size     57264          Β± 0 (0.00%)     57264     57264       20         bytes
    c lines      2361          Β± 0 (0.00%)      2361      2361       20         lines

#

There’s 4 per commit with the different benchmarks

#

Extra thread because it’s just a lot of noise…

hushed plank
#

imho it looks nice

#

on desktop

shrewd jackal
#

Yeah let’s not talk about mobile…

hushed plank
#

what is the noisy column for?

shrewd jackal
#

But we just add more samples if it’s too high (limited to 60 or 80)

#

And that noisy is after discarding the top 1/3rd

#

So it pretty much is always false

hushed plank
#

if you remove it, and remove the unit columns from the report thread on discord, it may be more readable on mobile

shrewd jackal
#

removed, will let you know how details look in the future

shrewd jackal
#

or not, guess I broke things

#

panic!

#

I forgot to change the length of the fixed array used for calculating the length of the --- header underline

#

and then it tried to access the info table OOB

hushed plank
#

as Douglas Adams says, "Don't panic."

#

and make sure to have a towel

shrewd jackal
hushed plank
#

v should get a towel

shrewd jackal
#

i hope there's a restaurant somewhere at the edge of the universe or something

hushed plank
#

with a good enough towel, every place is at the edge of the universe restaurant

shrewd jackal
#

fixed πŸ™‚ (hopefully)

#

we'll know in ~5mins when its done benchmarking

#

hello (examples/hello_world.v) on 38beb23c6a (2025-07-25 12:15:05)

      names      mean                stddev       min       max  samples
 ----------  --------  --------------------  --------  --------  -------
    timings
       scan   7.492ms   Β± 83.658us (1.12%)   7.332ms   7.579ms       14
      parse  36.684ms  Β± 279.844us (0.76%)  36.158ms  37.078ms       14
      check  15.118ms  Β± 182.528us (1.21%)  14.808ms  15.420ms       14
  transform   4.042ms   Β± 34.838us (0.86%)   3.991ms   4.112ms       14
   markused   1.523ms   Β± 12.188us (0.80%)   1.506ms   1.545ms       14
       cgen   9.837ms   Β± 77.581us (0.79%)   9.741ms   9.968ms       14
 all stages  69.319ms  Β± 505.317us (0.73%)  68.218ms  70.215ms       14
      total  84.844ms  Β± 594.103us (0.70%)  83.602ms  85.726ms       14

  v  source
  v    size    489574          Β± 0 (0.00%)    489574    489574       20
  v   lines     18248          Β± 0 (0.00%)     18248     18248       20
  v lines/s    215086       Β± 1511 (0.70%)    212864    218272       14
  v   types       156          Β± 0 (0.00%)       156       156       20
  v modules         5          Β± 0 (0.00%)         5         5       20
  v   files        67          Β± 0 (0.00%)        67        67       20

    c  code
    c  size     51508          Β± 0 (0.00%)     51508     51508       20
    c lines      2051          Β± 0 (0.00%)      2051      2051       20

#

i don't think we can really improve it for mobile

hushed plank
#

yeah, and even there, in landscape mode, for me it looks nice

#

it wraps only in portrait mode

#

(I suppose there is no way to reduce the font size)

shrewd jackal
#

nope

#

best UX would be rendering it to an image but……………

#

anyway, I created #1398292135047856229

#

which will be populated from now onwards

hushed plank
#

in the latest table, the number of samples for hello, jumped to 27

#

(from 14 before that)

shrewd jackal
#

Essentially it does more samples if the stddev is too high

#

(Before discarding the top 1/3rd)

#

After discarding the top 1/3rd, the stddev is almost always no longer noisy

#

Why is it sometimes too high? Dunno. The server isn’t that busy renxSHRUG

#

Usually it’s very rare to go beyond the default 20

hushed plank
#

self (-no-skip-unused cmd/v) on 318394dd47 (2025-07-26 04:15:08)

#

can it also show the commit title after the hash?

#

(perhaps on its own line)

#

(or perhaps as a header, before the rest of the tables)

hushed plank
#

I'll turn off the notifications for the thread for me, otherwise it sounds like the beginning of a spam bot raiding πŸ˜„ ...

astral ore
shrewd jackal
#

Now you have πŸ™‚

hushed plank
#

the creators of the "twemoji" decided to confuse us

shrewd jackal
#

Twemoji is very inspired by apple.

hushed plank
#

I guess Tim Cook liked his charts colored that way

#

or Jobs, but I doubt it

shrewd jackal
#

Apple, Google, Samsung, Microsoft Teams, Twemoji, Huawei, Joypixels, LG, Telegram, Skype, SerenityOS, Toss Face, Play Station, OpenMoji, Icons8, emojidex, Facebook Messenger, Softbank, Mozilla: red.
Microsoft 3d Fluent, Microsoft, Docomo: blue.
Whatsapp, Facebook, HTC: green.
Noto, au: black.

#

Consensus seems to be red renxSHRUG

astral ore
# shrewd jackal

Well, so far you see a different color pattern for the bar chart and the line chart. Maybe we're seeing the line charts wrong and should be seeing it from right to left. Hahahah

shrewd jackal
#

I think the temperature association is correct.

#

Probably was meant for weather applications.

tall isle
#

trolling charts

shrewd jackal
#

should now no longer run if the 1min loadavg is >1

#

with a friendly message in #1398292135047856229

#

(because I need to check if running a measurement would delay the next because it thinks the server is busy)

#

rescheduled 30 commits for testing

hushed plank
#

latest 30?

shrewd jackal
#

latest 27 and 3 from a few days before

hushed plank
#

nice

shrewd jackal
#

data is already gone from the charts and will be repopulated once server is no longer busy

#

note for future self: set state to 0 (pending) in sqlite to reprocess commits

shrewd jackal
#

welp, I accidentally made the check into a busyloop, so the load average never drops below anymore

shrewd jackal
#

oldv -s is for some reason returning a non-zero status code

shrewd jackal
#

no idea why

hushed plank
#

network issue?

shrewd jackal
#

no

hushed plank
#

can you run it manually with -s and -v?

shrewd jackal
#

no because the container exits and I can't shell into it

hushed plank
#

oh, check the available free disk space too

shrewd jackal
#

hundreds of gb free

#

I added -v and will recompile

hushed plank
#

and potentially the permissions of the cache folder (or just remove it)

shrewd jackal
#

now it works

hushed plank
#

then imho most likely it was a network issue

shrewd jackal
#

it was retrying once a minute for the past day

hushed plank
#

they are usually transient in nature

shrewd jackal
#

I can give you hundreds of lines of the same error

#

since the entire container exits, all temporary storage (including the cloned vc history) is wiped everytime

#

and it's the same oldv binary

shrewd jackal
#

My suspicion was right, the benchmarking will make it think it’s busy: #1398292135047856229 message

#

Oh well

shrewd jackal
#

I forgot to restart the container that sends the messages in #fast

#

oh well

#

it will* work from now on again!!

-# should*

shrewd jackal
#

It might be a little too sensitive

hushed plank
shrewd jackal
#

no this issue was well before that + I doubt microsoft hosts on aws instead of azure

hushed plank
#

docker however may

#

V's own CI was affected mainly in the jobs that made requests to https://codeberg.org/ (for vinix) and to hub.docker.com (for the various qemu docker containers for s390, termux, the websocket tests etc)

#

what is the /etc/resolv.conf file in the container?

shrewd jackal
#

docker hub is in no way related once the container is built and everything was already cached locally since the start of the year

#

and again, this has been going on for days BEFORE the aws outage

hushed plank
#

the aws outage may have had earlier symptoms, affecting only some DNS requests

#

(and afaik you started to make changes in order to fix the oscillating up/down measurements in Saturday, not sure if that may have affected the container)

#

anyway it is just speculation; if you think it is not related, ok

shrewd jackal
#

sent the two commits back to be oven

#

idk what happened, the server was indeed busy at the time but it thought it wasn't renxSHRUG

hushed plank
#

are they now re-calculated?

#

I think the spike was due to using unsigned arithmetic in a very hot loop

#

but it was very surprising to me too

#

my hypothesis is that gcc on the host could not optimise the loop (which has division in it) as well, when it used unsigned numbers

#

i.e. it was inherent to the commit/host/gcc version, not due to the host load

#

with tcc, the diff does not seem to be big

#

I have not tried with clang yet

shrewd jackal
#

I edited the wrong sqlite file....

#

they should rerun now

hushed plank
#

yep, the spike is indeed gone now πŸ€”

shrewd jackal
#

gonna remove the "Server appears to be busy..."/"Server is no longer busy..." messages

#

it does a few random pauses through the day but I don't think it matters that sometimes measurements are delayed by a few mins

hushed plank
#

yes

shrewd jackal
#

Updated the bot that posts in #fast:

  1. suppresses embeds
  2. explicitly disallows pings (@ everyone was only implicitly disallowed)
  3. resolves github usernames! doing @anything will now update it to a github url (@leo -> [@leo](github.com/leo)); I may need to add exceptions to this rule, for e.g. @VCOMMITHASH or similar (being entirely uppercase might be a good heuristic?)
hushed plank
#

docs: fix from feedback in https://youtu.be/IuE6Bo1klK0?t=2051

shrewd jackal
#

it might've panicked

#

no it didn't πŸ€”

#

it sent the request to discord

#

failed to post webhook: SSL handshake failed

hushed plank
#

is it compiled with -d use_openssl ?

shrewd jackal
#

no

hushed plank
#

or perhaps there is/was a Discord network glitch

#

the SSL handshake failed is from:

vlib/net/openssl/ssl_connection.c.v:255:return error('SSL handshake failed (OpenSSL SSL_get_verify_result = ${res})')
vlib/net/mbedtls/ssl_connection.c.v:300:return error_with_code('SSL handshake failed', ret)
vlib/net/mbedtls/ssl_connection.c.v:469:return error_with_code('SSL handshake failed', ret)
vlib/net/mbedtls/ssl_connection.c.v:505:return error_with_code('SSL handshake failed', ret)
#

so if it is missing the OpenSSL, it is most likely from net.mbedtls and -d use_openssl could potentially fix it

shrewd jackal
#

it never happened before, might've just been really bad timing?

#

also keep in mind that this is running an ancient V version IIRC

hushed plank
#

we should probably make the errors more unique πŸ€”

#

the vlib/net/mbedtls and vlib/net/openssl wrappers have not changed much

shrewd jackal
#

right so the alpine image didn't have openssl headers, so I had them which means all the caches were invalidated and we also get latest V πŸ™ƒ

#

time to see if that magically fixes it

shrewd jackal
#

thoughts on upgrading the fast runner to the latest V and latest GCC/alpine packages?
we'll need some kind of process, or do we want to keep using jan 2025 V/GCC forever?

#

I don't think it'll affect much tbh. At the time, we were confused why the graph jumped 20% and we (incorrectly) attributed it to GCC changing, but it was because I changed the code to skip compiling the generated C code in the benchmarks

fresh remnant
#

Interesting idea... does V need to be changed to run these checks? If not, there's no real reason to update.

#

Could do it anyway on, say, quarterly basis - just in case there's a change in V that makes the tests run faster/more cleanly/etc.

shrewd jackal
#

it's just a byproduct of how docker image layer caching works, if I update the alpine registry which is step 3, all steps after that need to re-run, which includes V itself (in step 5)

#

so unless I explicitly chose to checkout a specific commit (instead of master), it'll get the latest V at the same time

#

not updating is more annoying, because that means I need to keep all the layer caches around.
I haven't been able to run docker image prune since the beginning of the year, I probably accumulated like 20-40gb of unused images by now

hushed plank
#

how about 1-2 times per year, once in January, and once in June?

#

the influence/overhead of the measuring script itself should be miniscule (single ms per commit), compared to the actual compilations, that are done anyway (tens or hundreds of ms)

shrewd jackal
hushed plank
#

can it be done in stages?

#

the first one just building the executable of the measuring script

#

and later the second one (build from scratch), having just git and the executables from the first

fresh remnant
#

If you really want to get crazy with it, the docker image could clone v and do v run fast.v - it would always be using latest V, then.

hushed plank
#

would not that produce more garbage that has to be collected later?

shrewd jackal
#

yeah but that means dynamically running containers which it doesn't currently. it's a single long lived container currently

hushed plank
#

afaik the goal currently is to remove those 40gb

#

are they from the accumulated oldv cache btw?

shrewd jackal
#

no.

#

I both clean those up in real time and even if I didn't, they would be in-ram only and be deleted when the container restarts (once a month when I do system upgrades)

hushed plank
#

then I do not understand what grows

shrewd jackal
#

V itself doesn't

hushed plank
#

are all images layered on top of each other?

shrewd jackal
#

all the other stuff I run on the server get updates

hushed plank
#

oh

shrewd jackal
#

which leads to old images

#

the setup itself in isolation works fine, but in combination with the rest of that runs on the server, it doesn't

#

also

#

this isn't an issue unless I need to change the fast.v script

#

since I can reuse the old container indefinitely

#

only changing the script needs the old caches

hushed plank
#

can you make a backup of just the V container/image as it is

#

then docker image prune

#

then import back just the backup?

#

I am generally of the mind that things that work, should not be changed

#

just backed up/migrated

#

i.e. avoiding updates in production systems, unless there is a compelling reason for them

#

and not just because some number changed somewhere

shrewd jackal
#

dockler image prune only clears unused images, it wouldn't affect the currently running fast instance.
However, it will remove all the caches, so if I need to rebuild it because I change fast.v, it will need to start from scratch and get the newest V/GCC

hushed plank
#

for me, that is not a problem, just say when it is done, and preferably do it at round-ish intervals, so that the corresponding jumps in the graphs, can be distinguished from the regular stream of changes

fresh remnant
#

Perhaps put the caches in a persistent data store, so they won't be affected by the main image changing.

#

"Volumes are often a better choice than writing data directly to a container, because a volume doesn't increase the size of the containers using it."

shrewd jackal
#

Volumes have nothing to do with this.

#

This is in the build process of an image, docker's own caching

fresh remnant
#

I was looking at the "However, it will remove all the caches, so if I need to rebuild it because I change fast.v, it will need to start from scratch and get the newest V/GCC" statement.

#

Unless a docker image prune would wipe out your volumes, too.

shrewd jackal
#

volumes have nothing to do with docker's build caching

#

they are for running containers

#

again, nothing to do with building

fresh remnant
#

So you want the image layers that are cached, but they keep expanding in size?

#

That's... not exactly caching, if they can change size...

#

Yes, it is faster to build a new image by using cached layers, but if this is something you don't do often, why would that matter? 10 min vs 10 sec is nothing when you rebuild as infrequently as this image is changed.

#

It's really only significant if you need to rebuild multiple times, very quickly.

shrewd jackal
#

this gotta be ragebait

hushed plank
#

imho no; we just do not understand the intricacies of the situation, to be more helpful

shrewd jackal
#
  1. I don't want them cached. You want them cached.
  2. The caches here aren't for speed. They exist so all builds of fast.v use the same GCC version and base alpine image.
fresh remnant
#

Correct. I'm throwing out ideas, in case one of them helps.

shrewd jackal
#

if the apk install gcc wasn't cached, it would get a new GCC version every time I need to recompile fast.v

hushed plank
#

can it pin a specific version instead?

shrewd jackal
#

I don't know, I just used what docker already gives me.

hushed plank
#

then it would not change, even if it is downloaded each time

fresh remnant
#

So you want to "pin" the version of gcc and V so that you know they aren't changing, and that would mean the only changes would be because of fast.v. Correct? If that is the case, yeah, pinning to a specific version/sha of gcc and V would be the simplest way to ensure that it kept those the same while rebuilding the image from scratch.

hushed plank
#

although that would cost more bandwidth sometimes as a negative

#

the version of V itself does not matter much

#

but the version of gcc does

#

since it does the optimisations, and even small changes can cause big jumps in the measured results

#

i.e. if we treat the V version as the independent variable, all the rest is preferable to stay the same

#

so that the results could be more easily comparable