title
Precompiled Headers in C++

description
Patreon ► https://patreon.com/thecherno Instagram ► https://instagram.com/thecherno Twitter ► https://twitter.com/thecherno Discord ► https://thecherno.com/discord Series Playlist ► https://thecherno.com/cpp Gear I use: ----------------- BEST laptop for programming! ► http://geni.us/pakTES My FAVOURITE keyboard for programming! ► http://geni.us/zNhB FAVOURITE monitors for programming! ► http://geni.us/Ig6KBq MAIN Camera ► http://geni.us/t6xyDRO MAIN Lens ► http://geni.us/xGoDWT Second Camera ► http://geni.us/CYUQ Microphone ► http://geni.us/wqO6g7K

detail
{'title': 'Precompiled Headers in C++', 'heatmap': [{'end': 918.014, 'start': 877.714, 'weight': 0.804}], 'summary': 'Covers the concept of precompiled headers in c++, emphasizing their benefits in improving compilation times and efficiency, with real-world examples demonstrating potential reductions in compilation time from minutes to seconds and avoidance of recompiling 370,000 lines of code, while also highlighting the strategic selection of project files to optimize compilation speed and the importance of utilizing precompiled headers for improved code modularity and convenience.', 'chapters': [{'end': 33.086, 'segs': [{'end': 33.086, 'src': 'embed', 'start': 0.109, 'weight': 0, 'content': [{'end': 1.49, 'text': "Hey, what's up guys? My name is Jonah.", 'start': 0.109, 'duration': 1.381}, {'end': 3.431, 'text': 'Welcome back to my C++ series.', 'start': 1.51, 'duration': 1.921}, {'end': 6.993, 'text': "So today we're going to be talking all about pre-compiled headers in C++.", 'start': 3.831, 'duration': 3.162}, {'end': 12.097, 'text': "We're going to first of all start off by just talking about them, what they are and why you should be using them.", 'start': 7.073, 'duration': 5.024}, {'end': 23.704, 'text': "And then after that we're going to jump into both Visual Studio and GCC G++ and kind of take a look at a real world example of how to actually set them up and see the actual benefits in a very simple example.", 'start': 12.597, 'duration': 11.107}, {'end': 27.485, 'text': 'Okay, so, first of all, what are pre-combined headers?', 'start': 24.464, 'duration': 3.021}, {'end': 33.086, 'text': "I'm sure that if you've been using C++ for any kind of moderate amount of time, you've probably heard of them,", 'start': 27.565, 'duration': 5.521}], 'summary': 'Jonah discusses pre-compiled headers in c++ and their benefits in visual studio and gcc g++.', 'duration': 32.977, 'max_score': 0.109, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto109.jpg'}], 'start': 0.109, 'title': 'C++ pre-compiled headers', 'summary': 'Covers the concept of pre-compiled headers in c++, including their benefits and real-world examples in visual studio and gcc g++. it emphasizes the importance of using pre-compiled headers for improved compilation times and efficiency.', 'chapters': [{'end': 33.086, 'start': 0.109, 'title': 'C++ pre-compiled headers', 'summary': 'Covers the concept of pre-compiled headers in c++, including their benefits and real-world examples in visual studio and gcc g++. it emphasizes the importance of using pre-compiled headers for improved compilation times and efficiency.', 'duration': 32.977, 'highlights': ['The importance of using pre-compiled headers for improved compilation times and efficiency', 'Real-world examples of setting up pre-compiled headers in Visual Studio and GCC G++', 'Explanation of what pre-compiled headers are and why they should be used']}], 'duration': 32.977, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto109.jpg', 'highlights': ['The importance of using pre-compiled headers for improved compilation times and efficiency', 'Real-world examples of setting up pre-compiled headers in Visual Studio and GCC G++', 'Explanation of what pre-compiled headers are and why they should be used']}, {'end': 196.684, 'segs': [{'end': 94.798, 'src': 'embed', 'start': 72.588, 'weight': 0, 'content': [{'end': 87.675, 'text': 'What precompiled headers actually do is they give you an opportunity to grab a bunch of header files and convert them into essentially a kind of compiled format that the compiler can then use instead of having to read those header files over and over again.', 'start': 72.588, 'duration': 15.087}, {'end': 94.798, 'text': "So here's an example, right? I use the standard template library quite a lot, right? I might be using vector, I might be using string.", 'start': 88.295, 'duration': 6.503}], 'summary': 'Precompiled headers help convert header files into compiled format, reducing compilation time.', 'duration': 22.21, 'max_score': 72.588, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto72588.jpg'}, {'end': 141.084, 'src': 'embed', 'start': 116.533, 'weight': 2, 'content': [{'end': 124.558, 'text': 'Every time I include vector in one of my C++ files, it needs to read that entire vector header file and compile it.', 'start': 116.533, 'duration': 8.025}, {'end': 131.821, 'text': 'Not only that, the vector includes a bunch of other include files, right? That needs to happen as well.', 'start': 124.998, 'duration': 6.823}, {'end': 135.522, 'text': 'The preprocessor has to go in, copy all of that into that vector file.', 'start': 131.881, 'duration': 3.641}, {'end': 141.084, 'text': "Essentially, you end up with something that's probably around 100, 000 lines of code or so that needs to be parsed,", 'start': 135.862, 'duration': 5.222}], 'summary': 'Including vector in c++ files leads to compiling 100,000 lines of code.', 'duration': 24.551, 'max_score': 116.533, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto116533.jpg'}], 'start': 33.086, 'title': 'Precompiled headers in c++', 'summary': 'Discusses the importance of using precompiled headers in c++ to improve compilation time and efficiency, highlighting the benefits of reducing redundant parsing and tokenizing processes in large projects, potentially saving thousands of lines of code to be compiled for each file.', 'chapters': [{'end': 196.684, 'start': 33.086, 'title': 'Precompiled headers in c++', 'summary': 'Discusses the importance of using precompiled headers in c++ to improve compilation time and efficiency, highlighting the benefits of reducing redundant parsing and tokenizing processes in large projects, potentially saving thousands of lines of code to be compiled for each file.', 'duration': 163.598, 'highlights': ['Precompiled headers help in reducing redundant parsing and tokenizing processes, potentially saving thousands of lines of code to be compiled for each file. Precompiled headers allow a bunch of header files to be converted into a compiled format, reducing the need for the compiler to read and compile those header files repeatedly, potentially saving around 100,000 lines of code to be parsed and compiled for each file.', 'Usage of precompiled headers is particularly beneficial for larger projects, potentially increasing efficiency and compilation speed. While precompiled headers may not be necessary for smaller projects, they are vital for larger projects, where they can significantly improve efficiency and compilation speed, making them essential for developers working on sizable codebases.', 'Explains the process of including header files like vector and the impact on compilation time. Details the process of including header files, such as vector, in C++ files, highlighting the need for the preprocessor to parse and compile a substantial amount of code, as well as the potential impact on compilation time and efficiency.']}], 'duration': 163.598, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto33086.jpg', 'highlights': ['Precompiled headers allow a bunch of header files to be converted into a compiled format, reducing the need for the compiler to read and compile those header files repeatedly, potentially saving around 100,000 lines of code to be parsed and compiled for each file.', 'Usage of precompiled headers is particularly beneficial for larger projects, potentially increasing efficiency and compilation speed.', 'Explains the process of including header files like vector and the impact on compilation time.']}, {'end': 461.664, 'segs': [{'end': 275.99, 'src': 'embed', 'start': 247.783, 'weight': 1, 'content': [{'end': 252.965, 'text': 'A bunch of code, essentially, and it compiles it once and it stores it in a binary format.', 'start': 247.783, 'duration': 5.182}, {'end': 262.053, 'text': "that is way faster for the compiler to actually deal with than just text, because it's already in a parsed kind of state and it's in binary, not text,", 'start': 252.965, 'duration': 9.088}, {'end': 263.695, 'text': "right?. That's ready to go.", 'start': 262.053, 'duration': 1.642}, {'end': 267.801, 'text': 'And every time you include that precompiled header file, it already has everything you need.', 'start': 263.795, 'duration': 4.006}, {'end': 269.844, 'text': "That's it right?", 'start': 268.522, 'duration': 1.322}, {'end': 275.99, 'text': 'So, instead of it parsing that entire vector file every single time, it only needs to look at the precompiled header,', 'start': 270.024, 'duration': 5.966}], 'summary': 'Precompiled header stores code in binary format for faster compilation and reuse.', 'duration': 28.207, 'max_score': 247.783, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto247783.jpg'}, {'end': 347.758, 'src': 'embed', 'start': 319.132, 'weight': 0, 'content': [{'end': 323.536, 'text': 'So you need to, need to, need to use precompiled headers if you care about compilation times.', 'start': 319.132, 'duration': 4.404}, {'end': 327.939, 'text': "If you see that your compilation times are getting out of hand and it's taking like a minute to compile,", 'start': 323.596, 'duration': 4.343}, {'end': 332.443, 'text': 'you can potentially reduce that to like eight seconds if you just kind of start using precompiled headers.', 'start': 327.939, 'duration': 4.504}, {'end': 339.79, 'text': "Okay, so I've talked about the greatness of precompiled headers and we're going to go ahead and take a look at an example in a minute.", 'start': 333.483, 'duration': 6.307}, {'end': 343.073, 'text': 'but I also want to talk about what not to do with precompiled headers.', 'start': 339.79, 'duration': 3.283}, {'end': 347.758, 'text': "So what I've mentioned so far, kind of as to what a precompiled header actually is,", 'start': 343.714, 'duration': 4.044}], 'summary': 'Using precompiled headers can reduce compilation times from a minute to eight seconds, improving efficiency.', 'duration': 28.626, 'max_score': 319.132, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto319132.jpg'}, {'end': 407.014, 'src': 'embed', 'start': 377.37, 'weight': 3, 'content': [{'end': 379.67, 'text': 'obviously the precompiled header has to be rebuilt.', 'start': 377.37, 'duration': 2.3}, {'end': 381.291, 'text': 'And that takes time.', 'start': 380.531, 'duration': 0.76}, {'end': 386.375, 'text': 'Right. that could potentially end up slowing down your compilation.', 'start': 382.331, 'duration': 4.044}, {'end': 391.84, 'text': 'So do not put frequently changing files into that printable header really what it should be used for.', 'start': 386.375, 'duration': 5.465}, {'end': 395.864, 'text': "There's nothing wrong with you putting kind of your own project files into there.", 'start': 391.84, 'duration': 4.024}, {'end': 402.811, 'text': "Like if I have something like a log dot H file, Which doesn't really change, because how often do I touch my own logging library?", 'start': 395.864, 'duration': 6.947}, {'end': 407.014, 'text': "right?. I kind of written that once it's not like, I have to keep adding stuff to it and That's fine.", 'start': 402.811, 'duration': 4.203}], 'summary': 'Rebuilding precompiled header slows compilation. avoid frequent changes in printable header. use own project files instead.', 'duration': 29.644, 'max_score': 377.37, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto377370.jpg'}, {'end': 439.103, 'src': 'embed', 'start': 412.996, 'weight': 4, 'content': [{'end': 419.197, 'text': "Which also makes it convenient to use because, since you're including your precompiled header in every single source file now, right?,", 'start': 412.996, 'duration': 6.201}, {'end': 421.458, 'text': 'You also have access to those logging functions.', 'start': 419.437, 'duration': 2.021}, {'end': 423.998, 'text': "So that's really kind of easy to use now.", 'start': 422.078, 'duration': 1.92}, {'end': 424.939, 'text': "Now it's kind of.", 'start': 424.058, 'duration': 0.881}, {'end': 431.54, 'text': "it makes it more convenient because you don't need to manually include log in every single CPP file that you have in your project,", 'start': 424.939, 'duration': 6.601}, {'end': 433.601, 'text': "because you're including the precompiled header which includes log.", 'start': 431.54, 'duration': 2.061}, {'end': 435.982, 'text': "So that's good, because it adds convenience, right?", 'start': 434.221, 'duration': 1.761}, {'end': 439.103, 'text': "But also I've made sure that I'm not doing it.", 'start': 436.422, 'duration': 2.681}], 'summary': 'Including precompiled header adds convenience by providing access to logging functions in every source file.', 'duration': 26.107, 'max_score': 412.996, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto412996.jpg'}, {'end': 471.49, 'src': 'embed', 'start': 445.086, 'weight': 5, 'content': [{'end': 454.43, 'text': 'Because every time I change that log.h header file, it needs to get recompiled into the recompiled header, which means the whole precompiled header.', 'start': 445.086, 'duration': 9.344}, {'end': 455.811, 'text': 'I might have said recompiled header.', 'start': 454.43, 'duration': 1.381}, {'end': 459.693, 'text': 'the whole precompiled header has to be rebuilt from scratch every single time.', 'start': 455.811, 'duration': 3.882}, {'end': 461.664, 'text': "So don't put stuff like that in it.", 'start': 460.703, 'duration': 0.961}, {'end': 471.49, 'text': "What it's really used for is probably like external, I would say external dependencies, or there's a bit of an issue with dependencies,", 'start': 462.504, 'duration': 8.986}], 'summary': 'Modifying log.h requires full rebuild of precompiled header due to dependencies.', 'duration': 26.404, 'max_score': 445.086, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto445086.jpg'}], 'start': 197.064, 'title': 'Precompiled headers optimization', 'summary': 'Delves into the advantages of using precompiled headers, demonstrating potential reductions in compilation time from minutes to seconds, and emphasizes the strategic selection of project files to optimize compilation speed.', 'chapters': [{'end': 352.043, 'start': 197.064, 'title': 'Using precompiled headers for faster compilation', 'summary': 'Discusses the benefits of using precompiled headers, which can result in significantly faster compilation times, potentially reducing the compilation time from minutes to seconds, as it stores parsed code in a binary format for easy and quick access, especially as the project size grows.', 'duration': 154.979, 'highlights': ['Using precompiled headers can reduce compilation times from minutes to seconds, resulting in significantly faster compilation times, especially as the project size grows.', 'Precompiled headers store parsed code in a binary format, making it quicker for the compiler to access compared to parsing text, ultimately leading to faster compilation times.', 'Precompiled headers include a bunch of header files and code, compiling it once and storing it in a binary format for easy and quick access, which significantly improves compilation times.']}, {'end': 461.664, 'start': 352.583, 'title': 'Optimizing precompiled headers in project', 'summary': 'Explains the importance of being selective in placing files in precompiled headers to avoid slowing down compilation time, advocating for including frequently used project files while avoiding regularly changing files like log.h.', 'duration': 109.081, 'highlights': ['Precompiled header should not include frequently changing files like log.H to prevent slowing down compilation time, but can include project files that are used frequently.', 'Including frequently used project files in precompiled headers provides convenience and faster access to functions, reducing the need for manual inclusion in every CPP file.', 'Regularly changing files like log.H should not be included in the precompiled header as it requires recompilation of the entire precompiled header every time the file is changed.']}], 'duration': 264.6, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto197064.jpg', 'highlights': ['Using precompiled headers can reduce compilation times from minutes to seconds, resulting in significantly faster compilation times, especially as the project size grows.', 'Precompiled headers store parsed code in a binary format, making it quicker for the compiler to access compared to parsing text, ultimately leading to faster compilation times.', 'Precompiled headers include a bunch of header files and code, compiling it once and storing it in a binary format for easy and quick access, which significantly improves compilation times.', 'Precompiled header should not include frequently changing files like log.H to prevent slowing down compilation time, but can include project files that are used frequently.', 'Including frequently used project files in precompiled headers provides convenience and faster access to functions, reducing the need for manual inclusion in every CPP file.', 'Regularly changing files like log.H should not be included in the precompiled header as it requires recompilation of the entire precompiled header every time the file is changed.']}, {'end': 760.462, 'segs': [{'end': 551.794, 'src': 'embed', 'start': 523.465, 'weight': 0, 'content': [{'end': 525.508, 'text': 'So put all of that into your pre-compiled header.', 'start': 523.465, 'duration': 2.043}, {'end': 533.581, 'text': 'right?. That stuff belongs there, because that is a lot of code, probably many times more code than your actual application, than your actual project.', 'start': 526.616, 'duration': 6.965}, {'end': 536.823, 'text': "right?. You're compiling that every single time per CPP file.", 'start': 533.581, 'duration': 3.242}, {'end': 537.524, 'text': "That's terrible.", 'start': 536.863, 'duration': 0.661}, {'end': 542.808, 'text': "Put it into a pre compiled header where it can just be left alone, and you'll get the benefit of first of all,", 'start': 537.964, 'duration': 4.844}, {'end': 545.269, 'text': 'getting access to everything in every CPP file right?', 'start': 542.808, 'duration': 2.461}, {'end': 551.794, 'text': "You won't need to actually include like memory, for example, if you want to use smart pointers or include vector all the time,", 'start': 545.289, 'duration': 6.505}], 'summary': 'Put excessive code in pre-compiled header to speed up compilation and access all cpp files.', 'duration': 28.329, 'max_score': 523.465, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto523465.jpg'}, {'end': 667.987, 'src': 'embed', 'start': 608.675, 'weight': 2, 'content': [{'end': 615.458, 'text': 'And it can be very difficult in terms of modularity and code reuse for you to actually be like okay, well, now I can take this file,', 'start': 608.675, 'duration': 6.783}, {'end': 616.278, 'text': 'put it into another project.', 'start': 615.458, 'duration': 0.82}, {'end': 618.039, 'text': 'Wait, I have no idea what it needs, right?', 'start': 616.338, 'duration': 1.701}, {'end': 626.083, 'text': "If you decide to include GLFW or something in that actual header file in your actual CVP file that you've taken, it would be very clear, wouldn't it,", 'start': 618.539, 'duration': 7.544}, {'end': 629.126, 'text': 'that this file needs this file right?', 'start': 626.083, 'duration': 3.043}, {'end': 637.312, 'text': 'But if you have just include PCH and then a bunch of includes in that PCH, it can kind of make it a little bit harder.', 'start': 629.686, 'duration': 7.626}, {'end': 643.557, 'text': "So that's what a lot of people kind of mention when they're dealing with precompile headers that you know.", 'start': 637.672, 'duration': 5.885}, {'end': 647.219, 'text': "be careful, maybe don't include all dependencies there, because it'll make it clearer and easier to read.", 'start': 643.557, 'duration': 3.662}, {'end': 651.721, 'text': 'if you actually include your dependencies per kind of file that needs them.', 'start': 648.3, 'duration': 3.421}, {'end': 653.522, 'text': 'And I agree with that to an extent.', 'start': 652.121, 'duration': 1.401}, {'end': 656.603, 'text': 'Depends how kind of specific that dependency is.', 'start': 653.602, 'duration': 3.001}, {'end': 662.225, 'text': "If you're making a game engine and you want to include GLFW, you know in your PCH.", 'start': 657.163, 'duration': 5.062}, {'end': 666.526, 'text': 'I mean you can, but on the other hand, think about how many actual source files need that.', 'start': 662.225, 'duration': 4.301}, {'end': 667.987, 'text': 'Not that many, right?', 'start': 666.987, 'duration': 1}], 'summary': 'Precompiled headers can impact modularity and code reuse, caution needed with dependencies.', 'duration': 59.312, 'max_score': 608.675, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto608675.jpg'}, {'end': 744.468, 'src': 'embed', 'start': 711.364, 'weight': 1, 'content': [{'end': 713.845, 'text': "And stuff that you don't want to keep recompiling from scratch every time.", 'start': 711.364, 'duration': 2.481}, {'end': 718.443, 'text': "GLW on the other hand, you know, kind of something you can probably compile once and you're done.", 'start': 714.841, 'duration': 3.602}, {'end': 721.624, 'text': "So that's kind of the idea of precompiled headers.", 'start': 719.263, 'duration': 2.361}, {'end': 723.105, 'text': "I've talked a lot about this whole thing.", 'start': 721.664, 'duration': 1.441}, {'end': 726.326, 'text': "Let's jump into it and take a look at a few examples,", 'start': 724.305, 'duration': 2.021}, {'end': 731.649, 'text': "and we'll also kind of measure how long it takes to build using precompiled headers and not using precompiled headers.", 'start': 726.326, 'duration': 5.323}, {'end': 735.179, 'text': "So what we've kind of got here is a very simple Hello World application.", 'start': 732.116, 'duration': 3.063}, {'end': 740.024, 'text': "It says Hello World, right? However, it includes this file which I've named pch.h.", 'start': 735.72, 'duration': 4.304}, {'end': 742.526, 'text': "Now, precompiled header is kind of what I've called it.", 'start': 740.104, 'duration': 2.422}, {'end': 744.468, 'text': 'It can be called absolutely anything.', 'start': 742.546, 'duration': 1.922}], 'summary': 'Precompiled headers reduce compilation time, demonstrated with hello world app.', 'duration': 33.104, 'max_score': 711.364, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto711364.jpg'}], 'start': 462.504, 'title': 'Benefits of precompiled header in c++', 'summary': 'Highlights the importance of using precompiled headers in c++ to include external dependencies like stl and windows api, reducing compilation time and improving code modularity, while also discussing the selective inclusion of dependencies to improve readability and compile time, with examples and measurements provided.', 'chapters': [{'end': 629.126, 'start': 462.504, 'title': 'Benefits of precompiled header in c++', 'summary': 'Highlights the importance of using precompiled headers in c++ to include external dependencies like stl and windows api, reducing compilation time and improving code modularity, with examples and emphasizing the potential issues of hiding dependencies by including them in the pch.', 'duration': 166.622, 'highlights': ["Precompiled headers are vital for including code that isn't yours, such as STL or Windows API, as they contain a significant amount of code that is not modified and is used frequently, reducing compilation time. Reduction in compilation time, inclusion of significant code", 'Using precompiled headers provides access to included code in every CPP file, improving convenience and speeding up the compilation process. Improved convenience, faster compilation', 'Including all dependencies in the PCH can potentially hide the actual dependencies used in specific CPP files, leading to difficulties in modularity and code reuse. Potential issues of modularity and code reuse']}, {'end': 760.462, 'start': 629.686, 'title': 'Precompiled headers and dependency management', 'summary': 'Discusses the use of precompiled headers for dependency management, highlighting the importance of selectively including dependencies to improve readability and compile time, and provides examples and measurements of the impact of using precompiled headers.', 'duration': 130.776, 'highlights': ['The importance of selectively including dependencies in precompiled headers to improve readability and compile time.', 'Highlighting the example of including GLFW in precompiled headers for a game engine, where only one CPP file actually needs to include GLFW, emphasizing the need for specificity in dependency inclusion.', 'The suggestion to include widely used components like STL in precompiled headers to minimize recompilation and improve efficiency.', 'Providing examples and measurements of the impact of using precompiled headers on build time in a Hello World application.']}], 'duration': 297.958, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto462504.jpg', 'highlights': ['Reduction in compilation time, inclusion of significant code', 'Improved convenience, faster compilation', 'Potential issues of modularity and code reuse', 'Importance of selectively including dependencies for readability and compile time', 'Emphasizing the need for specificity in dependency inclusion', 'Minimizing recompilation and improving efficiency', 'Providing examples and measurements of the impact of using precompiled headers on build time']}, {'end': 994.624, 'segs': [{'end': 848.207, 'src': 'embed', 'start': 826.693, 'weight': 0, 'content': [{'end': 836.079, 'text': 'it has to go over and process 370 000 lines of source code and then tokenize them and then compile them and then do all of that stuff right every single time.', 'start': 826.693, 'duration': 9.386}, {'end': 837.34, 'text': 'we want to avoid that.', 'start': 836.079, 'duration': 1.261}, {'end': 842.664, 'text': 'so what we can do is actually use pre-compiled headers, so i can turn this into a pre-compiled header.', 'start': 837.34, 'duration': 5.324}, {'end': 843.365, 'text': 'this is a good.', 'start': 842.664, 'duration': 0.701}, {'end': 846.387, 'text': 'this is a pretty good example of what you might have in your pch.', 'start': 843.365, 'duration': 3.022}, {'end': 848.207, 'text': "I haven't got any kind of.", 'start': 846.927, 'duration': 1.28}], 'summary': 'To optimize processing, 370,000 lines of code can be converted into a pre-compiled header, reducing compilation time.', 'duration': 21.514, 'max_score': 826.693, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto826693.jpg'}, {'end': 918.014, 'src': 'heatmap', 'start': 877.714, 'weight': 0.804, 'content': [{'end': 883.338, 'text': 'But what we need to do for Visual Studio is actually create a CPP file which includes our header file right?', 'start': 877.714, 'duration': 5.624}, {'end': 889.442, 'text': 'And then on that CPP file, we need to right-click, hit Properties and then go under C++.', 'start': 883.918, 'duration': 5.524}, {'end': 898.186, 'text': 'Under CAC++, we need to go to Precompiled Headers and then select our precompiled header to be create right?', 'start': 892.083, 'duration': 6.103}, {'end': 904.088, 'text': "So for this specific pch.cpp file, we're going to create a precompiled header and then hit OK.", 'start': 898.226, 'duration': 5.862}, {'end': 909.63, 'text': "Then I'm going to go to the entire properties for the entire project, right? The properties for the entire project.", 'start': 904.788, 'duration': 4.842}, {'end': 918.014, 'text': "And I'm going to under CAC++ Precompiled Headers, select this to be use.", 'start': 910.291, 'duration': 7.723}], 'summary': 'In visual studio, create a cpp file with precompiled header to be used for the entire project.', 'duration': 40.3, 'max_score': 877.714, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto877714.jpg'}, {'end': 974.576, 'src': 'embed', 'start': 938.519, 'weight': 1, 'content': [{'end': 940.48, 'text': 'And then this is what it will actually compile to.', 'start': 938.519, 'duration': 1.961}, {'end': 942.08, 'text': 'So this is the output file.', 'start': 940.5, 'duration': 1.58}, {'end': 945.621, 'text': 'This is the compiled binary format of our actual precompiled header.', 'start': 942.1, 'duration': 3.521}, {'end': 949.743, 'text': "and then, because we've set that for the project, it applies to everything.", 'start': 946.641, 'duration': 3.102}, {'end': 954.146, 'text': 'so, in summary, set the project to use your pre-compiled headers and specify which one is used.', 'start': 949.743, 'duration': 4.403}, {'end': 962.951, 'text': "and then for your um cpp file, which includes pch dot h um, set it to create pre-compiled header, and that's all you need to do, okay?", 'start': 954.146, 'duration': 8.805}, {'end': 968.154, 'text': 'so now, if i just right click build, you can see we should build successfully um and everything should be fine.', 'start': 962.951, 'duration': 5.203}, {'end': 969.095, 'text': "that's how we create pchs.", 'start': 968.154, 'duration': 0.941}, {'end': 974.576, 'text': "Now let's take a look at how much that actually sped up our compile time.", 'start': 970.055, 'duration': 4.521}], 'summary': 'Setting project to use precompiled headers significantly speeds up compile time.', 'duration': 36.057, 'max_score': 938.519, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto938519.jpg'}], 'start': 760.462, 'title': 'Precompiled headers in c++ and visual studio', 'summary': 'Covers the use of precompiled headers in a c++ project, emphasizing the avoidance of recompiling 370,000 lines of code and discusses the process of creating and utilizing precompiled headers in visual studio, including the impact on compile time.', 'chapters': [{'end': 848.207, 'start': 760.462, 'title': 'Using pre-compiled headers in c++', 'summary': 'Discusses the use of pre-compiled headers in a c++ project, highlighting the inclusion of a large amount of code in the pch file, leading to the need for pre-compiled headers to avoid recompilation of 370,000 lines of code in every cpp file.', 'duration': 87.745, 'highlights': ['The inclusion of a large amount of code in the pch file, including C++ library stuff, data structures, and the Windows API, leads to 370,000 lines of code being recompiled every time it is included in a cpp file.', 'The need to avoid recompiling 370,000 lines of source code every time leads to the suggestion of using pre-compiled headers to improve compilation time and efficiency.', 'Demonstrates the process of generating preprocessor output, revealing the 370,000 lines of code that would be recompiled every time the pch is included in a cpp file.']}, {'end': 994.624, 'start': 848.207, 'title': 'Creating precompiled headers in visual studio', 'summary': 'Discusses the process of creating and using precompiled headers in visual studio, including setting the project to use precompiled headers, specifying the header file, and observing the impact on compile time.', 'duration': 146.417, 'highlights': ['The process involves creating a CPP file which includes the header file and setting it to create a precompiled header, then setting the entire project to use precompiled headers and specifying the one to be used.', 'The precompiled header significantly speeds up the compile time, especially in basic projects with minimal code, as observed in the comparison before and after using precompiled headers.', "Visual Studio's approach to precompiled headers is discussed, along with the similarities and differences with G++ and Clang."]}], 'duration': 234.162, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto760462.jpg', 'highlights': ['Using precompiled headers avoids recompiling 370,000 lines of code, improving efficiency.', 'Creating precompiled headers significantly speeds up compile time, especially in basic projects.', 'Demonstrates the process of generating preprocessor output, revealing the impact on compilation time.']}, {'end': 1272.5, 'segs': [{'end': 1100.938, 'src': 'embed', 'start': 1071.932, 'weight': 0, 'content': [{'end': 1074.135, 'text': 'Okay, so down from one and a half seconds to half a second.', 'start': 1071.932, 'duration': 2.203}, {'end': 1075.157, 'text': "That's three times faster.", 'start': 1074.155, 'duration': 1.002}, {'end': 1078.101, 'text': 'And we can remove this and try it again just to make sure.', 'start': 1075.177, 'duration': 2.924}, {'end': 1079.343, 'text': 'And there you go.', 'start': 1078.802, 'duration': 0.541}, {'end': 1083.63, 'text': 'You can see just how much faster using precompiled headers actually made this compilation.', 'start': 1079.664, 'duration': 3.966}, {'end': 1085.312, 'text': 'And this project is absolutely tiny.', 'start': 1083.65, 'duration': 1.662}, {'end': 1091.095, 'text': "Cool, so let's take a look at how we might do this in G++ and we'll also kind of time that.", 'start': 1086.653, 'duration': 4.442}, {'end': 1095.616, 'text': "So the first thing I'll do is I'm just in the source directory here which has these three files.", 'start': 1091.695, 'duration': 3.921}, {'end': 1100.938, 'text': "All I'm going to do first of all is just see how long it takes to compile this project without using pre-compiled headers.", 'start': 1096.076, 'duration': 4.862}], 'summary': 'Reduced compilation time from 1.5s to 0.5s, 3x faster, using pre-compiled headers. testing g++ compilation next.', 'duration': 29.006, 'max_score': 1071.932, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto1071932.jpg'}, {'end': 1261.531, 'src': 'embed', 'start': 1177.717, 'weight': 4, 'content': [{'end': 1182.739, 'text': 'Okay, so hopefully all these examples have kind of shed some light onto why you should be using precompiled headers.', 'start': 1177.717, 'duration': 5.022}, {'end': 1187.822, 'text': 'They speed up your build times a lot and they also make it more convenient to actually write code,', 'start': 1183.1, 'duration': 4.722}, {'end': 1191.483, 'text': "since you don't have to keep including commonly used header files over and over again.", 'start': 1187.822, 'duration': 3.661}, {'end': 1194.025, 'text': 'I hope that made sense.', 'start': 1192.984, 'duration': 1.041}, {'end': 1198.668, 'text': "Let me know in the comments below if you've been using precompiled headers, if this is the first time you've heard of it,", 'start': 1194.225, 'duration': 4.443}, {'end': 1202.591, 'text': 'if you think that this is something that you should use or kind of your experience with them.', 'start': 1198.668, 'duration': 3.923}, {'end': 1206.835, 'text': 'In general, every software project should be using precompiled headers.', 'start': 1203.132, 'duration': 3.703}, {'end': 1208.055, 'text': "There's no real kind of.", 'start': 1206.855, 'duration': 1.2}, {'end': 1209.096, 'text': 'should I use them, should I not??', 'start': 1208.055, 'duration': 1.041}, {'end': 1211.778, 'text': 'every project should be using them.', 'start': 1210.297, 'duration': 1.481}, {'end': 1217.782, 'text': "what to put into your precompiled header is a different story, and we've covered a few of the kind of good examples of what you should put in there.", 'start': 1211.778, 'duration': 6.004}, {'end': 1220.604, 'text': 'but whether or not you should be using them, yes, absolutely,', 'start': 1217.782, 'duration': 2.822}, {'end': 1225.767, 'text': "unless you're making a little sandbox project and you don't want to go through the hassle of setting it up, not that it's particularly hard,", 'start': 1220.604, 'duration': 5.163}, {'end': 1228.168, 'text': 'then yeah, I probably would avoid that.', 'start': 1226.887, 'duration': 1.281}, {'end': 1230.71, 'text': 'But otherwise, you should be using print compiled headers.', 'start': 1228.268, 'duration': 2.442}, {'end': 1232.211, 'text': 'Hope you guys enjoyed this video.', 'start': 1231.13, 'duration': 1.081}, {'end': 1233.651, 'text': 'If you did, you can hit the like button.', 'start': 1232.371, 'duration': 1.28}, {'end': 1239.135, 'text': 'You can help support this series and everything that I do here on this channel by going to patreon.com forward slash the churner.', 'start': 1233.671, 'duration': 5.464}, {'end': 1245.598, 'text': "You'll get videos early as well as access to cool kind of source code development repositories and many other cool rewards.", 'start': 1239.155, 'duration': 6.443}, {'end': 1248.08, 'text': 'And it does help me make more of these videos.', 'start': 1245.758, 'duration': 2.322}, {'end': 1249.661, 'text': 'Hope you guys enjoyed this.', 'start': 1248.82, 'duration': 0.841}, {'end': 1253.164, 'text': 'Leave some comments below as to what you want to see next in the C++ series.', 'start': 1250.001, 'duration': 3.163}, {'end': 1258.508, 'text': "I'll probably be kind of, since I'm focusing a lot on the game engine series, I'll be kind of making videos to do with that probably.", 'start': 1253.244, 'duration': 5.264}, {'end': 1261.531, 'text': 'Standalone C++ videos based on topics that we covered there.', 'start': 1259.109, 'duration': 2.422}], 'summary': 'Using precompiled headers speeds up build times and improves code convenience. every software project should use them.', 'duration': 83.814, 'max_score': 1177.717, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto1177717.jpg'}], 'start': 995.164, 'title': 'Utilizing precompiled headers in c++', 'summary': 'Demonstrates a 10x improvement in g++ compilation speed by utilizing precompiled headers, emphasizing their benefits in reducing build times and making coding more convenient, and discussing the advantages of using print compiled headers in c++ while promoting future content.', 'chapters': [{'end': 1177.477, 'start': 995.164, 'title': 'Using precompiled headers for faster compilation', 'summary': 'Demonstrates the significant reduction in build time by utilizing precompiled headers, with build times decreasing from 3.3 seconds to 0.3 seconds in the case of g++ compilation, showcasing an approximately 10x improvement in compilation speed.', 'duration': 182.313, 'highlights': ['Using precompiled headers reduced build time from 3.3 seconds to 0.3 seconds in G++ compilation, showcasing a 10x improvement in compilation speed. The G++ compilation time decreased significantly from 3.3 seconds to 0.3 seconds after implementing precompiled headers, demonstrating a substantial 10x improvement in build time.', 'Switching to precompiled headers decreased build time by 3 times for G++ compilation. The usage of precompiled headers resulted in a 3x reduction in build time for G++ compilation, with the build time dropping from 1.5 seconds to 0.3 seconds.', 'Clean build using precompiled headers took approximately 0.2 seconds in G++ compilation. After employing precompiled headers, the clean build process in G++ compilation took around 0.2 seconds, demonstrating a substantial improvement in build efficiency.', 'Initial G++ compilation took 1.5 seconds without precompiled headers. The initial G++ compilation without precompiled headers took approximately 1.5 seconds, highlighting the significant time reduction achieved through precompiled headers.']}, {'end': 1228.168, 'start': 1177.717, 'title': 'Why you should use precompiled headers', 'summary': 'Emphasizes the benefits of using precompiled headers, highlighting their ability to significantly speed up build times and make coding more convenient by reducing the need to repeatedly include common header files, concluding that every software project should use precompiled headers.', 'duration': 50.451, 'highlights': ['Precompiled headers speed up build times and make coding more convenient by reducing the need to repeatedly include common header files.', 'Every software project should use precompiled headers.', "What to put into your precompiled header is a different story, and it's important to consider what should be included.", 'Using precompiled headers is highly recommended unless the project is a small sandbox project and setting them up would be an unnecessary hassle.']}, {'end': 1272.5, 'start': 1228.268, 'title': 'Using print compiled headers in c++', 'summary': 'Discusses the benefits of using print compiled headers in c++ and encourages viewers to support the channel through patreon.com/thechurner, while teasing future c++ and game engine series content.', 'duration': 44.232, 'highlights': ['Encouraging viewers to support the channel through patreon.com/thechurner, offering early access to videos and source code development repositories, and mentioning the positive impact on creating more videos.', 'Teasing future C++ and game engine series content, asking for viewer input on potential topics, and highlighting the relevance of the game engine series to the concepts covered in the C++ series.']}], 'duration': 277.336, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/eSI4wctZUto/pics/eSI4wctZUto995164.jpg', 'highlights': ['Using precompiled headers reduced build time from 3.3 seconds to 0.3 seconds in G++ compilation, showcasing a 10x improvement in compilation speed.', 'Switching to precompiled headers decreased build time by 3 times for G++ compilation, with the build time dropping from 1.5 seconds to 0.3 seconds.', 'Clean build using precompiled headers took approximately 0.2 seconds in G++ compilation, demonstrating a substantial improvement in build efficiency.', 'Initial G++ compilation took 1.5 seconds without precompiled headers, highlighting the significant time reduction achieved through precompiled headers.', 'Precompiled headers speed up build times and make coding more convenient by reducing the need to repeatedly include common header files.', 'Every software project should use precompiled headers.', "What to put into your precompiled header is a different story, and it's important to consider what should be included.", 'Using precompiled headers is highly recommended unless the project is a small sandbox project and setting them up would be an unnecessary hassle.', 'Encouraging viewers to support the channel through patreon.com/thechurner, offering early access to videos and source code development repositories, and mentioning the positive impact on creating more videos.', 'Teasing future C++ and game engine series content, asking for viewer input on potential topics, and highlighting the relevance of the game engine series to the concepts covered in the C++ series.']}], 'highlights': ['Using precompiled headers can reduce compilation times from minutes to seconds, resulting in significantly faster compilation times, especially as the project size grows.', 'Precompiled headers store parsed code in a binary format, making it quicker for the compiler to access compared to parsing text, ultimately leading to faster compilation times.', 'Precompiled headers include a bunch of header files and code, compiling it once and storing it in a binary format for easy and quick access, which significantly improves compilation times.', 'Using precompiled headers avoids recompiling 370,000 lines of code, improving efficiency.', 'Using precompiled headers reduced build time from 3.3 seconds to 0.3 seconds in G++ compilation, showcasing a 10x improvement in compilation speed.', 'Precompiled headers speed up build times and make coding more convenient by reducing the need to repeatedly include common header files.']}