Open DinoV opened 3 years ago
Do you know any existing such related metrics? Or can it be better to create a separate 'compiler step' just for testing on dev environment?
HI @hexcubator , not sure I understand the question about separate compiler step -- what are you aiming to achieve?
We don't have metrics collection as described here yet; the only related thing we have is that the compiler does emit warnings when it falls back to dynamic behavior.
I was aiming to create another check for the case when, as you mentioned, compiler does emit warnings when it falls back to dynamic behavior
, do some kind of logging, in dev environment (preferably testing). We can, furthermore, create some common cases in JIT testing for static functions to create attributes like perf
or time
command on Linux.
Currently the dynamic fallback warnings we have you can find by grepping Lib/compiler/static/
for perf_warning
. These warnings are always collected during compilation, but not surfaced anywhere currently. If you dig a bit more into the internals, they should be available from the StrictSourceFileLoader
as self.compiler.error_sink.warnings
.
It'd be nice if we had some metrics around when/where we were emitting code in the static compiler which used static features. This could either be full statistics on opcodes used, or just individual stats on when we hit specific features. The compiler should expose some way to enable collecting this data and then we could log it out / dump it on compile.