Dynamic 3D array

Hello everyone! I’m trying to make a 3D infinite array in C# but couldn’t find any online. So I came up with this code:

using System;
using System.Collections;
using System.Collections.Generic;

public class DArray
{
	//public ArrayList dynamicData;
	public Dictionary<string, Object> dynamicData;

	public DArray ()
	{
		dynamicData = new Dictionary<string, Object>();
		//dynamicData = new ArrayList();
	}

	public void Set(int x, int y, int z, Object obj)
	{
		/*if(dynamicData[x] == null)
			dynamicData[x] = new ArrayList();
		
		if(((ArrayList)dynamicData[x])[y] == null)
			dynamicData[x] = new ArrayList();
		
		((ArrayList)((ArrayList)dynamicData[x])[y])[z] = obj;*/

		String key = x + ":" + y + ":" + z;
		dynamicData[key] = obj;
	}

	public Object Get(int x, int y, int z)
	{
		/*if(dynamicData[x] == null)
			return null;
		
		if(((ArrayList)dynamicData[x])[y] == null)
			return null;
		
		return ((ArrayList)((ArrayList)dynamicData[x])[y])[z];*/

		String key = x + ":" + y + ":" + z;
		
		if(!dynamicData.ContainsKey(key))
			return null;

		return dynamicData[key];
	}
}

After switching from a non-infinite array to this one, I noticed a huge performance decrease. Is there any way to fix it?

Performance loss possibly due to using strings as keys.
Maybe try hashing the xyz values or something

I tried to hash it like this:

	public int GetHashCode(int x, int y, int z)
	{
		int hash = unchecked(x + (31 * y) + (31 * 31 * z));
		return hash;
	}

(This is for minecraft-like voxel terrain)
But it causes some coordinates to have the same key.

Can you just use longs for more bits?