Generating compiled script data and reusing it used to work in v6.3 in the 
code like this:

v8::Local<v8::String> v8script = v8::String::NewFromUtf8(isolate, script.
c_str(), v8::NewStringType::kNormal, (int) script.length()).ToLocalChecked
();
v8::ScriptOrigin scriptOrigin(v8::String::NewFromUtf8(isolatescriptName.
c_str()), v8::Local<v8::Uint32>(), v8::Local<v8::Uint32>(), v8::Boolean::New
(isolate, false), v8::Int32::New(isolate, scriptID++));

v8::ScriptCompiler::CachedData *cachedData = ... get a new'ed cached data 
structure;
v8::ScriptCompiler::CompileOptions compileOptions = cachedData ? 
v8::ScriptCompiler::kConsumeCodeCache : 
v8::ScriptCompiler::kProduceCodeCache;

v8::ScriptCompiler::Source source(v8script, scriptOrigin, cachedData);

v8::MaybeLocal<v8::Script> compiledScript = 
v8::ScriptCompiler::Compile(context, &source, compileOptions);

if(!compiledScript.IsEmpty()) {
    //
    // In v6.3.292.49 source.GetCachedData() returned a non-NULL pointer 
and in v6.6.346.24
    // the returned pointer is always NULL.
    //
    if(compileOptions == v8::ScriptCompiler::kProduceCodeCache && 
source.GetCachedData())
       cacheScriptData(... , *source.GetCachedData());
}

In v6.6 `source.GetCachedData()` always returns a NULL pointer in the code 
above. When recompiled with the v6.3 headers and libraries, caching works 
without any changes in the application code. 

This looks like a bug in the code that produces cached data. Using cached 
data made things run faster 3-4 times for repeated scripts and now I'm 
taking quite a hit on the application response time. 

Any thoughts on how to tweak caching to make it work again?

Thanks!

Andre

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to