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

checker,cgen: implement v.profile.on/1, support [if profile] and -d no_profile_startup (#13232)

This commit is contained in:
Delyan Angelov
2022-01-21 03:26:05 +02:00
committed by GitHub
parent 9e0156b46a
commit 295156e054
11 changed files with 97 additions and 7 deletions

View File

@@ -84,8 +84,16 @@ NB: the build flags are shared with the run command too:
b) how much *nanoseconds in total* it took
c) an average for each function (i.e. (b) / (a) )
d) the function name
NB: if you want to output the profile info to stdout, use `-profile -`.
NB: you can use `import v.profile`, and then calls to `profile.on(false)`
and `profile.on(true)` to temporarily turn it off and on again.
NB: if you do NOT want the profile to contain information from before your
program's `fn main()` starts, pass `-d no_profile_startup` too.
(V constants, and module init() functions are evaluated before `main()` is called)
-message-limit <limit>
The maximum amount of warnings / errors / notices, that will be accumulated (defaults to 100).
The checker will abort prematurely once this limit has been reached.