You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evaluation cost is tracked internally by a CPU clock alarm; the eval_cost efun returns an estimate based on elapsed wall time. This can even return negative numbers to the caller. Proposed fix is to add an optional POSIX timers based eval_cost mechanism, and to use timer_gettime() when querying the amount remaining.
setitimer/getitimer is not as suitable because getitimer only has 1/250 second resolution on current versions of Linux, which limits precision when profiling LPC code.
The text was updated successfully, but these errors were encountered:
Yes, that. In my prototype, I have it use a CLOCK_PROCESS_CPUTIME_ID timer configured to send SIGVTALRM, similar to what setitimer / uvalarm currently does. The advantage here is timer_gettime() can be used to get the remaining time with high precision.
My first attempt was simply to use getitimer(), but then I noticed it was counting up in 4000 microsecond increments. That would be granular for profiling code speed from within LPC.
It's working well; I just need to integrate the code more cleanly into fluffos.
Evaluation cost is tracked internally by a CPU clock alarm; the eval_cost efun returns an estimate based on elapsed wall time. This can even return negative numbers to the caller. Proposed fix is to add an optional POSIX timers based eval_cost mechanism, and to use timer_gettime() when querying the amount remaining.
setitimer/getitimer is not as suitable because getitimer only has 1/250 second resolution on current versions of Linux, which limits precision when profiling LPC code.
The text was updated successfully, but these errors were encountered: