Processing method and apparatus, processor, electronic device, and storage medium
AssigneeAlipay (Hangzhou) Information Technology Co., Ltd.
InventorLing Ma
Life of this patent
Estimating the term…
Abstract
One or more embodiments of this specification provide a processing method, including: when a first coroutine is executed, determining whether a to-be-fetched object in an execution process is stored in a target cache; and if it is determined that the to-be-fetched object is not stored in the target cache, prefetching the to-be-fetched object, and switching the currently executed first coroutine to a second coroutine. According to the processing method provided in the embodiments of this specification, a throughput capability of a CPU can be improved.
Claims16
A data processing method, comprising:
- when a first coroutine is executed, while accessing a level 1 cache of a plurality of levels of cache to determine whether a to-be-fetched object required for executing the first coroutine is stored in the level 1 cache, and without accessing a target cache of the plurality of levels of cache, predicting whether the to-be-fetched object is stored in the target cache, wherein the target cache is determined by:
- determining, in consideration of a case where the prediction result is that the to-be-fetched object is not stored in the target cache but the to-be-fetched object is actually stored in the target cache, a processing delay caused by using each of the plurality of levels of cache other than the level 1 cache as the target cache, and selecting a cache with a smallest processing delay as the target cache;
- and
- upon determining that the to-be-fetched object is not stored in the level 1 cache and the target cache based on the accessing the level 1 cache and the predicting, prefetching the to-be-fetched object, and switching the currently executed first coroutine to a second coroutine.
An electronic device, comprising:
- a memory and a processor, wherein the memory stores executable instructions that, in response to execution by the processor, cause the processor to:
- when a first coroutine is executed, while accessing a level 1 cache of a plurality of levels of cache to determine whether a to-be-fetched object required for executing the first coroutine is stored in the level 1 cache, and without accessing a target cache of the plurality of levels of cache, predict whether the to-be-fetched object is stored in the target cache, wherein the target cache is determined by:
- determining, in consideration of a case where the prediction result is that the to-be-fetched object is not stored in the target cache but the to-be-fetched object is actually stored in the target cache, a processing delay caused by using each of the plurality of levels of cache other than the level 1 cache as the target cache, and selecting a cache with a smallest processing delay as the target cache;
- and
- upon determining that the to-be-fetched object is not stored in the level 1 cache and the target cache based on the accessing the level 1 cache and the predicting, prefetch the to-be-fetched object, and switch the currently executed first coroutine to a second coroutine.
A non-transitory computer-readable storage medium, comprising instructions stored therein that, when executed by a processor of a computing device, cause the processor to:
- when a first coroutine is executed, while accessing a level 1 cache of a plurality of levels of cache to determine whether a to-be-fetched object required for executing the first coroutine is stored in the level 1 cache, and without accessing a target cache of the plurality of levels of cache, predict whether the to-be-fetched object is stored in the target cache, wherein the target cache is determined by:
- determining, in consideration of a case where the prediction result is that the to-be-fetched object is not stored in the target cache but the to-be-fetched object is actually stored in the target cache, a processing delay caused by using each of the plurality of levels of cache other than the level 1 cache as the target cache, and selecting a cache with a smallest processing delay as the target cache;
- and
- upon determining that the to-be-fetched object is not stored in the level 1 cache and the target cache based on the accessing the level 1 cache and the predicting, prefetch the to-be-fetched object, and switch the currently executed first coroutine to a second coroutine.
Dependencies are inferred from the claim text.