I have default.xml overridden into my custom_theme but is actually an empty file(need not worry about the content). I want to prevent magento 2 from calling this empty file so as to improve the system performance from the optimization perspective. Please help. Thanks in advance!!
There is no need to prevent Magento to load your overrided layout, that would be against logic and this is what we call: Magento Fallback System.
Since you have placed your default.xml in your current theme, it means that you tell to Magento take this file first, and after you want to tell him don't take it ! it doesn't make sense.
When you override or extends some layout, according to the Magento Fallback System, Magento collects layout files in the following order:
Current theme layouts:
Ancestor themes layouts, starting from the most distant ancestor, recursively until a theme with no parent is reached:
Module layouts for the frontend area:
Module layouts for the base area:
So if you don't want Magento load your
default.xmlfile, remove it, it has no utility and still less impact on performances.
More informations in Magento Devdocs