In C++ (at least as of a decade ago), there was speed advantage in defining the body of a class method in the header file, where the class is defined. No function call overhead was suffered because, in the compilation process, the invocation of such functions was replaced by the code in the body of the function. Subsquently, all source level optimizations (and all optimizations beyond source level) could be brought to bear.
Is there an analogous advantage to putting the body of class methods in the classdef file itself rather than in a separate m-file? I'm speaking specifically about the case where one defines a @myclass/myclass.m, with method m-files in the directory @myclass. The two options I'm considering is to have the code for the body of a method mymethod put into the classdef in @myclass/myclass.m versus being in a separate file @myclass/mymethod.m.
However, an very related auxiliary question would be how those two options compare with having everything defined in a myclass.m file, with no folder @myclass.
Please note that I have previously posted this to usenet