void ef_enumeration_benchmark(uint64_t m, uint8_t bits) { succinct::elias_fano::elias_fano_builder bvb(uint64_t(1) << bits, m); monotone_generator mgen(m, bits, 37); for (size_t i = 0; i < m; ++i) { bvb.push_back(mgen.next()); } assert(mgen.done()); succinct::elias_fano ef(&bvb); succinct::mapper::size_tree_of(ef)->dump(); double elapsed; uint64_t foo = 0; SUCCINCT_TIMEIT(elapsed) { succinct::elias_fano::select_enumerator it(ef, 0); for (size_t i = 0; i < m; ++i) { foo ^= it.next(); } } volatile uint64_t vfoo = foo; (void)vfoo; // silence warning std::cerr << "Elapsed: " << elapsed / 1000 << " msec\n" << double(m) / elapsed << " Mcodes/s" << std::endl; }
void ReplSetTagConfig::put(const ReplSetTagMatch& matcher, std::ostream& os) const { BSONObjBuilder builder; BSONArrayBuilder allBindingsBuilder(builder.subarrayStart("bindings")); for (size_t i = 0; i < matcher._boundTagValues.size(); ++i) { BSONObjBuilder bindingBuilder(allBindingsBuilder.subobjStart()); _appendConstraint(matcher._boundTagValues[i].constraint, &bindingBuilder); BSONArrayBuilder boundValues(bindingBuilder.subarrayStart("boundValues")); for (size_t j = 0; j < matcher._boundTagValues[i].boundValues.size(); ++j) { BSONObjBuilder bvb(boundValues.subobjStart()); _appendTagValue(matcher._boundTagValues[i].constraint.getKeyIndex(), matcher._boundTagValues[i].boundValues[j], &bvb); } } allBindingsBuilder.doneFast(); os << builder.done(); }