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

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.

主站蜘蛛池模板: 连江县| 仲巴县| 壶关县| 高雄市| 东方市| 和龙市| 潼关县| 龙游县| 云南省| 武穴市| 玉溪市| 麻阳| 安庆市| 枣阳市| 雷山县| 喀喇| 财经| 陇西县| 北宁市| 舞阳县| 许昌县| 民县| 新邵县| 光山县| 红原县| 稻城县| 偃师市| 井冈山市| 鱼台县| 砀山县| 永清县| 贵定县| 双江| 聂荣县| 罗山县| 商都县| 东安县| 隆尧县| 廉江市| 林甸县| 营山县|