> You pass... what? Are those seriously 420 *separate* include
> directories, meaning do you pass those 420 directories to the compiler
> via "-I"? Does that even fit on the command line?

That's the number of include directories in the whole project, including UT and integration test code.  A given invocation of g++ has a subset.  The compilation of the .cc in question has 19 -I flags.

When I do:
   rm /tmp/inc-list
   for arg in `find <project-root> -name "*.h"` ; do dirname $arg >> /tmp/inc-list ;done
   cat /tmp/inc-list | sort | uniq | wc -l
I get 428

> If you even on repeated jumps to the same location get the same
> performance, then that's it.

To clarify, if I do it again in the same session it's fast.  It's closing and opening Emacs again that a second attempt is slow.

> But you did byte-compile CEDET, did you?

Yes, I byte compiled CEDET.  I also moved the semanticdb location out of my NFS-hosted home directory to a localhost directory.  I also tried removing my c-mode hooks, since those are not byte compiled.  That did not improve performance.

> I remember testing out Boost a while ago though, and it was pretty much
> OK. Could you tell me which headers from Boost you're using?

I created a dependency file using g++ -MMD -MT flags and found 1166 Boost dependency headers.  (We normally exclude Boost headers from our auto dependency files because they significantly slowed down the initialization of make.)

> Could you look how much memory your Emacs process occupies?

I ran 'top' while I did the semantic-ia-fast-jump.  Memory usage didn't go above 1.2%.

> You could take a look with the ELP profiler what is taking so long.

Thanks for your guidance.

Looking at the output, it appears to be a matter of semanticdb-find-table-for-include* functions being called for each include (1238 is pretty close to 1166 Boost headers + 63 source tree headers).  I suppose cutting down on the 420 include paths wouldn't help since the performance seems to be a function of the number of files actually included.  Does that sound correct to you?

