I wrote a simple test app to test a graph-like query. The writes run at around 500k / sec, but the reads are only about 16k / sec.
Code to write:
const int run = 1000000; IStorageEngine db = STSdb.FromFile("test.stsdb4"); var col = db.OpenXTable<long, long[]>("graph"); Random R = new Random(0); int max = run; long next; for (long i = 0; i < run; i++) { long[] vl = new long[2]; vl[0] = 1; // prevent a reference to self do { next = R.Next(max); } while (next == i); vl[1] = next; col[i] = vl; } db.Commit(); db.Dispose();Code to read:
const int run = 1000000; IStorageEngine db = STSdb.FromFile("test.stsdb4"); if (db.Exists("graph")) { var col = db.OpenXTable<long, long[]>("graph"); long[] vl = new long[2]; long count = 0, trail = 1; try { do { vl = col[trail]; if (vl[0] == 1) { trail = vl[1]; } } while (++count < run); } catch { } } db.Dispose();Anything wrong with this code?