Bug 214907 - REGRESSION(r264476): Calling systemHasAC() regresses launch time performance
Summary: REGRESSION(r264476): Calling systemHasAC() regresses launch time performance
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-28 19:28 PDT by Jer Noble
Modified: 2020-07-29 14:22 PDT (History)
5 users (show)

See Also:


Attachments
Patch (7.33 KB, patch)
2020-07-28 19:33 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2020-07-28 19:28:06 PDT
REGRESSION(r264476): Calling systemHasAC() regresses launch time performance
Comment 1 Jer Noble 2020-07-28 19:28:39 PDT
<rdar://problem/66191430>
Comment 2 Jer Noble 2020-07-28 19:33:28 PDT
Created attachment 405434 [details]
Patch
Comment 3 Eric Carlson 2020-07-29 09:38:51 PDT
Comment on attachment 405434 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405434&action=review

> Source/WebCore/platform/cocoa/PowerSourceNotifier.mm:44
>      if (status == NOTIFY_STATUS_OK)
>          m_tokenID = token;

If notify_register_dispatch failed, should this just return early instead of potentially calling notifyPowerSourceChanged()?
Comment 4 Jer Noble 2020-07-29 14:19:02 PDT
(In reply to Eric Carlson from comment #3)
> Comment on attachment 405434 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405434&action=review
> 
> > Source/WebCore/platform/cocoa/PowerSourceNotifier.mm:44
> >      if (status == NOTIFY_STATUS_OK)
> >          m_tokenID = token;
> 
> If notify_register_dispatch failed, should this just return early instead of
> potentially calling notifyPowerSourceChanged()?

I don't think so. Even if the register command fails, we'll still want to update the AC state next run loop.
Comment 5 EWS 2020-07-29 14:22:48 PDT
Committed r265056: <https://trac.webkit.org/changeset/265056>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405434 [details].