You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analyzing with this patch drops the offending function from the default output.
I suspect this is due to the recursive nature of primary_expression_node::is_fold_expression.
This is the stack when first breaking at the offending call while debugging regression-tests/pure2-print.cpp2.
From level 18 to 1, those are all calls to is_fold_expression members.
And if primary_expression_node contains an expression_list_node, that can repeat, ad infinitum.
The text was updated successfully, but these errors were encountered:
Thanks @JohelEGP
That's strange... FWIW, on my laptop, a full compile of cppfront using GCC 10 and Clang 12 takes 17 seconds (each) with default optimizations, 25 and 33 seconds (respectively) with -O2.
Update: And MSVC 2022 takes 6 seconds in debug and 16 seconds with -O2.
In analyzing cppfront with Clang Build Analyzer, I noticed a very odd item:
These are only the first two items.
primary_expression_node::is_fold_expression
is exorbitantly expensive to compile.I have a matrix of compilers (Clang, GCC) × configurations (
Debug
,Release
).Only Clang
Release
is affected, its compilation time increasing by 145 s.Normally:
Debug
Release
With the patch below:
Debug
Release
This git patch removes the offending call that makes it expensive to optimize.
Analyzing with this patch drops the offending function from the default output.
I suspect this is due to the recursive nature of
![1700837777](https://private-user-images.githubusercontent.com/21071787/285487935-2af73103-af7b-4d45-8863-ce503a61eb36.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3ODAzMDEsIm5iZiI6MTcyMTc4MDAwMSwicGF0aCI6Ii8yMTA3MTc4Ny8yODU0ODc5MzUtMmFmNzMxMDMtYWY3Yi00ZDQ1LTg4NjMtY2U1MDNhNjFlYjM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI0VDAwMTMyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlNWIxMDNkMzcyY2VkY2ViZDY2NmY2NDczNjZkYjg2ZmEwMTllMGExNjg5OTYzODhlMjE3N2NhZWM3YjEwZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.64R4YJ6Gh0xInLnNBxrgNbHsjvv9_wxnMvc0_XQ2mNo)
primary_expression_node::is_fold_expression
.This is the stack when first breaking at the offending call while debugging
regression-tests/pure2-print.cpp2
.From level 18 to 1, those are all calls to
is_fold_expression
members.And if
primary_expression_node
contains anexpression_list_node
, that can repeat, ad infinitum.The text was updated successfully, but these errors were encountered: