This commit removed all default CXXFLAGS from RbConfig that were previously set, including $optflags, which has -O3.
Many of the C++ extensions like sassc use extconf/mkmf to compile, and they have assumed optflags are already set for CXXFLAGS. Without -O3 as part of the default, the extensions are compiled without any optimizations and thus become extremely slow.
It is difficult for a regular user to find out the reason of the slowness, nor to say figuring out how to override CXXFLAGS for a native extension.
I'm not sure what was the reason of the change, but I think we should at least set $optflags in CXXFLAGS by default.
This is NG. Some OSes (if I remember correctly it was Arch when we found this) ship clang and g++ combination. They happen to have -O3 in common but not everything. It was a wrong idea first place for us to share $optflags. There's nothing we can do here. Please specify $CXXFLAGS individually.