1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

(perf) Change execution test to use processing rate instead of count

This commit is contained in:
Viktor Lofgren
2025-07-27 16:39:51 +02:00
parent 2e126ba30e
commit c9c442345b
2 changed files with 1 additions and 20 deletions

View File

@@ -241,7 +241,7 @@ public class PerfTestMain {
execution.run();
long end = System.nanoTime();
sum2 += execution.itemsProcessed();
rates.add(execution.itemsProcessed() / ((end - start)/1_000_000.));
rates.add(execution.itemsProcessed() / ((end - start)/1_000_000_000.));
if ((iter % 100) == 0) {
if (Instant.now().isAfter(runEndTime)) {

View File

@@ -12,10 +12,6 @@ import java.util.Iterator;
/** A priority queue for search results. This class is not thread-safe,
* in general, except for concurrent use of the addAll method.
* <p></p>
* The class implements a subset of the Collection interface, and
* is intended to be used as a priority queue for search results,
* with a maximum size.
* <p></p>
* Since the expected use case is to add a large number of items
* and then iterate over the items, the class is optimized for
* this scenario, and does not implement other mutating methods
@@ -35,16 +31,6 @@ public class ResultPriorityQueue implements Iterable<SearchResultItem> {
return queue.iterator();
}
public boolean add(SearchResultItem item) {
itemsProcessed++;
if (idsInSet.add(item.getDocumentId())) {
queue.add(item);
return true;
}
return false;
}
/** Adds all items to the queue, and returns true if any items were added.
* This is a thread-safe operation.
*/
@@ -60,11 +46,6 @@ public class ResultPriorityQueue implements Iterable<SearchResultItem> {
return true;
}
public void clear() {
queue.clear();
idsInSet.clear();
}
public int size() {
return queue.size();
}