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
Once we've merged #8730 we'll be able to poll the connected socket to see if there's a pending request. This should allow us to implement a pattern like so:
letrec loopblock=match read_from_socket block with|Somedata ->
process_data data
|None ->
if there_is_more_maintenance_to_do()thenbegin
do_some_small_maintenance();
loop falseendelse
loop truein
loop false
This assumes that the socket read function returns Some data if there's data, and None otherwise.
It is important to keep maintenance tasks small so an incoming request isn't delayed too much. Such tasks could include:
Walk a type's fields and check if cf_expr_unoptimized is equal to cf_expr, in which case we can unset it (this currently nearly doubles the memory required for typed AST storage).
Check if we have compilation contexts which haven't been accessed in a long time and discard them.
Once we have a binary format (Binary format for eval? #8275), check if we have some data which hasn't been used for a while and could be "demoted" to binary to save memory.
Generally, the goal is to keep memory usage at an acceptable level while not disrupting operations.
This requires some design to abstract the maintenance tasks.
Once we've merged #8730 we'll be able to poll the connected socket to see if there's a pending request. This should allow us to implement a pattern like so:
This assumes that the socket read function returns
Some dataif there's data, andNoneotherwise.It is important to keep maintenance tasks small so an incoming request isn't delayed too much. Such tasks could include:
cf_expr_unoptimizedis equal tocf_expr, in which case we can unset it (this currently nearly doubles the memory required for typed AST storage).Generally, the goal is to keep memory usage at an acceptable level while not disrupting operations.
This requires some design to abstract the maintenance tasks.