better artifact cache cancellation thread work organization - only do more frequent cancellation scans when in a tick, otherwise sleep

This commit is contained in:
Ryan Fleury
2025-10-23 14:39:44 -07:00
parent 721649b7ea
commit ae17084b44
4 changed files with 63 additions and 41 deletions
+13 -10
View File
@@ -10308,16 +10308,6 @@ rd_frame(void)
}
#endif
//////////////////////////////
//- rjf: [windows] clear pages from working set shortly after startup, many of which will not be needed
//
#if OS_WINDOWS
if(rd_state->frame_index == 1) ProfScope("SetProcessWorkingSetSize")
{
SetProcessWorkingSetSize(GetCurrentProcess(), max_U64, max_U64);
}
#endif
//////////////////////////////
//- rjf: do per-frame resets
//
@@ -16563,6 +16553,19 @@ rd_frame(void)
U64 frame_time_us = end_time_us-begin_time_us;
rd_state->frame_time_us_history[rd_state->frame_index%ArrayCount(rd_state->frame_time_us_history)] = frame_time_us;
//////////////////////////////
//- rjf: [windows] clear pages from working set shortly after startup, many of which will not be needed
//
#if OS_WINDOWS
if(di_load_count() < 50)
{
if(rd_state->frame_index == 15) ProfScope("SetProcessWorkingSetSize")
{
SetProcessWorkingSetSize(GetCurrentProcess(), max_U64, max_U64);
}
}
#endif
//////////////////////////////
//- rjf: bump frame time counters
//