Mercurial > hg > audiodb
comparison query.cpp @ 610:e21a3db643af
MORE MEMORY SANITY
Move the logic tracking which points have been visited already
(including the std::set datastructure) into the indexed query codepaths,
rather than inside accumulators. This has the effect of drastically
reducing the memory used in non-indexed queries, such that the working
set for a 500-file database with 100000 vectors total goes from 1.2GB to
slightly under 3MB.
All this and less code, too!
author | mas01cr |
---|---|
date | Fri, 28 Aug 2009 17:14:06 +0000 |
parents | b2a941a372fb |
children | bcc7a6ddb2c8 |
comparison
equal
deleted
inserted
replaced
609:368320b31db6 | 610:e21a3db643af |
---|---|
475 adb_result_t r; | 475 adb_result_t r; |
476 r.key = (*adb->keys)[pp.trackID].c_str(); | 476 r.key = (*adb->keys)[pp.trackID].c_str(); |
477 r.dist = dist; | 477 r.dist = dist; |
478 r.qpos = pp.qpos; | 478 r.qpos = pp.qpos; |
479 r.ipos = pp.spos; | 479 r.ipos = pp.spos; |
480 qstate->accumulator->add_point(&r); | 480 if(qstate->set->find(r) == qstate->set->end()) { |
481 qstate->set->insert(r); | |
482 qstate->accumulator->add_point(&r); | |
483 } | |
481 } | 484 } |
482 } | 485 } |
483 qstate->exact_evaluation_queue->pop(); | 486 qstate->exact_evaluation_queue->pop(); |
484 } | 487 } |
485 | 488 |