text stringlengths 0 2.35k |
|---|
[3194.68 --> 3195.00] Yeah. |
[3195.00 --> 3198.96] I think generally speaking, I think let's go beyond the performance tools. |
[3199.34 --> 3203.54] There are a lot of like dynamic tools in Go and they are a part of the standard tooling. |
[3204.12 --> 3205.96] Some of them are related to performance. |
[3206.18 --> 3209.18] Some of them are more related to like debugging type of stuff. |
[3210.30 --> 3216.64] The typical, you know, let's, we, we can talk about, for example, performance initially. |
[3216.64 --> 3233.52] And the Go came around when it first came around, it came around with some of the dynamic tools because we went to the SRE team and SRE team is at Google is just really specific about what they want to put in production. |
[3233.52 --> 3236.84] So they want to have like, you know, enough visibility into things. |
[3237.06 --> 3240.52] And one of, some of these were related to, you know, performance. |
[3240.98 --> 3243.60] They want to be able to, you know, get the profiles. |
[3243.76 --> 3250.76] They want to get like some runtime traces because they specifically want to be able to understand when there is something going wrong. |
[3250.76 --> 3253.10] Again, like they want to be able to pinpoint to those. |
[3253.10 --> 3262.40] So PPROF support was baked into, you know, Go since the early times because of that requirement, for example. |
[3262.88 --> 3264.10] It provides you some profiles. |
[3264.92 --> 3268.08] You can also add your custom profiles, which is a useful topic. |
[3268.84 --> 3277.34] But, you know, it provides the CPU profile, memory profile, you know, Go routines and thread profile and new tech contention profile. |
[3277.34 --> 3291.86] And it was really crucial, you know, to have a language mature enough to put in production because that's basically most of people think that like performance is about development time. |
[3291.96 --> 3294.02] But it's also important in production time. |
[3294.34 --> 3301.42] On top of like PPROF support, there is like, you know, good benchmarking support baked into Go test. |
[3301.42 --> 3309.08] So benchmarking is a first class citizen, which is not really, you know, quite the same situation in other languages. |
[3309.74 --> 3315.74] And I think it kind of creates this culture where you care about, you know, benchmarking stuff, right? |
[3315.78 --> 3328.24] Like, I don't know what is your opinion on this, but I've seen, you know, lots of different communities and different opinions about benchmarking just because of the, you know, the tooling or, you know, it's really easy to write benchmarks or not. |
[3328.28 --> 3329.10] What do you think about it? |
[3329.10 --> 3334.36] Well, I've seen it used perfectly and I've also seen it used incorrectly. |
[3335.10 --> 3346.28] I've seen an example where the benchmark, just because of slight issue with the way it was written, it was reporting completely incorrect results. |
[3346.74 --> 3355.32] So, yes, I think one, but if it's used in the right way, because like, you know, if it's, if you, depends on what you're testing, I suppose. |
[3355.32 --> 3364.32] If you're going to be testing something and you're making HTTP requests, for example, there's so much variation anyway in HTTP, you're not really going to be getting any meaningful information. |
[3364.32 --> 3374.10] But if you're, if you've got two little algorithms and you want to know which one's better at certain tasks and stuff, then yeah, it's, it's, it's great. |
[3374.16 --> 3375.44] And I agree with you, Yannick. |
[3375.44 --> 3386.92] I love the fact that it's baked straight into the language and you just have to write a function that starts with, you know, funk benchmark name, take in the special variable. |
[3386.92 --> 3403.44] And as long as you get the for loop inside it in the right place and also think about setup and tear down work and where that's happening, then yeah, it's a great way to really just find out which is better because sometimes it'd be really surprising. |
[3403.44 --> 3416.24] In fact, I think it would make a great talk if someone out there wants to do it or a presentation of like, here's, here's some code, which one's the fastest and have people kind of guess. |
[3416.92 --> 3421.06] And sometimes I find it, the results to be very surprising. |
[3421.06 --> 3421.36] Yeah. |
[3421.66 --> 3422.00] Yeah. |
[3422.00 --> 3431.98] I think benchmark in general is a discipline that, you know, takes a lot of time to kind of like learn and what are the, you know, the other factors that actually improve, you know, impacts the performance. |
[3432.30 --> 3447.14] So I agree with you that like, I've seen a lot of like wrong benchmarks and people are like super strong opinion that it's actually an optimization, but it's actually like, like one specific thing that improves the performance, maybe like for one specific case or something. |
[3447.14 --> 3447.26] Okay. |
[3447.62 --> 3458.10] And I think you need to have a really good understanding of the runtime and everything around the language in order to write good benchmarks as well as like interpret the results correctly. |
[3458.10 --> 3459.78] So it's, it's a really tough game. |
[3460.96 --> 3461.54] That's true. |
[3461.54 --> 3473.54] Would you say that if, so when it comes to benchmarking and performance optimization, like I try very, very hard not to sort of jump to that sort of right away. |
[3473.54 --> 3478.66] I, you know, I'll try to solve a problem first and then, and then try to optimize. |
[3478.78 --> 3478.92] Right. |
[3478.96 --> 3483.98] So basically preventing premature optimization and these tools make it because they're part of the center, center tool chain. |
[3484.06 --> 3489.42] They make it very easy to just, you know, start using them like right then and there, especially start, start leveraging right away. |
[3489.42 --> 3500.24] Um, and there, there, there was a time, maybe we're still in that time where, you know, it seems like there was a new sort of HTTP, like MUXer router coming out every, every couple of weeks. |
[3500.24 --> 3509.24] And they were all like, Oh, benchmark compared to this, these other things, you know, this one is zero allocation and it's, you know, 0.05% faster than the other one. |
[3509.24 --> 3519.12] So it was, I was, I kind of found it silly a little bit, um, because of all that sort of going on and, and I was like, okay, we're kind of missing the point here a little bit. |
[3519.36 --> 3522.58] Um, but yeah, I mean, it's, it's having that tool. |
[3522.80 --> 3523.84] I think it's great. |
[3523.92 --> 3532.14] You know, and like you, I don't think, I don't think I've seen that busy, that kind of capability sort of built in, you know, part of, part of the language from, from, from the start. |
[3532.14 --> 3546.94] So the, I tend to sort of be very, I'm very careful with that because it's too easy to, to have, to create a culture within an engineering team of, of, okay, before I can even ship this thing, I have to make sure it's like super optimized. |
[3547.44 --> 3552.00] And, and we're putting kind of the cart before the horse a little bit there. |
[3552.26 --> 3553.80] It's too easy to do that. |
[3553.86 --> 3556.34] So I tend to be, I tend to shy away from that stuff. |
[3557.02 --> 3559.12] Um, you know, I sort of bring it in when I need to. |
[3559.34 --> 3560.40] I completely agree. |
[3560.40 --> 3565.66] I think, um, you know, optimizations in development time is kind of like fabricated problems. |
[3565.66 --> 3570.06] Like, I mean, you realize what needs to be optimized in production, right? |
[3570.14 --> 3580.48] Like, um, for example, what we do is, um, continuous profiling, which is we keep collecting some profiles from the, you know, the production binaries. |
[3581.00 --> 3590.38] And we sort of like have an understanding of like, you know, within this project, what are some of the hot calls and what is like some of the, you know, stuff that is in the critical. |
[3590.38 --> 3594.42] Like, and what critical paths are like more often being cold. |
[3594.42 --> 3609.16] And like, you know, what happens if I just optimize this functional or like, what is the, you know, actual cost of this particular function in the, you know, the, the, if you think about the whole system and, you know, depending on the usage and whatever. |
[3609.16 --> 3615.16] So I think it just really makes more sense to start thinking about these cases in production. |
[3615.16 --> 3623.68] And like, by looking at the data, you just go back to the development environments and like, try to optimize those things and, you know, keep using these tools. |
[3624.24 --> 3631.20] Uh, one of the nice things about Go profiling, the actual P-Prof is like, it's a really low overhead type of profiling thing. |
[3631.20 --> 3633.12] And, uh, you can enable it in production. |
[3633.12 --> 3642.82] So you can, you know, just keep, you know, getting, uh, profiles from production without impacting the critical paths so crazily, but there's a overhead. |
[3643.12 --> 3644.98] Uh, but you know, there's some strategies. |
[3644.98 --> 3655.70] If you have multiple replicas of a web server, for example, you can enable production maybe for like, um, one minute or five minutes, uh, on one replica. |
[3656.14 --> 3665.72] And it's just like, sort of like, you know, depending on how much latency you will, you know, experience, uh, it's sometimes doable and that's what we do it. |
[3665.72 --> 3674.20] Uh, that's how, you know, what we do and, um, just try to optimize based on the usage and, you know, what is the critical usage and like, what are some of the hot paths? |
[3674.20 --> 3680.16] Like identifying those hot paths is also very important before jumping into any, you know, optimizations. |
[3680.50 --> 3680.60] Right. |
[3680.70 --> 3682.32] Having a problem before you solve it. |
[3682.86 --> 3683.14] Yeah. |
[3683.60 --> 3683.86] Yeah. |
[3684.20 --> 3694.06] So Yana, when you say you do continuous profiling, when, when you deploy services, do you have P-Prof already enabled in there and you just switch it on or. |
[3694.84 --> 3695.08] Yeah. |
[3695.12 --> 3696.06] Think about like this. |
[3696.06 --> 3701.08] Um, so although, you know, the Powerform P-Prof tools, uh, P-Prof is, can be tweakable. |
[3701.08 --> 3705.52] Like it's dynamically turned, you can turn it on dynamically and you can turn it off. |
[3705.68 --> 3714.96] So what we do is basically turn it on for like several minutes, uh, collect the data, just get the data and, you know, just parse it, store it. |
[3715.04 --> 3717.38] And then we aggregate all that data. |
[3717.68 --> 3721.14] And we have this like, you know, daily, weekly, whatever reports. |
[3721.14 --> 3736.78] And you can take a look at like, oh, this service, particularly this handler is often used and all these like particular functions are, you know, it is, uh, accounting for the like most CPU time or memory or whatever. |
[3736.78 --> 3741.78] And you can just go and like dig and like, you know, optimize those particular places. |
[3743.12 --> 3753.34] Um, I, I wish that go ahead, like some tools around maybe supporting this type of like more continuous integration, uh, sort of continuous profiling, uh, features. |
[3754.06 --> 3759.96] Um, you know, it's possible to write a tool kind of aggregates, you know, multiple P-profiles. |
[3759.96 --> 3773.26] Maybe it could be possible to write like a library that automatically, you know, just turns it once a while reports to some like central service and then, you know, turns it off and so on. |
[3773.40 --> 3777.34] Um, I think there's like some, some, some, we can do much better in this field. |
[3777.34 --> 3786.62] It's just kind of like up to the user right now to plan and, you know, design and just, you know, do this type of things. |
[3786.62 --> 3787.90] But like, that's basically what we do. |
[3787.90 --> 3793.96] I, I gave some, I wrote, uh, on this topic, um, for a while. |
[3793.96 --> 3801.20] And, um, it's just really like some companies are aware of these methodologies and some companies are not. |
[3801.20 --> 3809.02] And like, it's just, it would be so nice if community was, you know, producing more best practices as well as, uh, more tooling around this. |
[3809.56 --> 3810.54] Well, there we go. |
[3810.60 --> 3812.10] There's the call gone out. |
[3812.24 --> 3817.00] Anyone who's looking for a new open source project or something to hack on? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.