You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/06/04 21:57:00 UTC

[jira] [Commented] (IMPALA-8578) Reduce code in metric headers

    [ https://issues.apache.org/jira/browse/IMPALA-8578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16856147#comment-16856147 ] 

ASF subversion and git services commented on IMPALA-8578:
---------------------------------------------------------

Commit e78e6f0c260b342c67e055656d239438bca13288 in impala's branch refs/heads/master from Tim Armstrong
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=e78e6f0 ]

IMPALA-8578: part 1: reduce dependencies on *metrics.h

Before this patch there were 100s of compilation units that pulled in
metrics.h and the significant amount of code in that header. It was
painfully slow to recompile after changes to that file. The patch
reduces that significantly and mostly eliminates transitive inclusions
via other headers.

* Add metrics-fwds.h with forward declarations needed to have pointers
  to the various classes.
* Update headers to use metrics-fwds.h and move includes of *metrics.h
  to the .cc files.
* Add includes, etc to fix compilation errors where files depended
  on transitively-included headers from *metrics.h

This shaved about 30s off the build time on Jenkins - about a 4%
speedup.

I didn't end up removing anything from the headers - that is a bit
more work since most of the classes are templatized and need to
be explicitly instantiated in .cc files if functions are not
all defined in the headers.

Testing:
Ran a core build

Change-Id: Ie2942366cab5421f2db7c27e7da712ea6f775fdb
Reviewed-on: http://gerrit.cloudera.org:8080/13491
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Tim Armstrong <ta...@cloudera.com>


> Reduce code in metric headers
> -----------------------------
>
>                 Key: IMPALA-8578
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8578
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Tim Armstrong
>            Assignee: Tim Armstrong
>            Priority: Major
>
> metrics.h and other metric headers are included a lot of places and there is a lot of code in the header that has very few callers. It appears to be pulled into several hundred compilation units, increasing the compile time of each of those and forcing recompilation when the headers are changed.
> Some ideas:
> * Move function implementations to .cc files. E.g. ToJson() and ToPrometheus() don't need to be inlined.
> * Move MetricGroup to its own file
> * Try to see if we can use forward declarations in more places to avoid including it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org