Checking if a point is on screen I'm working on a tile-based game, and am looking to improve the efficiency of my code to slightly improve framerate. I call this method on every tile, every frame, so it is very performance critical. What optimizations can be made?

public bool OnScreen(Vector2 point) 
{
    Rectangle rect = this.Rectangle;
    return ((((rect.X &lt;= point.X) &amp;&amp; (point.X &lt; (rect.X + rect.Width))) &amp;&amp; (rect.Y &lt;= point.Y)) &amp;&amp; (point.Y &lt; (rect.Y + rect.Height)));
}

public bool OnScreen(Vector2 topLeft, Vector2 size)
{
    // Check if each corner is inside of the camera rectangle
    return (
        OnScreen(topLeft) // Top-left
        || OnScreen(topLeft + new Vector2(0, size.Y)) // Bottom-left
        || OnScreen(topLeft + new Vector2(size.X, 0)) // Top-right
        || OnScreen(topLeft + size) // Bottom-right
    );
}


I am doing this so that I can pool the objects that actually render my tiles, since only a maximum of about 800 can be on screen at any one time. These methods are called as so:

// Assign renderers to any tiles in range of the camera.
foreach (var tile in _tiles)
{
    if (tile.IsInRange(camera))
    {
        if (tile.Renderer == null)
        {
            tile.Renderer = _pool.Get();
        }
    }
    else 
    {
        tile.Renderer = null; 
    }
}
At a glance, OnScreen looks like a method that would raise some Screen event, as On[EventName] is, by convention, the name we use for methods that raise an event. Now, those would obviously return void, and yours is returning a bool - I think I would have it like this:

public bool IsOnScreen(Vector2 point)


The return statement is pretty intense in terms of parentheses. Are they meant to improve readability?

return ((((rect.X &lt;= point.X) &amp;&amp; (point.X &lt; (rect.X + rect.Width))) &amp;&amp; (rect.Y &lt;= point.Y)) &amp;&amp; (point.Y &lt; (rect.Y + rect.Height)));


Let's try something:

return rect.X &lt;= point.X 
    &amp;&amp; point.X &lt; (rect.X + rect.Width) 
    &amp;&amp; rect.Y &lt;= point.Y 
    &amp;&amp; point.Y &lt; (rect.Y + rect.Height);


Much better isn't it?