text stringlengths 0 2.35k |
|---|
**Jaana Dogan:** I personally use a lot of tools from Dominik Honnef. He has this go-tools repo, Staticcheck tool, which contains a lot of style check, a lot of linting type of features that Golint doesn't support. There are some cases sometimes - like, there's a controversial style topic; it's not possible to merge it... |
**Mat Ryer:** Yeah. And Fatih Arslan - he made a service which I think is called Fixmie. It's kind of a GitHub integration, as I understand it, and it analyzes -- it does a bit like the Go Report Card, but it actually creates PRs with changes in it. It's sort of proactive, like you've got another member on your team --... |
Has anyone here written any tooling, static analysis or otherwise? |
**Jaana Dogan:** I only wrote some tools to generate some stuff from an interface -- well, these are also some static tools... One common case is generating implementations of interfaces, and there's a lot of boilerplate, so I wrote a tool that takes the interface and creates the concrete implementation, and then you j... |
**Mat Ryer:** And did you use the AST stuff in the parser, and things, to build that? |
**Jaana Dogan:** Yeah, I used whatever there was in the standard library. It was not that hard. It was not that good-looking either, but it was possible to get it done in 100 lines, or something. |
**Mat Ryer:** Yeah. Okay, cool. Well, I think we should also spend some time talking about some of the performance tools as well, that we just get for free. There's some great talks on YouTube... It's quite an interesting subject, and it's talked about quite a lot, and from different angles. Jaana, perhaps you could te... |
**Jaana Dogan:** \[51:56\] It might be possible, because I worked on some of the dynamic tools when I was working on Go, so it was part of my full-time job... And I generally have been working in this area for a while... So it's possible that you have seen me giving a talk, but I can't remember, because I'm giving too ... |
**Mat Ryer:** I thought it was all confidential what you work on. |
**Jaana Dogan:** The confidential stuff is different than this. |
**Mat Ryer:** Oh. What's that? |
**Jaana Dogan:** It's none of my performance tools, it's more about computing products... |
**Mat Ryer:** Yeah. |
**Jaana Dogan:** We'll figure it out in a couple of weeks. \[laughter\] |
**Mat Ryer:** Yeah. I'm just trying to be like one of those hard-hitting journalists that tries to get out the information that you don't wanna say. \[laughter\] But I'm just too polite. You just say "I'm not gonna talk about it", and I go "Oh, okay. Bye..." |
**Jaana Dogan:** Well, the problem is I really don't know. Like, I know generally what I'm going to be working on, but I don't know the specifics, and I'm a really precise person, I think. I don't wanna give any impressions that I'm going to work on something that I'm not going to, because people will get upset. |
**Mat Ryer:** Absolutely fair enough. |
**Jaana Dogan:** Just joking, yeah. |
**Mat Ryer:** So Jaana, could you tell us about some of these tools and what they're for, for anyone that doesn't know about them? |
**Jaana Dogan:** Yeah. Generally speaking, let's go beyond the performance tools - there are a lot of dynamic tools in Go, and they are part of the standard tooling. Some of them are related to performance, some of them are more like debugging type of stuff... |
We can talk about, for example, performance initially... When Go first came around, it came around with some of those dynamic tools, because we went to the SRE team and the SRE team at Google is just really specific about what they wanna put in production. They wanna have enough visibility into things, and some of thes... |
They wanna be able to get the profiles, they wanna get some runtime traces... Because they specifically wanna be able to understand when there is something going wrong, and they wanna be able to pinpoint to those. So pprof support was baked into Go since the early times, because of that requirement, for example. It pro... |
On top of pprof support, there's good benchmarking support baked into go test. So benchmarking is a first-class citizen in Go, which is not really quite the same situation in other languages. I think it kind of creates this culture where you care about benchmarking stuff. I don't know what is your opinion on this, but ... |
**Mat Ryer:** Well, I've seen it used perfectly, and I've also seen it used incorrectly. I've seen an example where the benchmark, just because of a slight issue with the way it was written, it was reporting completely incorrect results. But if it's used in the right way... It depends on what you're testing, I suppose.... |
\[56:14\] I agree with you, Jaana - I love the fact that it's baked straight into the language, and you just have to write a function that starts with "func benchmark name", take in the special variable, and as long as your get the for loop inside it in the right place, and also think about setup and teardown work and ... |
**Jaana Dogan:** Yeah, I think benchmarking in general is a discipline that takes a lot of time to learn, and what are the other factors that actually impact the performance. So I agree with you, I've seen a lot of wrong benchmarks, and people are super-strongly opinionated that it's actually an optimization, but it's ... |
**Johnny Boursiquot:** When it comes to benchmarking and performance optimization, I try very hard not to jump to that right away. I'll try to solve a problem first, and then try to optimize... Basically, prevent premature optimization. And these tools, because they're part of the standard toolchain, they make it very ... |
There was a time - maybe we're still in that time - where it seems like there was a new HTTP \[unintelligible 00:58:13.12\] or router coming out every couple of weeks, and they were all like "Oh, benchmark. Compared to these other things, this one has zero allocation, and is 0.05% faster than the other one." I kind of ... |
I'm very careful with that, because it's too easy to create a culture within an engineering team of "Okay, if I can even ship this thing, I have to make sure it's super-optimized." We're kind of putting the cart before the horse a little bit there; it's too easy to do that, so I tend to shy away from that stuff. I brin... |
**Jaana Dogan:** I completely agree. I think optimizations in development time is kind of like fabricated problems. You realize what needs to be optimized in production, right? For example, what we do is continuous profiling, which is we keep collecting some profiles from the production binaries, and we sort of like ha... |
\[01:00:09.25\] So I think it just really makes more sense to start thinking about these cases in production, and by looking at the data you just go back to the development environment and try to optimize those things, and keep using these tools. |
One of the nice things about Go profiling - the actual pprof - is it's a really low overhead type of profiling thing, and you can enable it in production. So you can just keep getting profiles from production, without impacting the critical paths so crazily. There's overhead, but there's some strategies - if you have m... |
**Johnny Boursiquot:** Right. Having a problem before you solve it. |
**Jaana Dogan:** Yeah. |
**Mat Ryer:** Jaana, when you say you do continuous profiling, when you deploy services, do you have pprof already enabled in there, and you just switch it on? |
**Jaana Dogan:** Yeah, so all the pprof tools -- pprof can be tweakable. You can turn it on dynamically, and you can turn it off. So what we do is basically turn it on for several minutes, collect the data, just parse it, store it, and then we aggregate all that data, and we have this daily, weekly etc. report... And y... |
I wish that Go had some tools around maybe supporting this type of more continuous profiling features. It's possible to write a tool that aggregates multiple pprofiles. It could be possible to write a library that automatically just turns once-in-a-while reports to some central service, and then turns it off, and so on... |
Some companies are aware of these methodologies and some companies are not. It would be so nice if the community was producing more best practices, as well as more tooling around this. |
**Mat Ryer:** \[01:03:29.23\] Well, there we go; there's the call gone out. Anyone who's looking for a new open source project or something to hack on - what a great problem. Could you build something that samples running Go code periodically, at some schedule, and collects the results up? It would be extremely useful,... |
**Jaana Dogan:** Yeah. It's a lot of fun once you start to see, for example, a large company aggregating all the profiling data. For example, you can actually improve your bill on your cloud provider; you can say that "Lots of the calls are dependent on this one function, and if you optimize it, we can actually cut the... |
**Mat Ryer:** \[01:02:49.14\] Well, I love the message of "Wait till you've got something running, and then look at optimizing it." I think in some cases you can shortcut it, but generally speaking - yeah, that advice is sound. The idea of being able to profile running production systems to understand them better I thi... |
Well, on that bombshell -- I mean, I think that's it. I think we've reached the end of the hour, and so the end of this episode. Thank you very much, Johnny and Jaana. It's been awesome. Have you liked it? |
**Jaana Dogan:** I can talk about this topic for hours, and I think this was awesome... But we should keep talking about tools, I think. \[laughs\] |
**Mat Ryer:** Yeah, absolutely. Well, there's lots more to discuss, and I might even see if we can bring in some people from the community that have built some of the tools that we're using today. |
One other little bit of info that I think is quite interesting - the only actual contribution I personally made to the Go project was to remove something from Golint. One time Golint got a bit easier to satisfy thanks to me... \[laughter\] You're welcome. |
**Jaana Dogan:** Yay! \[applauds\] |
**Mat Ryer:** I delete code. I love it. Well, yeah, that's it. Thank you so much, and we'll see you next time on Go Time! |
• Discussion of a re-released episode of "Go Time" from 2019 about tooling |
• Overview of the changes in the world since the original episode was released (COVID, social distancing, etc.) |
• Promotion of Sourcegraph's new feature, Code Insights, for tracking code base metrics |
• Introduction to the main topic of discussion: Go tooling and its uses in building, running, testing, formatting, and linting code |
• Guest appearance by Jana Dogen, who is joining the show after a brief absence due to travel and a potential job change |
• Johnny Borsico discusses his new job and the excitement and challenges that come with it |
• GoTools are discussed, specifically GoFumpt (also known as GoFormat), which formats Go code into a uniform style |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.