public BufferedLoader(int size, int maxItems, BigInt32Buffer buffer) { m_size = size; m_maxItems = Math.Min(maxItems, BigNestedInt32Array.MAX_ITEMS); m_info = new BigInt32Array(size << 1); // pointer and count m_info.Fill(EOD); m_buffer = buffer; }
public static BigSegmentedArray FromArray(int[] original) { BigInt32Array result = new BigInt32Array(original.Length); int i = 0; foreach (int c in original) { result.Add(i++, c); } return(result); }
public void TestBigIntArray() { int count = 5000000; var test = new BigInt32Array(count); var test2 = new int[count]; for (int i = 0; i < count; i++) { test.Add(i, i); test2[i] = i; } for (int i = 0; i < count; i++) { Assert.AreEqual(0, test.Get(0)); } long start = System.Environment.TickCount; for (int i = 0; i < count; i++) { test.Get(i); } long end = System.Environment.TickCount; Console.WriteLine("Big array took: " + (end - start)); start = System.Environment.TickCount; int k = 0; for (int i = 0; i < count; i++) { k = test2[i]; } end = System.Environment.TickCount; Console.WriteLine("int[] took: " + (end - start)); }