1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v: add more timing points

This commit is contained in:
Delyan Angelov 2021-06-06 12:23:00 +03:00
parent 27f3737c5a
commit 007ba5178e
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 6 additions and 8 deletions

View File

@ -53,6 +53,7 @@ fn main() {
}
timers.start('v start')
timers.show('v start')
timers.start('parse_CLI_args')
args := os.args[1..]
// args = 123
if args.len == 0 || args[0] in ['-', 'repl'] {
@ -71,16 +72,11 @@ fn main() {
}
args_and_flags := util.join_env_vflags_and_os_args()[1..]
prefs, command := pref.parse_args(external_tools, args_and_flags)
if prefs.is_verbose {
// println('args= ')
// println(args) // QTODO
// println('prefs= ')
// println(prefs) // QTODO
}
if prefs.use_cache && os.user_os() == 'windows' {
eprintln('-usecache is currently disabled on windows')
exit(1)
}
timers.show('parse_CLI_args')
// Start calling the correct functions/external tools
// Note for future contributors: Please add new subcommands in the `match` block below.
if command in external_tools {

View File

@ -458,8 +458,7 @@ fn (mut v Builder) setup_output_name() {
fn (mut v Builder) vjs_cc() bool {
vexe := pref.vexe_path()
vdir := os.dir(vexe)
// Just create a C/JavaScript file and exit
// for example: `v -o v.c compiler`
// Just create a .c/.js file and exit, for example: `v -o v.c compiler`
ends_with_c := v.pref.out_name.ends_with('.c')
ends_with_js := v.pref.out_name.ends_with('.js')
if ends_with_c || ends_with_js {
@ -489,8 +488,11 @@ fn (mut v Builder) vjs_cc() bool {
}
}
}
msg_mv := 'os.mv_by_cp $v.out_name_c => $v.pref.out_name'
util.timing_start(msg_mv)
// v.out_name_c may be on a different partition than v.out_name
os.mv_by_cp(v.out_name_c, v.pref.out_name) or { panic(err) }
util.timing_measure(msg_mv)
return true
}
return false