-
Notifications
You must be signed in to change notification settings - Fork 80
Description
It is stupid to enqueue the address of each and every element of an array into a ProcessEdgesWork. We can enqueue slices directly.
For example, when scanning an Object[], instead of enqueuing &object[0], &object[1], &object[2], ..., &object[object.length - 1], we can enqueue one single OpenJDKEdgeRange { range: &object[0]..&object[object.length - 1] }. That saves both space and time.
But we need to take into account the effect of prefetching as well as eager edge loading (See: #584). If we decide that it is better to load edges eagerly when scanning the object, we may want to enqueue the edge address together with the value it holds. If that's the case, there will be no space advantage to enqueue slices because we need to enqueue values, too. But there may be a temporal advantage. If we know that consecutive edges in a ProcessEdgesWork work packet are loaded sequentially from an array, we may take advantage of it and do prefetching more efficiently.