Skip to content

Commit

Permalink
Stop using in-memory codec in performance suite (#161)
Browse files Browse the repository at this point in the history
It obfuscates more realistic bottlenecks.
  • Loading branch information
alexklibisz authored Sep 20, 2020
1 parent 9d40e2c commit 8d988f4
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import com.klibisz.elastiknn.mapper.VectorMapper
import com.klibisz.elastiknn.models.{ExactSimilarityFunction, L2LshModel}
import com.klibisz.elastiknn.testing.LuceneSupport
import org.apache.lucene.codecs.lucene84.Lucene84Codec
import org.apache.lucene.codecs.memory._
import org.apache.lucene.codecs.{DocValuesFormat, PostingsFormat}
import org.apache.lucene.document.Document
import org.scalatest._

Expand All @@ -23,10 +21,7 @@ class MatchHashesAndScoreQueryPerformanceSuite extends FunSuite with Matchers wi
// Thread.sleep(1000)
// }

class MemCodec extends Lucene84Codec {
override def getDocValuesFormatForField(field: String): DocValuesFormat = new DirectDocValuesFormat
override def getPostingsFormatForField(field: String): PostingsFormat = new DirectPostingsFormat()
}
class BenchmarkCodec extends Lucene84Codec

test("indexing and searching on scale of GloVe-25") {
implicit val rng: Random = new Random(0)
Expand All @@ -36,7 +31,7 @@ class MatchHashesAndScoreQueryPerformanceSuite extends FunSuite with Matchers wi
val exactFunc = ExactSimilarityFunction.L2
val field = "vec"
val fieldType = new VectorMapper.FieldType(field)
indexAndSearch(codec = new MemCodec) { w =>
indexAndSearch(codec = new BenchmarkCodec) { w =>
val t0 = System.currentTimeMillis()
for {
v <- corpusVecs
Expand Down

0 comments on commit 8d988f4

Please sign in to comment.