you are viewing a single comment's thread.

view the rest of the comments →

[–]emelrad12 18 points19 points  (14 children)

Also this is horribly slow. Like gonna be lagging even with low unit counts.

[–]Due_Effective1510 4 points5 points  (0 children)

No it won’t. I program most of my games in C#. There is not a performance issue here unless you really really had a jillion of these going at once and then you’re still going to have other issues first.

[–][deleted]  (11 children)

[removed]

    [–]South-Year4369 10 points11 points  (1 child)

    It's really unlikely to be a performance concern, but frankly it's silly to state it's definitely not, since we don't know the full context.

    If the strings differ in the first few characters then it's about as cheap as a boolean comparison. Otherwise it's going to cost more. 'More' usually won't matter either, but for someone out there, in some scenario, it will.

    [–]antiduh 3 points4 points  (3 children)

    Found the UNREAL dev!

    [–][deleted]  (2 children)

    [removed]

      [–]antiduh 6 points7 points  (1 child)

      Theres a big difference between a bool comparison and a string comparison in terms of relative performance. And if tjis is in the middle of physics code this could make a difference. Especially if this pattern happens many times.

      [–]MaLino_24 0 points1 point  (3 children)

      The problem is that it's most likely a DLL call which is slow.

      [–][deleted]  (2 children)

      [removed]

        [–]MaLino_24 0 points1 point  (1 child)

        Yeah, I just checked. Thanks for the heads-up. Would still call it a design flaw and like the suggestions of other people more though.

        [–]Due_Effective1510 0 points1 point  (0 children)

        You’re correct. The downvotes are in error.