- Hands-On Design Patterns with Kotlin
- Alexey Soshin
- 61字
- 2021-06-25 20:49:28
Caching
The Static Factory Method may provide caching, as Long actually does. Instead of always returning a new instance for any value, valueOf() checks in-cache whether this value was already parsed. If it is, it returns a cached instance. Repeatedly calling the Static Factory Method with the same values may produce less garbage for collection than using constructors all the time.
推薦閱讀
- Learning Neo4j
- Vue 3移動(dòng)Web開(kāi)發(fā)與性能調(diào)優(yōu)實(shí)戰(zhàn)
- Learning Neo4j 3.x(Second Edition)
- Visual Basic程序設(shè)計(jì)習(xí)題解答與上機(jī)指導(dǎo)
- 深入淺出PostgreSQL
- Getting Started with LLVM Core Libraries
- 軟件品質(zhì)之完美管理:實(shí)戰(zhàn)經(jīng)典
- Create React App 2 Quick Start Guide
- QlikView Unlocked
- Clojure High Performance Programming(Second Edition)
- React and React Native
- Java程序設(shè)計(jì)及應(yīng)用開(kāi)發(fā)
- 計(jì)算機(jī)軟件項(xiàng)目實(shí)訓(xùn)指導(dǎo)
- Learning Zimbra Server Essentials
- 自己動(dòng)手做智能產(chǎn)品:嵌入式JavaScript實(shí)現(xiàn)