Calling QueryInterface from JS is one of our hottest code paths, and can be optimised by skipping some of the 'generic' things we usually do.
Not sure how much this cuts exactly, but it's at least 20-25% of the overall runtime.
Details
Details
- Reviewers
- None
Profile some games.
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 21915 Build 53374: Vulcan Build Jenkins Build 53373: Vulcan Build (macOS) Jenkins Build 53372: Vulcan Build (Windows) Jenkins Build 53371: arc lint + arc unit
Event Timeline
Comment Actions
Build failure - The Moirai have given mortals hearts that can endure.
builderr-debug-macos.txt fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/network_Debug/precompiled.h.gch' was built note: please rebuild precompiled header 'obj/network_Debug/precompiled.h.gch' fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/LinkedList.h' has been modified since the precompiled header 'obj/network_Debug/precompiled.h.gch' was built fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/network_Debug/precompiled.h.gch' was built note: please rebuild precompiled header 'obj/network_Debug/precompiled.h.gch' 1 error generated. make[1]: *** [obj/network_Debug/NetMessageSim.o] Error 1 make[1]: *** Waiting for unfinished jobs.... fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/network_Debug/precompiled.h.gch' was built note: please rebuild precompiled header 'obj/network_Debug/precompiled.h.gch' 1 error generated. make[1]: *** [obj/network_Debug/NetClientTurnManager.o] Error 1 1 error generated. make[1]: *** [obj/network_Debug/NetServer.o] Error 1 1 error generated. make[1]: *** [obj/network_Debug/NetClient.o] Error 1 make: *** [network] Error 2
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7007/display/redirect
Comment Actions
Build failure - The Moirai have given mortals hearts that can endure.
Debug: 11>e:\jenkins\workspace\vs2015-differential\source\simulation2\scripting\enginescriptconversions.cpp(72): error C2664: 'JS::Handle<JS::Value>::Handle(const JS::Handle<JS::Value> &)': cannot convert argument 1 from 'JS::Value' to 'nullptr' [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\simulation2.vcxproj] 11>e:\jenkins\workspace\vs2015-differential\source\simulation2\system\componentmanager.cpp(100): error C2039: 'GetNativeScope': is not a member of 'ScriptRequest' [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\simulation2.vcxproj] 11>e:\jenkins\workspace\vs2015-differential\source\simulation2\system\componentmanager.cpp(100): error C2660: 'JS_DefineFunction': function does not take 5 arguments [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\simulation2.vcxproj]
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8098/display/redirect
Comment Actions
Build failure - The Moirai have given mortals hearts that can endure.
builderr-debug-gcc7.txt ../../../source/simulation2/scripting/EngineScriptConversions.cpp: In function 'void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue, const T&) [with T = IComponent; JS::MutableHandleValue = JS::MutableHandle<JS::Value>]': ../../../source/simulation2/scripting/EngineScriptConversions.cpp:72:46: error: no matching function for call to 'JS::Handle<JS::Value>::Handle(JS::Value)' JS::HandleValue instance(val.GetJSInstance()); ^ In file included from ../../../libraries/source/spidermonkey/include-unix-debug/js/CallArgs.h:73:0, from ../../../libraries/source/spidermonkey/include-unix-debug/jsapi.h:30, from ../../../source/scriptinterface/ScriptTypes.h:63, from ../../../source/simulation2/system/Message.h:21, from ../../../source/simulation2/system/IComponent.h:22, from ../../../source/simulation2/system/Interface.h:21, from ../../../source/pch/simulation2/precompiled.h:26: ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:651:13: note: candidate: constexpr JS::Handle<T>::Handle(const T*, JS::Handle<T>::Disambiguator, JS::Handle<T>::CallerIdentity) [with T = JS::Value] constexpr Handle(const T* p, Disambiguator, CallerIdentity) : ptr(p) {} ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:651:13: note: candidate expects 3 arguments, 1 provided ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:646:3: note: candidate: JS::Handle<T>::Handle() [with T = JS::Value] Handle() = default; ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:646:3: note: candidate expects 0 arguments, 1 provided ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:638:23: note: candidate: template<class S> JS::Handle<T>::Handle(JS::MutableHandle<S>&, std::enable_if_t<is_convertible_v<S, T>, int>) inline MOZ_IMPLICIT Handle( ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:638:23: note: template argument deduction/substitution failed: ../../../source/simulation2/scripting/EngineScriptConversions.cpp:72:46: note: 'JS::Value' is not derived from 'JS::MutableHandle<T>' JS::HandleValue instance(val.GetJSInstance()); ^ In file included from ../../../libraries/source/spidermonkey/include-unix-debug/js/CallArgs.h:73:0, from ../../../libraries/source/spidermonkey/include-unix-debug/jsapi.h:30, from ../../../source/scriptinterface/ScriptTypes.h:63, from ../../../source/simulation2/system/Message.h:21, from ../../../source/simulation2/system/IComponent.h:22, from ../../../source/simulation2/system/Interface.h:21, from ../../../source/pch/simulation2/precompiled.h:26: ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:632:23: note: candidate: template<class S> JS::Handle<T>::Handle(const JS::PersistentRooted<S>&, std::enable_if_t<is_convertible_v<S, T>, int>) inline MOZ_IMPLICIT Handle( ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:632:23: note: template argument deduction/substitution failed: ../../../source/simulation2/scripting/EngineScriptConversions.cpp:72:46: note: 'JS::Value' is not derived from 'const JS::PersistentRooted<T>' JS::HandleValue instance(val.GetJSInstance()); ^ In file included from ../../../libraries/source/spidermonkey/include-unix-debug/js/CallArgs.h:73:0, from ../../../libraries/source/spidermonkey/include-unix-debug/jsapi.h:30, from ../../../source/scriptinterface/ScriptTypes.h:63, from ../../../source/simulation2/system/Message.h:21, from ../../../source/simulation2/system/IComponent.h:22, from ../../../source/simulation2/system/Interface.h:21, from ../../../source/pch/simulation2/precompiled.h:26: ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:627:23: note: candidate: template<class S> JS::Handle<T>::Handle(const JS::Rooted<S>&, std::enable_if_t<is_convertible_v<S, T>, int>) inline MOZ_IMPLICIT Handle( ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:627:23: note: template argument deduction/substitution failed: ../../../source/simulation2/scripting/EngineScriptConversions.cpp:72:46: note: 'JS::Value' is not derived from 'const JS::Rooted<T>' JS::HandleValue instance(val.GetJSInstance()); ^ In file included from ../../../libraries/source/spidermonkey/include-unix-debug/js/CallArgs.h:73:0, from ../../../libraries/source/spidermonkey/include-unix-debug/jsapi.h:30, from ../../../source/scriptinterface/ScriptTypes.h:63, from ../../../source/simulation2/system/Message.h:21, from ../../../source/simulation2/system/IComponent.h:22, from ../../../source/simulation2/system/Interface.h:21, from ../../../source/pch/simulation2/precompiled.h:26: ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:600:16: note: candidate: JS::Handle<T>::Handle(JS::MutableHandle<T>) [with T = JS::Value] MOZ_IMPLICIT Handle(MutableHandle<T> handle) { ptr = handle.address(); } ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:600:16: note: no known conversion for argument 1 from 'JS::Value' to 'JS::MutableHandle<JS::Value>' ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:593:16: note: candidate: JS::Handle<T>::Handle(std::nullptr_t) [with T = JS::Value] MOZ_IMPLICIT Handle(decltype(nullptr)) { ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:593:16: note: no known conversion for argument 1 from 'JS::Value' to 'std::nullptr_t' ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:585:16: note: candidate: template<class S> JS::Handle<T>::Handle(JS::Handle<S>, std::enable_if_t<is_convertible_v<S, T>, int>) MOZ_IMPLICIT Handle( ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:585:16: note: template argument deduction/substitution failed: ../../../source/simulation2/scripting/EngineScriptConversions.cpp:72:46: note: 'JS::Value' is not derived from 'JS::Handle<T>' JS::HandleValue instance(val.GetJSInstance()); ^ In file included from ../../../libraries/source/spidermonkey/include-unix-debug/js/CallArgs.h:73:0, from ../../../libraries/source/spidermonkey/include-unix-debug/jsapi.h:30, from ../../../source/scriptinterface/ScriptTypes.h:63, from ../../../source/simulation2/system/Message.h:21, from ../../../source/simulation2/system/IComponent.h:22, from ../../../source/simulation2/system/Interface.h:21, from ../../../source/pch/simulation2/precompiled.h:26: ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:581:3: note: candidate: constexpr JS::Handle<T>::Handle(const JS::Handle<T>&) [with T = JS::Value] Handle(const Handle<T>&) = default; ^~~~~~ ../../../libraries/source/spidermonkey/include-unix-debug/js/RootingAPI.h:581:3: note: no known conversion for argument 1 from 'JS::Value' to 'const JS::Handle<JS::Value>&' make[1]: *** [simulation2.make:513: obj/simulation2_Debug/EngineScriptConversions.o] Error 1 make: *** [Makefile:109: simulation2] Error 2
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/8681/display/redirect