XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Network Session Creates Garbage?

Last post 4/28/2009 11:14 PM by Nick Gravelyn. 4 replies.
  • 4/28/2009 6:53 PM

    Network Session Creates Garbage?

    Hi guys,
    I wonder if you experience problem with Network Session before?

    I found that our network part of the code creates garbage. Inside the network code, we made calls to NetworkSession's BeginJoin/EndJoin, BeginFind/EndFind, BeginCreate/EndCreate.
    I am just wondering if those functions generate garbage?

    Thanks!

    -tep


  • 4/28/2009 6:57 PM In reply to

    Re: Network Session Creates Garbage?

    Probably a little, but does it matter? You only call them once in a while, so it's very unlikely that they'll be that big of a deal. I wouldn't worry about whether or not they create garbage except in a purely academic fashion of simply knowing how they work.
  • 4/28/2009 6:58 PM In reply to

    Re: Network Session Creates Garbage?

    I'm sure they both do create garbage. In theory, the amount of garbage compared to how often you are calling either or those methods should be pretty low. Are you finding that they are creating a slowdown?
  • 4/28/2009 9:14 PM In reply to

    Re: Network Session Creates Garbage?

    Thanks for the reply guys.

    The garbage is indeed pretty small and unlikely to cause slowdown. We were in the optimization stage of our game and we were trying to make our game creates zero garbage if possible.

    We're just curious if those functions generate garbage and if there is any solution for that problem. We won't try so hard to make it perfect (i.e. 0 garbage).

    -tep
  • 4/28/2009 11:14 PM In reply to

    Re: Network Session Creates Garbage?

    tep360:
    The garbage is indeed pretty small and unlikely to cause slowdown. We were in the optimization stage of our game and we were trying to make our game creates zero garbage if possible.
    My game creates tons of garbage a frame and has no issues. Optimize when you have to, not just because you can. :)

    We're just curious if those functions generate garbage and if there is any solution for that problem.
    Honestly the only way to know is profile or use something like Reflector to peek into the Windows assembly and see. But I doubt there's any way to stop them from doing whatever they do, so it's not likely going to be practical knowledge.
Page 1 of 1 (5 items) Previous Next