ayende/ravendb — pull request #117 by mattwarren (2012-07-04 12:49:44+00:00)
Title: Faceted queries now done in parallel

Sorry, the line endings got borked, the only change is https://github.com/mattwarren/ravendb/blob/1.2/Raven.Database/Queries/FacetedQueryRunner.cs#L35

On my machine, I see the following speed-ups using this new code (basically parallel takes 1/2 the time of sequential):

Query x => (x.Megapixels > 5.0)
**Sequential**: Took 2884.3698 ms
**Parallel**: Took 548.3615 ms

Query x => (x.Megapixels > 5.0)
**Sequential**: Took 434.9242 ms
**Parallel**: Took 201.7947 ms

Query x => ((x.Megapixels > 5.0) AndAlso (x.Cost < 500))
**Sequential**: Took 1175.9053 ms
**Parallel**: Took 328.5939 ms

Query x => ((x.Megapixels > 5.0) AndAlso (x.Cost < 500))
**Sequential**: Took 649.9667 ms
**Parallel**: Took 303.6177 ms

Query x => (((x.Megapixels > 5.0) AndAlso (x.Cost < 500)) AndAlso (x.DateOfListing > new DateTime(2000, 1, 1)))
**Sequential**: Took 1260.7684 ms
**Parallel**: Took 482.0374 ms

Query x => (((x.Megapixels > 5.0) AndAlso (x.Cost < 500)) AndAlso (x.DateOfListing > new DateTime(2000, 1, 1)))
**Sequential**: Took 1007.0183 ms
**Parallel**: Took 464.6603 ms

Query x => ((((x.Megapixels > 5.0) AndAlso (x.Cost < 500)) AndAlso (x.DateOfListing > new DateTime(2000, 1, 1))) AndAlso(x.Manufacturer == "Nikon"))
**Sequential**: Took 1100.8792 ms
**Parallel**: Took 500.6481 ms

Query x => ((((x.Megapixels > 5.0) AndAlso (x.Cost < 500)) AndAlso (x.DateOfListing > new DateTime(2000, 1, 1))) AndAlso(x.Manufacturer == "Nikon"))
**Sequential**: Took 1045.592 ms
**Parallel**: Took 473.6903 ms

Query x => (((((x.Megapixels > 5.0) AndAlso (x.Cost < 500)) AndAlso (x.DateOfListing > new DateTime(2000, 1, 1))) AndAlso (x.Manufacturer == "Nikon")) AndAlso (x.Model == "blah"))
**Sequential**: Took 1220.7945 ms
**Parallel**: Took 547.5513 ms

Query x => (((((x.Megapixels > 5.0) AndAlso (x.Cost < 500)) AndAlso (x.DateOfListing > new DateTime(2000, 1, 1))) AndAlso (x.Manufacturer == "Nikon")) AndAlso (x.Model == "blah"))
**Sequential**: Took 1166.1339 ms
**Parallel**: Took 522.5051 ms