[gjs] runtime: sync default GC parameters with Firefox defaults
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] runtime: sync default GC parameters with Firefox defaults
- Date: Sun, 2 Apr 2017 03:27:18 +0000 (UTC)
commit 867c1bbc7db64f96910365f61ad2b21e029e40a1
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Tue Feb 18 17:54:57 2014 +0100
runtime: sync default GC parameters with Firefox defaults
Defaults taken from Firefox 27, but they are probably good
for Firefox 24 too.
gnome-shell might want to have different defaults, because
10ms of incremental GC slice is not good for a compositor,
while 100MB of JS heap to trigger high-frequency GC is not
ok for a background service.
https://bugzilla.gnome.org/show_bug.cgi?id=724797
gjs/runtime.cpp | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/gjs/runtime.cpp b/gjs/runtime.cpp
index e69d679..c98b0b6 100644
--- a/gjs/runtime.cpp
+++ b/gjs/runtime.cpp
@@ -299,9 +299,22 @@ gjs_runtime_for_current_thread(void)
data = g_new0(RuntimeData, 1);
JS_SetRuntimePrivate(runtime, data);
+ // commented are defaults in moz-24
JS_SetNativeStackQuota(runtime, 1024*1024);
- JS_SetGCParameter(runtime, JSGC_MAX_BYTES, 0xffffffff);
+ JS_SetGCParameter(runtime, JSGC_MAX_MALLOC_BYTES, 128*1024*1024);
+ JS_SetGCParameter(runtime, JSGC_MAX_BYTES, -1);
JS_SetGCParameter(runtime, JSGC_MODE, JSGC_MODE_INCREMENTAL);
+ JS_SetGCParameter(runtime, JSGC_SLICE_TIME_BUDGET, 10); /* ms */
+ // JS_SetGCParameter(runtime, JSGC_HIGH_FREQUENCY_TIME_LIMIT, 1000); /* ms */
+ JS_SetGCParameter(runtime, JSGC_DYNAMIC_MARK_SLICE, true);
+ JS_SetGCParameter(runtime, JSGC_DYNAMIC_HEAP_GROWTH, true);
+ // JS_SetGCParameter(runtime, JSGC_LOW_FREQUENCY_HEAP_GROWTH, 150);
+ // JS_SetGCParameter(runtime, JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN, 150);
+ // JS_SetGCParameter(runtime, JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX, 300);
+ // JS_SetGCParameter(runtime, JSGC_HIGH_FREQUENCY_LOW_LIMIT, 100);
+ // JS_SetGCParameter(runtime, JSGC_HIGH_FREQUENCY_HIGH_LIMIT, 500);
+ // JS_SetGCParameter(runtime, JSGC_ALLOCATION_THRESHOLD, 30);
+ // JS_SetGCParameter(runtime, JSGC_DECOMMIT_THRESHOLD, 32);
JS_SetLocaleCallbacks(runtime, &gjs_locale_callbacks);
JS_AddFinalizeCallback(runtime, gjs_finalize_callback, data);
JS_SetErrorReporter(runtime, gjs_error_reporter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]