网站首页  情感咨询  情感美文  情感百科  情感生活  学习充电  旧版美文

请输入您要查询的词汇:

 

词汇 Lazy initialization
分类 英语词汇 英语翻译词典
释义

Lazy initialization

中文百科

惰性初始模式

在编程中, 惰性初始是一种拖延战术。在第一次需求出现以前,先延迟创建对象、计算值或其它昂贵进程。

这通常是以一个旗号来实现,用旗号来标示是否完成其程序。每次请求对象时,会先测试此旗号。如果已完成,直接传回,否则当场运行。

对于此想法更一般的论述,可见惰性求值。

对指令式语言,这个模式可能潜藏着危险,尤其是使用共享状态的程序习惯。

英语百科

Lazy initialization 惰性初始模式

In computer programming, lazy initialization is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed.

This is typically accomplished by augmenting a variable's accessor method (or property definition) to check for a previously-created instance. If none exists a new instance is created, placed into the variable, and this new object is returned to the caller in a just-in-time fashion. In this manner object creation is deferred until first use which can, in some circumstances (e.g., sporadic object access), increase system responsiveness and speed startup by bypassing large-scale object pre-allocation. (Note that this may have attendant counter-effects on overall performance, however, as the impact of object instantiation is then amortized across the startup/warm-up phase of the system.)

随便看

 

依恋情感网英汉例句词典收录3870147条英语例句词条,基本涵盖了全部常用英语单词的释义及例句,是英语学习的有利工具。

 

Copyright © 2004-2024 Yiyi18.com All Rights Reserved
京ICP备2021023879号 更新时间:2025/8/5 21:00:32