Search Unity

Can we use Roslyn Linq Rewrite to improve performance?

Discussion in 'Scripting' started by Asse1, Sep 24, 2019.

  1. Asse1

    Asse1

    Joined:
    Jan 9, 2013
    Posts:
    89
    There's a tool which compiles C# code by first rewriting Linq expressions into plain code called Roslyn Linq Rewrite:
    https://github.com/antiufo/roslyn-linq-rewrite

    So my simple question is: Can we use this tool somehow? Or is there something similar that already works with Unity?

    What I can think of is a tool or build step that rewrites the Linq expressions before it gets compiled by Unity. This should be possible, right? :)
     
  2. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    As with any optimization tool, it improves performance very well in documented test cases. However it is not possible to tell how it will affect your project without actually testing it. For instance it is possible your code contains a lot of linq expressions it can't optimize and a few others.
     
  3. Asse1

    Asse1

    Joined:
    Jan 9, 2013
    Posts:
    89
    Hi Palex,

    Thanks for your response. I'm aware of the possible issues.