mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Member name lookup] Eliminate non-lazy member loading.
Lazy member loading has been in use and the default for several years now. However, the lazy loading was disabled for any type whose primary definition was parsed even though some of its extensions could have been deserialized, e.g., from a Clang module. Moreover, the non-lazy path walked all of the extensions of such a type for all member name lookup operations. Faced with a large number of extensions to the same type (in my example, 6,000), this walk of the list of the extensions could dominate type-checking time. Eliminate all effects of the `-disable-named-lazy-member-loading` flag, and always use the "lazy" path, which effectively does no work for parsed type definitions and extensions thereof. The example with 6,000 extensions of a single type goes from type checking in 6 seconds down to type checking in 0.6 seconds, and name lookup completely disappears from the profiling trace. The deleted tests relied on the flag that is now inert. They aren't by themselves providing much value nowadays, and it's better to have the simpler (and more efficient) implementation of member name lookup be the only one.
This commit is contained in:
@@ -682,8 +682,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
/*default*/ false);
|
||||
Opts.UseClangFunctionTypes |= Args.hasArg(OPT_use_clang_function_types);
|
||||
|
||||
Opts.NamedLazyMemberLoading &= !Args.hasArg(OPT_disable_named_lazy_member_loading);
|
||||
|
||||
if (Args.hasArg(OPT_emit_fine_grained_dependency_sourcefile_dot_files))
|
||||
Opts.EmitFineGrainedDependencySourcefileDotFiles = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user