0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd:Ⓜ️:events: Add readahead; add conf item.

This commit is contained in:
Jason Volk 2020-09-06 02:58:49 -07:00
parent cc123836ef
commit 7642f50ebb

View file

@ -347,6 +347,18 @@ ircd::m::events::for_each(const range &range,
// events::state // events::state
// //
namespace ircd::m::events::content
{
extern conf::item<size_t> readahead;
}
decltype(ircd::m::events::content::readahead)
ircd::m::events::content::readahead
{
{ "name", "ircd.m.events.content.readahead" },
{ "default", long(4_MiB) },
};
bool bool
ircd::m::events::content::for_each(const closure &closure) ircd::m::events::content::for_each(const closure &closure)
{ {
@ -360,13 +372,15 @@ ircd::m::events::content::for_each(const closure &closure)
dbs::event_column.at(content_idx) dbs::event_column.at(content_idx)
}; };
static const db::gopts gopts db::gopts gopts
{ {
db::get::NO_CACHE, db::get::NO_CACHE,
db::get::NO_CHECKSUM db::get::NO_CHECKSUM
}; };
for(auto it(column.begin(gopts)); bool(it); ++it) gopts.readahead = size_t(readahead);
auto it(column.begin(gopts));
for(; it; ++it)
{ {
const auto &event_idx const auto &event_idx
{ {