Less garbage with a reusable array

This is the most boring post of all times. I recently hit some performance issues in the form of sudden spikes in frames. I thought it had to do with garbage collection since it cropped up every 250-300ms. So I pulled my pants up and made a ReusableArray<T>. That wasn't the culprit, but still, now I have less garbage. I created some List<T> every frame where I kept my meshes that should be drawn which went through some linq to determine inside frustum, etc. However, I notices that the garbage was collected a bit less and it didn't run for as long as it did before.

Instead of creating new List<T>, create a private member of ReusableArray<Mesh> and use that. I'm sure you have many places where you can reduce your garbage footprint.

    public class ReusableArray : IEnumerable
    {
        public T[] Items = null;
        public int Count { get; set; }

        public void Add(T item)
        {
            if (Items.Length < Count + 1)
                Array.Resize(ref Items, Items.Length * 2);

            Items[Count++] = item;
        }

        public bool Contains(T item)
        {
            var count = Count;

            for (var i = 0; i < count; i++)
                if (Items[i].Equals(item))
                    return true;

            return false;
        }

        public void AddRange(IEnumerable items)
        {
            var count = items.Count();

            if (Items.Length < Count + count)
                Array.Resize(ref Items, Math.Max(Items.Length * 2, Count + count));

            var i = Count;

            foreach (var item in items)
            {
                Items[Count] = item;
                Count++;
            }
        }

        public void Reset()
        {
            Count = 0;
        }

        public void Clear()
        {
            var count = Count;

            for (var i = 0; i < count; i++)
                Items[i] = default(T);

            Count = 0;
        }

        public IEnumerator GetEnumerator()
        {
            return new ReusableArrayEnumerator(this);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return new ReusableArrayEnumerator(this);
        }

        public ReusableArray()
        {
            Items = new T[100];
        }

        public ReusableArray(int size)
        {
            Items = new T[size];
        }
    }

    public class ReusableArrayEnumerator : IEnumerator
    {
        ReusableArray _source;
        int _index = -1;

        public T Current
        {
            get
            {
                return _source.Items[_index];
            }
        }

        object IEnumerator.Current
        {
            get
            {
                return _source.Items[_index];
            }
        }

        public void Dispose()
        {
            
        }

        public bool MoveNext()
        {
            if (_index + 1 >= _source.Count)
                return false;

            _index++;
            return true;
        }

        public void Reset()
        {
            _index = 0;
        }

        public ReusableArrayEnumerator(ReusableArray source)
        {
            _source = source;
        }
    }