public string Id {get; set;}
There are quite a few options to speed up Raven.
// Ryan
Thomas,A few comments:
data load ravendb - takes 46730ms:Parallel.ForEach(Enumerable.?Range(0, 10000), i =>{using (IDocumentSession session = store.OpenSession()){session.Store(new Category {Description = "unit-test-description-" + i, Id = "categories-" + i}); //specifies id myself to avoid HILO roundtripsession.SaveChanges();}});Note that this is a bad form of doing this, since it requires us to do a lot of separate calls vs. doing bulk request.This is also not recommended:test 1 ravendb - takes 15281ms:Parallel.ForEach(Enumerable.Range(0, 10000), i =>{using (IDocumentSession session = store.OpenSession()){string id = "categories-" + i;Category result = session.Query<Category, CategoryIndex>().FirstOrDefault(cat => cat.Id == id);}});Since this forces us to force do an index query, then a load. If you have the ID, you need to use Load.All of that said, I think that the major factor here is the notion of the connection pool.Can you try something for me, do:store.JsonRequestFactory.CustomizeRequest += req => ((HttpWebRequest)req).UnsafeAuthenticatedConnectionSharing = true;What happens then?
The SQL does not have to do that:
...
Category cat = new Category
{
Id = reader.GetString(0),
Description = reader.GetString(1)
};
...
Raven does:
...
Category result = session.Load<Category>(id);
...
Maybe a fairer test would be to have the .net deserialization excluded
from the Raven loop or added to the SQL loop.
// Ryan
I think the deserialization of the objects could also add to the differences.The SQL does not have to do that:
...
Category cat = new Category
{
Id = reader.GetString(0),
Description = reader.GetString(1)
};
...Raven does:
...
Category result = session.Load<Category>(id);
...Maybe a fairer test would be to have the .net deserialization excluded
from the Raven loop or added to the SQL loop.// Ryan
On Tue, Mar 27, 2012 at 1:36 PM, Thomas Schmidt
// Ryan
Thomas,A few comments:
data load ravendb - takes 46730ms:Parallel.ForEach(Enumerable.?Range(0, 10000), i =>{using (IDocumentSession session = store.OpenSession()){session.Store(new Category {Description = "unit-test-description-" + i, Id = "categories-" + i}); //specifies id myself to avoid HILO roundtripsession.SaveChanges();}});Note that this is a bad form of doing this, since it requires us to do a lot of separate calls vs. doing bulk request.This is also not recommended:test 1 ravendb - takes 15281ms:Parallel.ForEach(Enumerable.Range(0, 10000), i =>{using (IDocumentSession session = store.OpenSession()){string id = "categories-" + i;Category result = session.Query<Category, CategoryIndex>().FirstOrDefault(cat => cat.Id == id);}});Since this forces us to force do an index query, then a load. If you have the ID, you need to use Load.All of that said, I think that the major factor here is the notion of the connection pool.Can you try something for me, do:store.JsonRequestFactory.CustomizeRequest += req => ((HttpWebRequest)req).UnsafeAuthenticatedConnectionSharing = true;What happens then?