From 7070384972fa53dcc1d0cb5d171ab38000fd5ea8 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 16 Jan 2019 17:57:06 -0500 Subject: [PATCH] add a couple timing categories to `ENABLE_TIMINGS` (#30718) --- src/dump.c | 2 ++ src/gf.c | 2 ++ src/timing.h | 7 ++++++- src/toplevel.c | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dump.c b/src/dump.c index d29ae8565bdde..472e8752d040e 100644 --- a/src/dump.c +++ b/src/dump.c @@ -2649,6 +2649,7 @@ JL_DLLEXPORT void jl_fill_argnames(jl_array_t *data, jl_array_t *names) JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) { + JL_TIMING(SAVE_MODULE); char *tmpfname = strcat(strcpy((char *) alloca(strlen(fname)+8), fname), ".XXXXXX"); ios_t f; jl_array_t *mod_array = NULL, *udeps = NULL; @@ -3045,6 +3046,7 @@ static int trace_method(jl_typemap_entry_t *entry, void *closure) static jl_value_t *_jl_restore_incremental(ios_t *f, jl_array_t *mod_array) { + JL_TIMING(LOAD_MODULE); jl_ptls_t ptls = jl_get_ptls_states(); if (ios_eof(f) || !jl_read_verify_header(f)) { ios_close(f); diff --git a/src/gf.c b/src/gf.c index 93d1944d99df5..f6716c5f18aff 100644 --- a/src/gf.c +++ b/src/gf.c @@ -1597,6 +1597,7 @@ JL_DLLEXPORT void jl_method_table_disable(jl_methtable_t *mt, jl_method_t *metho JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method, jl_tupletype_t *simpletype) { + JL_TIMING(ADD_METHOD); assert(jl_is_method(method)); assert(jl_is_mtable(mt)); jl_value_t *type = method->sig; @@ -1801,6 +1802,7 @@ jl_method_instance_t *jl_method_lookup(jl_methtable_t *mt, jl_value_t **args, si JL_DLLEXPORT jl_value_t *jl_matching_methods(jl_tupletype_t *types, int lim, int include_ambiguous, size_t world, size_t *min_valid, size_t *max_valid) { + JL_TIMING(METHOD_MATCH); jl_value_t *unw = jl_unwrap_unionall((jl_value_t*)types); if (jl_is_tuple_type(unw) && jl_tparam0(unw) == jl_bottom_type) return (jl_value_t*)jl_alloc_vec_any(0); diff --git a/src/timing.h b/src/timing.h index 2eab5e325e312..fc4f213ba48f1 100644 --- a/src/timing.h +++ b/src/timing.h @@ -55,6 +55,7 @@ static inline uint64_t rdtscp(void) X(LLVM_MODULE_FINISH), \ X(LLVM_EMIT), \ X(METHOD_LOOKUP_COMPILE), \ + X(METHOD_MATCH), \ X(TYPE_CACHE_LOOKUP), \ X(TYPE_CACHE_INSERT), \ X(STAGED_FUNCTION), \ @@ -63,7 +64,11 @@ static inline uint64_t rdtscp(void) X(AST_UNCOMPRESS), \ X(SYSIMG_LOAD), \ X(SYSIMG_DUMP), \ - X(NATIVE_DUMP), + X(NATIVE_DUMP), \ + X(ADD_METHOD), \ + X(LOAD_MODULE), \ + X(SAVE_MODULE), \ + X(INIT_MODULE), enum jl_timing_owners { #define X(name) JL_TIMING_ ## name diff --git a/src/toplevel.c b/src/toplevel.c index 8082cd61a42aa..2a02f51a499a3 100644 --- a/src/toplevel.c +++ b/src/toplevel.c @@ -63,6 +63,7 @@ static jl_function_t *jl_module_get_initializer(jl_module_t *m JL_PROPAGATES_ROO void jl_module_run_initializer(jl_module_t *m) { + JL_TIMING(INIT_MODULE); jl_function_t *f = jl_module_get_initializer(m); if (f == NULL) return;