mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:31:14 +08:00
PERF: ensure we run full GC on contexts
Prior to this change we would never clear memory from contexts and rely on V8 reacting to pressure This could lead to bloating of PrettyText and Transpiler contexts This optimisations ensures that we will clear memory 2 seconds after the last eval on the context
This commit is contained in:
@ -65,7 +65,7 @@ module PrettyText
|
||||
end
|
||||
|
||||
def self.create_es6_context
|
||||
ctx = MiniRacer::Context.new(timeout: 25000)
|
||||
ctx = MiniRacer::Context.new(timeout: 25000, ensure_gc_after_idle: 2000)
|
||||
|
||||
ctx.eval("window = {}; window.devicePixelRatio = 2;") # hack to make code think stuff is retina
|
||||
|
||||
|
Reference in New Issue
Block a user