time taken to do search, increase ivfflat probes
This commit is contained in:
@@ -156,11 +156,13 @@ class Domain::PostsController < DomainController
|
||||
@uploaded_image_data_uri = create_thumbnail(image_path, content_type)
|
||||
@uploaded_hash_value = generate_fingerprint(image_path)
|
||||
@uploaded_detail_hash_value = generate_detail_fingerprint(image_path)
|
||||
before = Time.now
|
||||
similar_fingerprints =
|
||||
helpers.find_similar_fingerprints(
|
||||
fingerprint_value: @uploaded_hash_value,
|
||||
fingerprint_detail_value: @uploaded_detail_hash_value,
|
||||
).take(10)
|
||||
@time_taken = Time.now - before
|
||||
|
||||
@matches = similar_fingerprints
|
||||
@good_matches =
|
||||
|
||||
@@ -90,7 +90,7 @@ module Domain
|
||||
oversearch: 2,
|
||||
includes: {}
|
||||
)
|
||||
ActiveRecord::Base.connection.execute("SET ivfflat.probes = 10")
|
||||
ActiveRecord::Base.connection.execute("SET ivfflat.probes = 20")
|
||||
|
||||
Domain::PostFile::BitFingerprint
|
||||
.order(
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
No results found
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="text-gray-400 text-xs">
|
||||
<%= "took #{(@time_taken * 1000).round(1)} ms" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-3 justify-center max-w-full">
|
||||
|
||||
Reference in New Issue
Block a user