9:59:59.000,9:59:59.000 So Hi there, everyone. 9:59:59.000,9:59:59.000 My name is Chandler Carruth. 9:59:59.000,9:59:59.000 I work for Google 9:59:59.000,9:59:59.000 I work on our C++ language platform 9:59:59.000,9:59:59.000 I work on our C++ compilers 9:59:59.000,9:59:59.000 specifically the Clang and ? 9:59:59.000,9:59:59.000 And I'm here to talk to you a little about performance. 9:59:59.000,9:59:59.000 and efficiency, and making code fast, 9:59:59.000,9:59:59.000 and all the different things that go into that. 9:59:59.000,9:59:59.000 But before I do too much 9:59:59.000,9:59:59.000 I want to give actually give you guys a little bit of a 9:59:59.000,9:59:59.000 one might say are expectations. 9:59:59.000,9:59:59.000 Because I have been reading the twitter feed 9:59:59.000,9:59:59.000 from all these folks, that talk about all these crazy good questions 9:59:59.000,9:59:59.000 I just want you guys to essentially know this is my view 9:59:59.000,9:59:59.000 of what Performance 101 should be. 9:59:59.000,9:59:59.000 Okay? This is going to be kind of an intro talk. 9:59:59.000,9:59:59.000 You guys are hard core, really deep performance nuts. 9:59:59.000,9:59:59.000 You may be a little bit bored, and please be kind, 9:59:59.000,9:59:59.000 because I'm going to gloss over some things 9:59:59.000,9:59:59.000 you could go into thoroughly if you really want to 9:59:59.000,9:59:59.000 We're going to talk about efficiency, performance, 9:59:59.000,9:59:59.000 algorithms and data structures. 9:59:59.000,9:59:59.000 And the first thing we are going to do is we're not going to talk about them. 9:59:59.000,9:59:59.000 We're going to talk about why anyone cares about them. 9:59:59.000,9:59:59.000 How many folks here think it's really important to have high performance in C++? Like certain that it's super important? 9:59:59.000,9:59:59.000 Everyone thinks it's important! 9:59:59.000,9:59:59.000 And the folks here have a really clear idea why performance is important. 9:59:59.000,9:59:59.000 Now, all the people who didn't raise their hands the second time, 9:59:59.000,9:59:59.000 Please reconsider raising your hand the first time. 9:59:59.000,9:59:59.000 We actually need to understand why performance is important in C++, 9:59:59.000,9:59:59.000 before we actually decide it's important, we're going to care a lot about it. 9:59:59.000,9:59:59.000 I'm going to tell you why I care about performance in C++. 9:59:59.000,9:59:59.000 Most of it comes down to a quote from Nicolas Werth. 9:59:59.000,9:59:59.000 Which I will try to pronounce correctly but fail miserably. 9:59:59.000,9:59:59.000 I actually really like a lot of our stuff, 9:59:59.000,9:59:59.000 I think he really encapsulates a lot of my thoughts about the philosophy of software here. 9:59:59.000,9:59:59.000 The software is getting slower more rapidly than (1:58) 9:59:59.000,9:59:59.000 But that's what happened 9:59:59.000,9:59:59.000 We now have to care about 9:59:59.000,9:59:59.000 And we essentially 9:59:59.000,9:59:59.000 You have to choose one 9:59:59.000,9:59:59.000 We're going to choose small 9:59:59.000,9:59:59.000 The other problem 9:59:59.000,9:59:59.000 What do we do about the battery 9:59:59.000,9:59:59.000 How many folks here have charged their phone today 9:59:59.000,9:59:59.000 That's a problem. 9:59:59.000,9:59:59.000 That's not a feature, that's a bug. 9:59:59.000,9:59:59.000 How many 9:59:59.000,9:59:59.000 We've entered 9:59:59.000,9:59:59.000 Power became relevant 9:59:59.000,9:59:59.000 Power efficient instructions 9:59:59.000,9:59:59.000 Optimizing for power usage 9:59:59.000,9:59:59.000 Because this is mostly total junk science. 9:59:59.000,9:59:59.000 Here is the number one 9:59:59.000,9:59:59.000 Finish running the program 9:59:59.000,9:59:59.000 The faster your software runs, the lest 9:59:59.000,9:59:59.000 If I run 9:59:59.000,9:59:59.000 But it's not, okay? 9:59:59.000,9:59:59.000 Here's the thing. 9:59:59.000,9:59:59.000 We've only 9:59:59.000,9:59:59.000 We figured out how to turn them off. 9:59:59.000,9:59:59.000 if you have a 9:59:59.000,9:59:59.000 the way it conserves power is by turning itself off 9:59:59.000,9:59:59.000 The more 9:59:59.000,9:59:59.000 So we actually want to make code faster 9:59:59.000,9:59:59.000 There are some extreme exceptions to it 9:59:59.000,9:59:59.000 But 99.999999% of the time 9:59:59.000,9:59:59.000 But batteries aren't the only 9:59:59.000,9:59:59.000 You'll note that 9:59:59.000,9:59:59.000 The only thing it is doing is taking electricity and turning it into heat. 9:59:59.000,9:59:59.000 That is it's job 9:59:59.000,9:59:59.000 And unfortunately, electricity costs a lot of money 9:59:59.000,9:59:59.000 And so power becomes very, very important 9:59:59.000,9:59:59.000 And I find it interesting