Skip to content

Commit

Permalink
Merge branch 'master' into change_typ_to_styp
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 authored Oct 21, 2024
2 parents 85e10cf + c55a75f commit 32ad328
Show file tree
Hide file tree
Showing 24 changed files with 587 additions and 111 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/compare_pr_to_master.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ fn gcommit() string {
}

fn r(cmd string) {
os.system(cmd)
res := os.system(cmd)
if res != 0 {
eprintln('> failed running: `${cmd}`')
exit(1)
}
}

fn xtime(cmd string) {
Expand Down Expand Up @@ -72,5 +76,6 @@ fn main() {
} else {
vcompare('./vold', './vnew')
}
r('rm -rf hw nv ov hw.exe nv.exe ov.exe hw.c nv.c ov.c')
println('Done.')
}
3 changes: 2 additions & 1 deletion cmd/tools/vast/vast.v
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,8 @@ fn (t Tree) comptime_call(node ast.ComptimeCall) &Node {
obj.add_terse('method_name', t.string_node(node.method_name))
obj.add_terse('left', t.expr(node.left))
obj.add_terse('is_vweb', t.bool_node(node.is_vweb))
obj.add_terse('vweb_tmpl', t.string_node(node.vweb_tmpl.path))
obj.add_terse('is_veb', t.bool_node(node.is_veb))
obj.add_terse('veb_tmpl', t.string_node(node.veb_tmpl.path))
obj.add_terse('args_var', t.string_node(node.args_var))
obj.add_terse('has_parens', t.bool_node(node.has_parens))
obj.add_terse('is_embed', t.bool_node(node.is_embed))
Expand Down
22 changes: 17 additions & 5 deletions cmd/tools/vrepeat.v
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,7 @@ fn (mut context Context) show_diff_summary() {
}
mut tcomparison := 'base '
if r.atiming.average != base {
if r.atiming.average < base {
tcomparison = '${base / r.atiming.average:4.2f}x ${c(tgreen, 'faster')}'
} else {
tcomparison = '${r.atiming.average / base:4.2f}x ${c(tcyan, 'slower')}'
}
tcomparison = readable_comparison(r.atiming.average, base, cpercent)
}
gcmd := c(tgreen, r.cmd)
println(' ${first_marker}${(i + 1):3} ${comparison:7} ${tcomparison:5} ${r.atiming} `${gcmd}`')
Expand All @@ -354,6 +350,22 @@ fn (mut context Context) show_diff_summary() {
}
}

fn readable_comparison(tcurrent f64, tbase f64, cpercent f64) string {
is_same := math.abs(cpercent) <= 0.15
mut label := '~same~'
if tcurrent < tbase {
if !is_same {
label = c(tgreen, 'faster')
}
return '${tbase / tcurrent:4.2f}x ${label}'
} else {
if !is_same {
label = c(tcyan, 'slower')
}
return '${tcurrent / tbase:4.2f}x ${label}'
}
}

fn (mut context Context) show_summary_title(line string) {
mut msg := [line]
if context.nmins > 0 {
Expand Down
1 change: 1 addition & 0 deletions vlib/orm/orm_insert_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ fn test_the_result_of_insert_should_be_the_last_insert_id() {
insert address into Address
} or { panic(err) }
dump(aid1)
assert aid1 == 1
aid2 := sql db {
insert address into Address
} or { panic(err) }
Expand Down
Loading

0 comments on commit 32ad328

Please sign in to comment.