发明名称 Accelerated cached object retrieval
摘要 Efficiency of cached objects such as singleton objects and other software constructs having a first-invocation cost is improved by replacing the software code for creating a method instance (the “creation code”) with the instance itself. Upon first invocation, the calling method causes the first version of the method to be performed, and also causes the first version to be replaced by the second version. Thus, the invention facilitates creation of singleton objects that run without any branch logic, so as to improve speed and efficiency. The need for locking and exception handling is reduced, resultant code is simplified, and potential for error is reduced.
申请公布号 US8892533(B2) 申请公布日期 2014.11.18
申请号 US200711863498 申请日期 2007.09.28
申请人 Apple Inc. 发明人 Bumgarner William
分类号 G06F17/30;G06F9/44 主分类号 G06F17/30
代理机构 Novak Druce Connolly Bove + Quigg LLP 代理人 Novak Druce Connolly Bove + Quigg LLP
主权项 1. A programming environment including executable code for implementing a method for optimizing object generation, the method comprising: receiving, from a calling method, a first call for invocation of a target method including initialization code; executing a first code version to perform the target method; in response to the first code version executing successfully with no exceptions, the first code version dynamically replaces the first code version with a second code version to perform the target method in any subsequent invocations of the target method, wherein the second code version does not include the initialization code, andthe dynamically replacing is performed without notification to the calling method; receiving, from the calling method, a second call for invocation of the target method; and in response to the second call, executing the second code version to perform the target method, the second code version comprises a singleton object wherein each object type of the singleton object has exactly one shared instance.
地址 Cupertino CA US