Re: [webkit-dev] Compile times and class-scoped enums

2023-01-23 Thread Jer Noble via webkit-dev


> On Jan 23, 2023, at 11:05 AM, Geoffrey Garen  wrote:
> 
>>> However, this change requires moving class-scoped enums out into the 
>>> namespace scope.
>> 
>> Seems worthwhile. Doesn’t seem to me like it would have far reaching effects.
> 
> I agree.
> 
>> +using Type = DOMAudioSessionType;
> 
> Did you do this to make the patch smaller, or do you prefer this style?

Yes to both. IMO, there’s nothing inherently wrong with having an enum scoped 
to a class apart from that makes it impossible to forward declare. If there was 
some language supported mechanism to forward-declare class-scoped enums, we’d 
probably just do that instead. So, this pattern of declaring the enum outside 
of a class and pulling it into the class with a using declaration is a bit 
ugly, insofar as it pollutes the global namespace, but it does allow you to 
continue to use the type as if it were file scoped.

-Jer___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Compile times and class-scoped enums

2023-01-23 Thread Geoffrey Garen via webkit-dev
>> However, this change requires moving class-scoped enums out into the 
>> namespace scope.
> 
> Seems worthwhile. Doesn’t seem to me like it would have far reaching effects.

I agree.

> +using Type = DOMAudioSessionType;

Did you do this to make the patch smaller, or do you prefer this style?

Thanks,
Geoff___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Compile times and class-scoped enums

2023-01-20 Thread Darin Adler via webkit-dev
> On Jan 20, 2023, at 9:50 AM, Jer Noble via webkit-dev 
>  wrote:
> 
> I attempted to address this in , 
> which (on this machine) reduces the total compile time of Document.h in the 
> WebCore project from about 1000s to about 200s.

That’s good.

> However, this change requires moving class-scoped enums out into the 
> namespace scope.

Seems worthwhile. Doesn’t seem to me like it would have far reaching effects.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Compile times and class-scoped enums

2023-01-20 Thread Michael Catanzaro via webkit-dev
On Fri, Jan 20 2023 at 09:50:05 AM -0800, Jer Noble via webkit-dev 
 wrote:
However, this requires a significant coding style change, both to 
existing code and new code, and as such, it should probably be 
discussed here. So, what do people think? Is the change in coding 
style (moving class-scoped enums out into namespace scope) worth 
doing if it means a significant increases in compile speeds?


My $0.02: it's awful but worth it. That's a ridiculous speedup. Nice.


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev