Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using in-memory codec in performance suite #161

Merged
merged 2 commits into from
Sep 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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