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:
parent
404da37cc4
commit
cdce334b80
1 changed files with 12 additions and 9 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue