mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibJS+WebContent: Cache the resolved system time zone identifier
Even though the underlying time zone is already cached by LibUnicode, JS performs additional expensive lookups with that time zone. There's no need to do those lookups again until the system time zone has changed.
This commit is contained in:
parent
25e5ccd376
commit
5ee92af1d9
Notes:
github-actions[bot]
2024-09-03 17:27:07 +00:00
Author: https://github.com/trflynn89
Commit: 5ee92af1d9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1266
4 changed files with 18 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <AK/Enumerate.h>
|
||||
#include <LibCore/Environment.h>
|
||||
#include <LibJS/Runtime/ArrayBuffer.h>
|
||||
#include <LibJS/Runtime/Date.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibTest/JavaScriptTestRunner.h>
|
||||
#include <LibUnicode/TimeZone.h>
|
||||
|
@ -109,6 +110,7 @@ TESTJS_GLOBAL_FUNCTION(set_time_zone, setTimeZone)
|
|||
return vm.throw_completion<JS::InternalError>(MUST(String::formatted("Could not set time zone: {}", result.error())));
|
||||
}
|
||||
|
||||
JS::clear_system_time_zone_cache();
|
||||
Unicode::clear_system_time_zone_cache();
|
||||
tzset();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue