官术网_书友最值得收藏!

Behind the scenes

A critical part of writing fast code is to understand what happens behind the scenes. Are you appending strings? You should know how that is implemented in a compiler. Passing a dynamic array into a function? Ditto. Wondering whether you should create 10,000 instances of a class or just create a large array of records? Knowing the implementation details will give you the answer.

In this section, I'll dig down into some frequently used data types and show how using them will bring in unexpected complexity. I will discuss memory and memory allocation, but I will treat them as very abstract entities. I'll say words like "A new string gets allocated" with which I'll mean that a secret part of code, called memory manager, gets memory from the Windows and tells the program: "You can store your string here." We'll dig deep into the bowels of memory manager in Chapter 4, Memory Management.

主站蜘蛛池模板: 白朗县| 汤原县| 阜南县| 扬中市| 东乡族自治县| 石渠县| 梨树县| 宜城市| 大化| 铅山县| 麦盖提县| 莱芜市| 崇左市| 天祝| 三江| 甘泉县| 县级市| 竹北市| 阳原县| 怀安县| 久治县| 鄂尔多斯市| 灵宝市| 托克托县| 涞水县| 永德县| 伽师县| 闵行区| 喀喇沁旗| 桑日县| 陵水| 廉江市| 白水县| 孝昌县| 包头市| 德昌县| 德兴市| 元朗区| 宜昌市| 买车| 巨野县|