Metrics used:
x isa Collection[Animal]
)x isa Collection[E]
)
# Display stats about compilation process
#
# Metrics used:
#
# * type tests against resolved types (`x isa Collection[Animal]`)
# * type tests against unresolved types (`x isa Collection[E]`)
# * type tests skipped
# * type tests total
fun display_stats
do
if self.modelbuilder.toolcontext.opt_typing_test_metrics.value then
print "# static count_type_test"
print "\tresolved:\tunresolved\tskipped\ttotal"
var count_type_test_total = init_count_type_test_tags
count_type_test_resolved["total"] = 0
count_type_test_unresolved["total"] = 0
count_type_test_skipped["total"] = 0
count_type_test_total["total"] = 0
for tag in count_type_test_tags do
count_type_test_total[tag] = count_type_test_resolved[tag] + count_type_test_unresolved[tag] + count_type_test_skipped[tag]
count_type_test_resolved["total"] += count_type_test_resolved[tag]
count_type_test_unresolved["total"] += count_type_test_unresolved[tag]
count_type_test_skipped["total"] += count_type_test_skipped[tag]
count_type_test_total["total"] += count_type_test_total[tag]
end
var count_type_test = count_type_test_total["total"]
var tags = count_type_test_tags.to_a
tags.add("total")
for tag in tags do
printn tag
printn "\t{count_type_test_resolved[tag]} ({div(count_type_test_resolved[tag],count_type_test)}%)"
printn "\t{count_type_test_unresolved[tag]} ({div(count_type_test_unresolved[tag],count_type_test)}%)"
printn "\t{count_type_test_skipped[tag]} ({div(count_type_test_skipped[tag],count_type_test)}%)"
printn "\t{count_type_test_total[tag]} ({div(count_type_test_total[tag],count_type_test)}%)"
print ""
end
end
end
src/compiler/abstract_compiler.nit:1235,2--1272,4
redef fun display_stats
do
super
if self.modelbuilder.toolcontext.opt_tables_metrics.value then
display_sizes
end
if self.modelbuilder.toolcontext.opt_isset_checks_metrics.value then
display_isset_checks
end
var tc = self.modelbuilder.toolcontext
tc.info("# implementation of method invocation",2)
var nb_invok_total = modelbuilder.nb_invok_by_tables + modelbuilder.nb_invok_by_direct + modelbuilder.nb_invok_by_inline
tc.info("total number of invocations: {nb_invok_total}",2)
tc.info("invocations by VFT send: {modelbuilder.nb_invok_by_tables} ({div(modelbuilder.nb_invok_by_tables,nb_invok_total)}%)",2)
tc.info("invocations by direct call: {modelbuilder.nb_invok_by_direct} ({div(modelbuilder.nb_invok_by_direct,nb_invok_total)}%)",2)
tc.info("invocations by inlining: {modelbuilder.nb_invok_by_inline} ({div(modelbuilder.nb_invok_by_inline,nb_invok_total)}%)",2)
end
src/compiler/separate_compiler.nit:1161,2--1177,4