Anton Firsov
2010-Sep-12 23:18 UTC
[Ironruby-core] running ruby script from my own .NET code is slow
Hi all! Why it is ~5 times slower to run the same .rb script from my .NET application (using ScriptEngine and ScriptRuntime) classes, than doing the same with ir.exe? When I downloaded IronRuby source, and compiled ir.exe (Ruby.Console), it was 2 times slower, than ir.exe in released binaries. (But still 3 times faster than running scripts from my own application) Any ideas, what is behind these differences? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100913/a23a67bf/attachment.html>
Tomas Matousek
2010-Sep-12 23:24 UTC
[Ironruby-core] running ruby script from my own .NET code is slow
Can you give an example of what script it is and how you exactly run it from the .NET app? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Anton Firsov Sent: Sunday, September 12, 2010 4:18 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] running ruby script from my own .NET code is slow Hi all! Why it is ~5 times slower to run the same .rb script from my .NET application (using ScriptEngine and ScriptRuntime) classes, than doing the same with ir.exe? When I downloaded IronRuby source, and compiled ir.exe (Ruby.Console), it was 2 times slower, than ir.exe in released binaries. (But still 3 times faster than running scripts from my own application) Any ideas, what is behind these differences? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100912/523d660b/attachment.html>
Anton Firsov
2010-Sep-12 23:37 UTC
[Ironruby-core] running ruby script from my own .NET code is slow
Here is the code: http://paste.dprogramming.com/dpk25ghd (It''s just a dummy speed test) I tried several ways to call it: runtime = Ruby.CreateRuntime(); engine = Ruby.GetEngine(runtime); #than engine.ExecuteFile("test.rb"); #or engine.CreateScriptSourceFromFile("lib.rb").Execute() #or CompiledCode code = engine.CreateScriptSourceFromFile("test.rb").Compile(); code.Execute(); Actually they all give the same results... 2010/9/13 Tomas Matousek <Tomas.Matousek at microsoft.com>> Can you give an example of what script it is and how you exactly run it > from the .NET app? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Anton Firsov > *Sent:* Sunday, September 12, 2010 4:18 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] running ruby script from my own .NET code is > slow > > > > Hi all! > > Why it is ~5 times slower to run the same .rb script from my .NET > application (using ScriptEngine and ScriptRuntime) classes, than doing the > same with ir.exe? > When I downloaded IronRuby source, and compiled ir.exe (Ruby.Console), it > was 2 times slower, than ir.exe in released binaries. (But still 3 times > faster than running scripts from my own application) > > Any ideas, what is behind these differences? > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100913/8a4e1359/attachment.html>
Anton Firsov
2010-Sep-24 15:57 UTC
[Ironruby-core] running ruby script from my own .NET code is slow
Hi, I still have this performance problem. I think there must be a reason, and it could be solved somehow. Really no ideas? Anton 2010/9/13 Anton Firsov <antonfir at gmail.com>> Here is the code: > http://paste.dprogramming.com/dpk25ghd > (It''s just a dummy speed test) > > I tried several ways to call it: > runtime = Ruby.CreateRuntime(); > engine = Ruby.GetEngine(runtime); > > #than > engine.ExecuteFile("test.rb"); > #or > engine.CreateScriptSourceFromFile("lib.rb").Execute() > #or > CompiledCode code = engine.CreateScriptSourceFromFile("test.rb").Compile(); > code.Execute(); > > Actually they all give the same results... > > > 2010/9/13 Tomas Matousek <Tomas.Matousek at microsoft.com> > >> Can you give an example of what script it is and how you exactly run it >> from the .NET app? >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Anton Firsov >> *Sent:* Sunday, September 12, 2010 4:18 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* [Ironruby-core] running ruby script from my own .NET code is >> slow >> >> >> >> Hi all! >> >> Why it is ~5 times slower to run the same .rb script from my .NET >> application (using ScriptEngine and ScriptRuntime) classes, than doing the >> same with ir.exe? >> When I downloaded IronRuby source, and compiled ir.exe (Ruby.Console), it >> was 2 times slower, than ir.exe in released binaries. (But still 3 times >> faster than running scripts from my own application) >> >> Any ideas, what is behind these differences? >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100924/45f91f8e/attachment.html>