semantic-ia-fast-jump                                       1           54.430523     54.430523
semantic-analyze-current-context                            1           53.919461     53.919461
semantic-analyze-current-context-default                    1           53.919371     53.919371
semantic-calculate-scope                                    1           53.917867     53.917867
semantic-analyze-scoped-types                               1           53.904351     53.904351
semantic-analyze-scoped-types-default                       1           53.904343     53.904343
semanticdb-find-translate-path                              2           37.265932     18.632966
semanticdb-find-translate-path-default                      2           37.265915     18.6329575
semanticdb-find-translate-path-includes-default             2           37.265886     18.632943
semantic-ctxt-scoped-types                                  1           37.182581     37.182581
semantic-ctxt-scoped-types-c++-mode                         1           37.182572     37.182572
semanticdb-find-tags-by-class                               1           37.182231     37.182231
semanticdb-find-tags-collector                              1           37.182226     37.182226
semanticdb-find-translate-path-includes--internal           1           37.122164     37.122164
semanticdb-find-table-for-include                           1238        36.202804999  0.0292429765
semanticdb-find-table-for-include-c-mode                    1238        36.193572000  0.0292355185
semanticdb-find-table-for-include-default                   1238        36.186072999  0.0292294612
semantic-dependency-tag-file                                1193        31.026644999  0.0260072464
semantic-sort-tags-by-name-then-type-increasing             3310        13.898089999  0.0041988187
semanticdb-find-load-unloaded                               1186        4.8754469999  0.0041108322
semanticdb-file-table-object                                1186        4.849719      0.0040891391
semanticdb-find-load-unloaded-default                       1164        4.8460080000  0.0041632371
semantic-tag-lessp-name-then-type                           1464132     3.5792250000  2.444...e-06
semantic-dependency-find-file-on-path                       1180        2.6593979999  0.0022537271
semanticdb-get-database                                     131         2.432285      0.0185670610
semanticdb-create-database                                  134         2.2880920000  0.0170753134
semanticdb-load-database                                    129         1.9242220000  0.0149164496
semanticdb-create-table-for-file-not-in-buffer              4           0.6269579999  0.1567394999
semantic-find-file-noselect                                 4           0.617115      0.15427875
semantic-tag-copy                                           7799        0.5927260000  7.600...e-05
semantic-ia--fast-jump-helper                               1           0.511037      0.511037
semantic-something-to-tag-table                             5536        0.3624840000  6.547...e-05
semanticdb-find-tags-by-class-method                        2325        0.3351900000  0.0001441677
semanticdb-directory-loaded-p                               1143        0.2964010000  0.0002593184
semantic-find-tags-included                                 1163        0.2802740000  0.0002409922
semantic-find-tags-included-c-mode                          1163        0.2713890000  0.0002333525
semantic-tag-file-name                                      16898       0.2195980000  1.299...e-05
semanticdb-refresh-table                                    3508        0.1942109999  5.536...e-05
semanticdb-in-buffer-p                                      5881        0.1812609999  3.082...e-05
semanticdb-cache-filename                                   134         0.1676630000  0.0012512164
semanticdb-file-name-directory                              134         0.1620419999  0.0012092686
semanticdb-file-table                                       1146        0.1560520000  0.0001361710
semanticdb-table                                            1408        0.1548770000  0.0001099978
semantic-go-to-tag                                          1           0.149445      0.149445
semantic-tag-in-buffer-p                                    18135       0.1443660000  7.960...e-06
semanticdb-full-filename                                    4330        0.1235819999  2.854...e-05
semanticdb-file-loaded-p                                    134         0.1184639999  0.0008840597
semanticdb-find-need-cache-update-p                         2           0.116726      0.058363
semanticdb-get-table-index                                  1183        0.1166690000  9.862...e-05
semanticdb-find-incomplete-cache-entries-p                  2           0.116533      0.0582665
semantic--tag-put-property                                  15991       0.1156299999  7.230...e-06
semanticdb-needs-refresh-p                                  1161        0.1093860000  9.421...e-05
semanticdb-abstract-table-child-p                           2453        0.1019999999  4.158...e-05
semantic-tag-of-type-p                                      47130       0.0988480000  2.097...e-06
semantic-tag-include-filename                               2431        0.0965359999  3.971...e-05
semanticdb-file-table-object-put-hash                       1149        0.0847220000  7.373...e-05
semantic-tag-include-filename-default                       2431        0.0783770000  3.224...e-05
semanticdb-find-search-index                                1163        0.0747090000  6.423...e-05
semanticdb-equivalent-mode-for-search                       1162        0.0689760000  5.935...e-05
semantic-tag-faux-p                                         52790       0.0675790000  1.280...e-06
semanticdb-refresh-references                               4           0.0608010000  0.0152002500
semanticdb-add-reference                                    25          0.060522      0.00242088
semantic-tag-with-position-p                                9169        0.0527819999  5.756...e-06
semantic-new-buffer-fcn                                     5           0.048553      0.0097106
semanticdb-semantic-init-hook-fcn                           3           0.0481959999  0.0160653333
semantic-overlay-p                                          48977       0.0472740000  9.652...e-07
semantic--tag-link-to-buffer                                91          0.0410510000  0.0004511098
semanticdb-equivalent-mode                                  1162        0.0358810000  3.087...e-05
semantic--set-buffer-cache                                  3           0.034814      0.0116046666
semanticdb-synchronize-table                                6           0.0347900000  0.0057983333
semantic-tag-make-plist                                     18111       0.0330449999  1.824...e-06
semanticdb-get-tags                                         3498        0.0312509999  8.933...e-06
semantic--tag-unlink-from-buffer                            73          0.0297309999  0.0004072739
semantic-tag-prototype-p                                    3643        0.0294490000  8.083...e-06
semanticdb-project-database-file                            129         0.0274409999  0.0002127209
semanticdb-table-p                                          1162        0.0212240000  1.826...e-05
semanticdb-abstract-table-list-p                            129         0.0159929999  0.0001239767
semantic-tag                                                2120        0.0158770000  7.489...e-06
semanticdb-table-child-p                                    1163        0.0131949999  1.134...e-05
semanticdb-abstract-search-index-child-p                    1163        0.0129030000  1.109...e-05
semantic--tag-link-cache-to-buffer                          3           0.008203      0.0027343333
semantic-tag-components-with-overlays                       164         0.0080019999  4.879...e-05
semanticdb-find-throttle-active-p                           4874        0.0068840000  1.412...e-06
semanticdb-kill-hook                                        148         0.0060930000  4.116...e-05
semantic-tag-components-with-overlays-default               164         0.0058460000  3.564...e-05
semantic--tag-unlink-cache-from-buffer                      2           0.0056869999  0.0028434999
semantic-analyze-scoped-tags                                1           0.005408      0.005408
semantic-analyze-scoped-tags-default                        1           0.0054        0.0054
semantic-tag-prototype-p-default                            3643        0.0052740000  1.447...e-06
semanticdb-create-table-for-file                            3           0.004982      0.0016606666
semantic-idle-scheduler-function                            6           0.0032009999  0.0005334999
semantic-idle-core-handler                                  5           0.003149      0.0006298
semantic-tag-components                                     243         0.0030909999  1.272...e-05
semanticdb-file-table-object-from-hash                      1186        0.0030629999  2.582...e-06
semantic-analyze-scoped-type-parts                          4           0.002043      0.00051075
semanticdb-file-name-non-directory                          134         0.0019589999  1.461...e-05
semanticdb-get-database-tables                              129         0.001842      1.427...e-05
semantic-tag-components-c-mode                              243         0.0016879999  6.946...e-06
semanticdb-minor-mode-p                                     1285        0.0016569999  1.289...e-06
semantic-analyze-scope-nested-tags                          1           0.001587      0.001587
semantic-analyze-scope-nested-tags-default                  1           0.001579      0.001579
semanticdb-set-buffer                                       27          0.0009169999  3.396...e-05
semantic-tag-buffer                                         39          0.0007500000  1.923...e-05
semantic-analyze-find-tag-sequence                          1           0.000681      0.000681
semantic-analyze-find-tag-sequence-default                  1           0.000673      0.000673
semanticdb-get-buffer                                       27          0.0006640000  2.459...e-05
semanticdb-find-results-p                                   61          0.0005570000  9.131...e-06
semantic-up-context                                         7           0.000463      6.614...e-05
semantic-analyze-scope-calculate-access                     4           0.000452      0.000113
semantic-analyze-scope-calculate-access-default             4           0.0004250000  0.0001062500
semantic-find-first-tag-by-name                             14          0.0003890000  2.778...e-05
semantic-ctxt-current-assignment                            1           0.000387      0.000387
semantic-ctxt-current-assignment-default                    1           0.000378      0.000378
semantic--tag-run-hooks                                     180         0.0003619999  2.011...e-06
semantic-tag-components-default                             239         0.0003370000  1.410...e-06
semantic-get-local-variables                                2           0.000322      0.000161
semantic-narrow-to-context                                  2           0.000308      0.000154
semantic-idle-scheduler-refresh-tags                        32          0.0003079999  9.624...e-06
semantic-get-local-variables-c++-mode                       2           0.000301      0.0001505
semantic-tag-similar-p                                      9           0.0002890000  3.211...e-05
semantic-scope-cache                                        5           0.000283      5.66e-05
semantic-get-all-local-variables                            1           0.000281      0.000281
semantic-find-tag-by-overlay                                15          0.0002750000  1.833...e-05
semantic-get-all-local-variables-default                    1           0.000273      0.000273
semanticdb-cache-get                                        4           0.000272      6.8e-05
semantic-overlay-live-p                                     251         0.0002439999  9.721...e-07
semantic-get-local-arguments                                2           0.00024       0.00012
semantic-tag-similar-p-default                              9           0.000229      2.544...e-05
semantic-scope-reset-cache                                  3           0.0002239999  7.466...e-05
semantic-get-local-variables-default                        2           0.000212      0.000106
semanticdb-notify-references                                1           0.000197      0.000197
semantic-analyze-scope-lineage-tags                         2           0.00019       9.5e-05
semantic-beginning-of-command                               1           0.000182      0.000182
semanticdb-create-table                                     3           0.00018       6e-05
semantic-analyze-scope-lineage-tags-default                 2           0.000175      8.75e-05
semantic-beginning-of-command-default                       1           0.000174      0.000174
semantic-end-of-command                                     1           0.00017       0.00017
semantic-ctxt-current-symbol-and-bounds                     1           0.00017       0.00017
semantic-overlay-buffer                                     172         0.0001669999  9.709...e-07
semantic-end-of-command-default                             1           0.000163      0.000163
semantic-ctxt-current-symbol-and-bounds-default             1           0.000161      0.000161
semantic-current-tag-of-class                               7           0.0001559999  2.228...e-05
semantic-ctxt-current-symbol                                1           0.000145      0.000145
semantic-beginning-of-context                               2           0.000144      7.2e-05
semantic-end-of-context                                     2           0.000143      7.15e-05
semantic-current-tag                                        6           0.00014       2.333...e-05
semantic-narrow-to-tag                                      7           0.0001370000  1.957...e-05
semantic-ctxt-current-symbol-default                        1           0.000137      0.000137
semantic-beginning-of-context-default                       2           0.000132      6.6e-05
semantic-end-of-context-default                             2           0.00013       6.5e-05
semantic-make-overlay                                       92          0.0001249999  1.358...e-06
semantic-clear-toplevel-cache                               3           0.000114      3.8e-05
semanticdb-includes-in-table                                4           0.000108      2.7e-05
semantic-overlay-delete                                     74          0.0001049999  1.418...e-06
semantic-overlay-put                                        94          0.0001019999  1.085...e-06
semantic-analyze-context                                    1           9.8e-05       9.8e-05
semantic-analyze-type-constants-c-mode                      78          9.499...e-05  1.217...e-06
semantic-overlay-end                                        96          9.199...e-05  9.583...e-07
semantic-overlay-start                                      96          9.099...e-05  9.479...e-07
semantic-completable-tags-from-type                         4           9e-05         2.25e-05
semantic-analyze-scoped-inherited-tag-map                   10          8.700...e-05  8.700...e-06
semantic--tag-attribute-similar-p                           6           8.7e-05       1.45e-05
semantic-ctxt-current-function                              1           8.5e-05       8.5e-05
semantic--tag-similar-names-p                               6           7.9e-05       1.316...e-05
semantic-decorate-flush-pending-decorations                 32          7.899...e-05  2.468...e-06
semantic-ctxt-current-function-default                      1           7.7e-05       7.7e-05
semantic-default-c-setup                                    3           7.3e-05       2.433...e-05
semantic-analyze-split-name                                 4           6.8e-05       1.7e-05
semanticdb-set-dirty                                        3           6.500...e-05  2.166...e-05
semantic-scope-tag-clone-with-scope                         5           6.3e-05       1.26e-05
semantic-fetch-tags                                         34          5.999...e-05  1.764...e-06
semantic-get-local-arguments-default                        2           5.7e-05       2.85e-05
semantic-get-cache-data                                     3           5.6e-05       1.866...e-05
semantic-up-context-default                                 7           5.200...e-05  7.428...e-06
semantic-analyze-scoped-inherited-tags                      4           5.2e-05       1.3e-05
semantic-find-tags-by-scope-protection                      4           5.100...e-05  1.275...e-05
semantic--tag-attribute-similar-p-c-mode                    6           4.6e-05       7.666...e-06
semantic-lex-init                                           3           4.499...e-05  1.499...e-05
semantic-scope-cache-p                                      4           4.2e-05       1.05e-05
semantic--tag-similar-names-p-c-mode                        6           4.099...e-05  6.833...e-06
semantic-ctxt-current-class-list                            1           4e-05         4e-05
semantic-lex-spp-set-dynamic-table                          3           3.9e-05       1.3e-05
semantic-analyze-split-name-c-mode                          4           3.8e-05       9.5e-06
semantic-overlay-get                                        37          3.7e-05       1e-06
semantic-idle-scheduler-mode                                1           3.2e-05       3.2e-05
semantic-ctxt-current-class-list-default                    1           3.2e-05       3.2e-05
semantic-overlays-at                                        19          3.100...e-05  1.631...e-06
semantic-c-by--install-parser                               3           2.600...e-05  8.666...e-06
semantic-cache-data-to-buffer                               1           2.4e-05       2.4e-05
semantic-cache-data-post-command-hook                       1           2.4e-05       2.4e-05
semantic-tag-resolve-proxy                                  15          2.300...e-05  1.533...e-06
semantic-find-tags-by-scope-protection-c-mode               4           2.2e-05       5.5e-06
semantic-tag-type-superclasses                              10          2e-05         2.000...e-06
semantic-lex-spp-symbol-set                                 3           1.999...e-05  6.666...e-06
semantic--tag-attribute-similar-p-default                   6           1.800...e-05  3.000...e-06
semanticdb-expand-nested-tag-c++-mode                       14          1.800...e-05  1.285...e-06
semantic-clear-unmatched-syntax-cache                       3           1.300...e-05  4.333...e-06
semantic-scope-cache-child-p                                1           1.1e-05       1.1e-05
semantic-clear-parser-warnings                              3           9e-06         3e-06
semantic--tag-similar-names-p-default                       6           8e-06         1.333...e-06
semantic-lex-spp-save-table                                 3           7e-06         2.333...e-06
semantic-set-unmatched-syntax-cache                         3           6e-06         2e-06
semanticdb-find-result-nth                                  3           6e-06         2e-06
semantic-fetch-tags-fast                                    2           4e-06         2e-06
semantic-overlay-lists                                      3           4e-06         1.333...e-06
semanticdb-find-log-activity                                2           4e-06         2e-06
semantic-tag-name                                           3           3e-06         1e-06
semantic-idle-scheduler-setup-timers                        1           3e-06         3e-06
semanticdb-find-result-length                               1           3e-06         3e-06
semantic-equivalent-tag-p                                   1           2e-06         2e-06
semantic-refresh-tags-safe                                  2           2e-06         1e-06
semantic-analyze-dereference-alias                          1           2e-06         2e-06
semanticdb-find-log-new-search                              1           1e-06         1e-06