1818#include < ailego/internal/cpu_features.h>
1919#include < ailego/pattern/defer.h>
2020#include < ailego/utility/memory_helper.h>
21- #include " utility/rdtsc_timer.h"
2221#include " utility/sparse_utility.h"
22+ #include " utility/steady_clock_timer.h"
2323#include " hnsw_algorithm.h"
2424#include " hnsw_context.h"
2525#include " hnsw_dist_calculator.h"
@@ -680,9 +680,9 @@ int HnswStreamer::search_impl(const void *query, const IndexQueryMeta &qmeta,
680680 const bool use_empty_hooks = UseEmptyHnswHooks ();
681681 HnswAlgorithm::SearchHooks empty_hooks;
682682 for (size_t q = 0 ; q < count; ++q) {
683- auto query_start = RdtscTimer ::Now ();
683+ auto query_start = SteadyClockTimer ::Now ();
684684 ctx->reset_query (query);
685- auto query_search_start = RdtscTimer ::Now ();
685+ auto query_search_start = SteadyClockTimer ::Now ();
686686 if (use_empty_hooks) {
687687 bool stopped_early = false ;
688688 ret = alg_->search_with_hooks (ctx, &empty_hooks, &stopped_early);
@@ -693,11 +693,11 @@ int HnswStreamer::search_impl(const void *query, const IndexQueryMeta &qmeta,
693693 LOG_ERROR (" Hnsw searcher fast search failed" );
694694 return ret;
695695 }
696- auto query_search_end = RdtscTimer ::Now ();
696+ auto query_search_end = SteadyClockTimer ::Now ();
697697 auto query_search_time_ns =
698- RdtscTimer ::ElapsedNs (query_search_start, query_search_end);
698+ SteadyClockTimer ::ElapsedNs (query_search_start, query_search_end);
699699 auto query_latency_ns =
700- RdtscTimer ::ElapsedNs (query_start, RdtscTimer ::Now ());
700+ SteadyClockTimer ::ElapsedNs (query_start, SteadyClockTimer ::Now ());
701701 uint64_t query_seq = HnswQueryStatsSequence ().fetch_add (1 );
702702 if (ShouldLogHnswQueryStats (query_seq)) {
703703 LOG_INFO (
@@ -811,7 +811,7 @@ int HnswStreamer::search_bf_impl(
811811 auto &topk = ctx->topk_heap ();
812812
813813 for (size_t q = 0 ; q < count; ++q) {
814- auto query_start = RdtscTimer ::Now ();
814+ auto query_start = SteadyClockTimer ::Now ();
815815 ctx->reset_query (query);
816816 topk.clear ();
817817 for (node_id_t id = 0 ; id < entity_.doc_cnt (); ++id) {
@@ -825,7 +825,7 @@ int HnswStreamer::search_bf_impl(
825825 }
826826 }
827827 auto query_latency_ns =
828- RdtscTimer ::ElapsedNs (query_start, RdtscTimer ::Now ());
828+ SteadyClockTimer ::ElapsedNs (query_start, SteadyClockTimer ::Now ());
829829 uint64_t query_seq = HnswQueryStatsSequence ().fetch_add (1 );
830830 if (ShouldLogHnswQueryStats (query_seq)) {
831831 LOG_INFO (
0 commit comments