Skip to content

Instantly share code, notes, and snippets.

@kijanawoodard
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kijanawoodard/92c9cec91e1a72b756da to your computer and use it in GitHub Desktop.
Save kijanawoodard/92c9cec91e1a72b756da to your computer and use it in GitHub Desktop.
Voron Scratch Buffers
namespace VoronScratchTest
{
class Program
{
static void Main(string[] args)
{
using (
var store =
new DocumentStore
{
Url = "http://localhost:8080",
DefaultDatabase = "VoronScratchTest"
}.Initialize())
{
string id;
using (var session = store.OpenSession())
{
var doc = new Scratch {Id = "scratch/"};
session.Store(doc);
session.SaveChanges();
id = doc.Id;
}
for (var i=0; i< long.MaxValue; i++)
{
using (var session = store.OpenSession())
{
var doc = session.Load<Scratch>(id);
doc.Value = i;
session.SaveChanges();
}
Thread.Sleep(10);
if (i%(10*1000) == 0) Console.Write(".");
}
}
}
}
public class Scratch
{
public string Id { get; set; }
public long Value { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment