Skip to content

Commit

Permalink
Idle sweeping should not schedule a timer callback for more sweeping.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=259023
rdar://111962239

Reviewed by Wenson Hsieh.

Idle time work should only do work during idle time.  Starting a timer as we come out of
idle will add work that contends with non-idle activity.

* Source/JavaScriptCore/heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::doSweep):

Canonical link: https://commits.webkit.org/265884@main
  • Loading branch information
Mark Lam committed Jul 9, 2023
1 parent b19f774 commit 7e5881c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/JavaScriptCore/heap/IncrementalSweeper.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012-2021 Apple Inc. All rights reserved.
* Copyright (C) 2012-2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -78,7 +78,8 @@ void IncrementalSweeper::doSweep(VM& vm, MonotonicTime deadline, SweepTrigger tr
if (MonotonicTime::now() < deadline)
continue;

scheduleTimer();
if (trigger == SweepTrigger::Timer)
scheduleTimer();
return;
}

Expand Down

0 comments on commit 7e5881c

Please sign in to comment.