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());
}
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
v8-...@googlegroups.com
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 v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
• Yang Guo • yan...@google.com |
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
--
--
v8-dev mailing list
v8-...@googlegroups.com
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 v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> We don't scan the source when creating a code cache.Poor choice of words on my part with regards to scanning the source, since the the method that returns cached data is a compiled script. I was referring to `CodeSerializer::Serialize`, which has to traverse the compiled script structures and the logic would suggest that this would touch same structures that were created while compiling, but I see what you are saying about being able to create code cache at different times. Thank you for this details. Much appreciated.
--
--
v8-dev mailing list
v8-...@googlegroups.com
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 v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> We don't scan the source when creating a code cache.Poor choice of words on my part with regards to scanning the source, since the the method that returns cached data is a compiled script. I was referring to `CodeSerializer::Serialize`, which has to traverse the compiled script structures and the logic would suggest that this would touch same structures that were created while compiling, but I see what you are saying about being able to create code cache at different times. Thank you for this details. Much appreciated.