diff options
author | Tedd Hansen | 2007-08-19 10:28:27 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-19 10:28:27 +0000 |
commit | e70cdbc5accc5025ed4e6262ff01ce50bf553141 (patch) | |
tree | b8b74de490ae4d8a03d63458f1ad06730a5e6635 /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |
parent | Moved script loading from ScriptManager to AppDomainManager. Now increases sc... (diff) | |
download | opensim-SC-e70cdbc5accc5025ed4e6262ff01ce50bf553141.zip opensim-SC-e70cdbc5accc5025ed4e6262ff01ce50bf553141.tar.gz opensim-SC-e70cdbc5accc5025ed4e6262ff01ce50bf553141.tar.bz2 opensim-SC-e70cdbc5accc5025ed4e6262ff01ce50bf553141.tar.xz |
Added event method invoke cache to Executor. "Bind once, Invoke multiple times". Will speed up script event execution considerable. But at the cost of some memory (will be optimized later with RuntimeXHandle).
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 9a65b5c..4879fb2 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -34,6 +34,7 @@ using System.Reflection; | |||
34 | using System.Runtime.Remoting; | 34 | using System.Runtime.Remoting; |
35 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenSim.Region.Environment.Scenes.Scripting; | 36 | using OpenSim.Region.Environment.Scenes.Scripting; |
37 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | ||
37 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 38 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
38 | using OpenSim.Region.ScriptEngine.Common; | 39 | using OpenSim.Region.ScriptEngine.Common; |
39 | 40 | ||
@@ -176,7 +177,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
176 | //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); | 177 | //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); |
177 | 178 | ||
178 | //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName, ObjectID); | 179 | //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName, ObjectID); |
179 | OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName, ObjectID); | 180 | long before; |
181 | before = GC.GetTotalMemory(true); | ||
182 | LSL_BaseClass Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName); | ||
183 | Console.WriteLine("Script occupies {0} bytes", GC.GetTotalMemory(true) - before); | ||
184 | before = GC.GetTotalMemory(true); | ||
185 | Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName); | ||
186 | Console.WriteLine("Script occupies {0} bytes", GC.GetTotalMemory(true) - before); | ||
187 | before = GC.GetTotalMemory(true); | ||
188 | Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName); | ||
189 | Console.WriteLine("Script occupies {0} bytes", GC.GetTotalMemory(true) - before); | ||
180 | 190 | ||
181 | 191 | ||
182 | // Add it to our temporary active script keeper | 192 | // Add it to our temporary active script keeper |
@@ -184,7 +194,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
184 | SetScript(ObjectID, ScriptID, Script); | 194 | SetScript(ObjectID, ScriptID, Script); |
185 | // We need to give (untrusted) assembly a private instance of BuiltIns | 195 | // We need to give (untrusted) assembly a private instance of BuiltIns |
186 | // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed. | 196 | // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed. |
187 | OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands(this, ObjectID); | 197 | LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(this, ObjectID); |
188 | 198 | ||
189 | // Start the script - giving it BuiltIns | 199 | // Start the script - giving it BuiltIns |
190 | Script.Start(LSLB); | 200 | Script.Start(LSLB); |