0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-02 03:32:52 +01:00

modules/client/rooms/messages: Hoist prefetching into branch; disable here for now.

This commit is contained in:
Jason Volk 2019-09-17 23:17:51 -07:00
parent 404da37cc4
commit cdce334b80

View file

@ -138,10 +138,19 @@ get__messages(client &client,
}; };
size_t prefetch{0}; size_t prefetch{0};
m::room::events pf if((false) && max_prefetch)
{ {
room m::room::events pf
}; {
room
};
for(; pf && prefetch < max_prefetch; page.dir == 'b'? --pf : ++pf)
prefetch += pf.prefetch();
if(prefetch > 0)
ctx::yield();
}
size_t hit{0}, miss{0}; size_t hit{0}, miss{0};
m::room::events it m::room::events it
@ -151,12 +160,6 @@ get__messages(client &client,
for(; it; page.dir == 'b'? --it : ++it) for(; it; page.dir == 'b'? --it : ++it)
{ {
for(; pf && prefetch < hit + miss + max_prefetch; page.dir == 'b'? --pf : ++pf)
prefetch += pf.prefetch();
if(hit + miss == 0 && prefetch > 0)
ctx::yield();
const m::event &event const m::event &event
{ {
*it *it