Search code examples
c#silverlightironpythonsilverlight-2.0ironruby

What is the difference in speed between the DLR languages and C# in Silverlight 2?


For Silverlight 2, it looks like programming choices are:

  • C#
  • VB
  • DLR scripting languages
    • IronRuby
    • IronPython
    • A sadly neglected (if not cancelled) Managed jScript

Is this a case where the native languages (C# and VB) are faster than the DLR languages by an order of magnitude or so?

Any hope of "living" in IronPython when I do Silverlight client programming, or should I expect to drop into C# for processor-intensive work?

My survey of languages comes from this set of examples for C# and VB and this page discussing the DLR.


Solution

  • Unfortunately there is no hard and fast answer to this question. Performance of even the same language varies greatly based on a number of parameters.

    Yes, in general VB.Net and C# will be faster than DLR based languages. Static languages do more work at compile time such as method binding. This type of work must be done at runtime for DLR based languages and hence they have a bit more cost at runtime.

    However, lots of work goes into optimizing the DLR and DLR based languages. Much of this work is mitigated by various caches and so forth. In many types of applications, the performance difference will be negligable.

    I would not rule out a DLR based language based solely on performance unless a profiler told me it was actually a problem.