text stringlengths 0 2.35k |
|---|
[1824.88 --> 1832.38] we often have to change the infrastructure we use to produce the Go distributions that people |
[1832.38 --> 1832.94] get. |
[1833.08 --> 1834.46] And that takes a lot of work. |
[1834.46 --> 1839.62] And I kind of just want to kind of mention all the work that the Go release team has |
[1839.62 --> 1845.96] done to make our releases smooth, because sometimes that goes, it's not explicitly talked |
[1845.96 --> 1846.56] about as much. |
[1846.90 --> 1851.86] So I imagine every time Apple says a new major version of macOS is coming, I imagine some |
[1851.86 --> 1854.52] people start sweating, thinking, oh no, what is coming? |
[1855.62 --> 1860.60] Yeah, I mean, sometimes there's like nothing, but sometimes they're disruptive. |
[1860.60 --> 1866.90] Was it Catalina that they like introduce like major signing requirements or something? |
[1867.18 --> 1869.28] It caused big problems. |
[1869.92 --> 1872.50] Well, again, we do appreciate all that work. |
[1873.02 --> 1878.02] Newer x86-64 machines are also getting improvements, aren't they, Daniel? |
[1878.42 --> 1884.52] Yeah, so that's a good segue because going from, for example, ARM-based machines, there's |
[1884.52 --> 1885.18] a lot of versions. |
[1885.50 --> 1889.76] If you have an old phone, I believe that's going to be like ARM version 6, but later phones |
[1889.76 --> 1892.54] are going to be ARM version 8 or 9, which is 64 bits. |
[1893.20 --> 1897.98] And if you compile a binary that's targeting like the lowest possible denominator, the |
[1897.98 --> 1901.68] older version, it's not going to run as fast as it could on a newer device. |
[1902.12 --> 1907.98] So Go has had a flag called, I think it's called Go ARM 64, and you tell it what version |
[1907.98 --> 1911.42] of the architecture your machine, your target machine supports. |
[1911.70 --> 1917.24] And then if you swap a 6 for a 9, it might run 10% faster, depending on what kind of code |
[1917.24 --> 1917.66] you're running. |
[1918.32 --> 1920.52] And x86-64, i.e. |
[1920.76 --> 1927.40] AMD 64 desktop CPUs, they don't suffer from as much of the same problem because they haven't |
[1927.40 --> 1930.82] had as many versions with as many changes in the last decade or two. |
[1931.32 --> 1933.22] But you have had some changes. |
[1933.76 --> 1939.08] And sort of mirroring the same environment variable for ARM 64, now we have Go AMD 64. |
[1939.48 --> 1941.42] And it targets one of four versions. |
[1941.42 --> 1947.00] And these are sort of standard versions between Intel and AMD, where roughly speaking, I believe |
[1947.00 --> 1948.94] version one is like the common denominator. |
[1949.40 --> 1952.54] It's basically every single machine that's valid AMD 64. |
[1952.98 --> 1957.66] And then you've got version two for things that are starting, I think, in like 2010 or |
[1957.66 --> 1957.92] so. |
[1958.38 --> 1960.94] Version three starting in like 2013, 2014. |
[1961.42 --> 1967.30] And then version four, which is, I think, AVX 512, which is mostly server computers or very |
[1967.30 --> 1968.80] new desktop computers. |
[1968.80 --> 1974.32] So if, for example, you know you're targeting a cloud machine and you know the cloud machine |
[1974.32 --> 1978.76] has all these new instructions, you can swap from the older version one to version three |
[1978.76 --> 1979.16] or four. |
[1979.66 --> 1984.42] And maybe you're going to save five, 10% CPU cost, depending on what kind of code you're |
[1984.42 --> 1984.60] running. |
[1985.04 --> 1990.16] And presumably if you choose a higher number and then the architecture is lower, then |
[1990.16 --> 1990.78] that's a problem. |
[1991.04 --> 1993.32] I believe it's just going to fail, refuse to run. |
[1993.46 --> 1994.64] It's going to say not supported. |
[1994.98 --> 1995.18] Yeah. |
[1995.54 --> 1996.24] Okay, cool. |
[1996.40 --> 1997.08] Yeah, makes sense. |
[1997.08 --> 1997.88] Huh? |
[1998.24 --> 1998.88] Yeah, there you go. |
[1998.94 --> 1999.62] That's good to know. |
[1999.94 --> 2000.28] Yeah. |
[2000.42 --> 2006.38] I mean, I often I'm so abstracted from the physical hardware in certain environments where |
[2006.38 --> 2008.54] that wouldn't be able to make use of that. |
[2008.60 --> 2012.56] But there's certainly some cases where I could probably use that today. |
[2012.92 --> 2014.80] I appreciate you telling me about that one. |
[2015.14 --> 2018.16] And even if you think, well, my workload is not that special. |
[2018.16 --> 2024.50] I believe in Go AMD 64 version three, there's an instruction that the runtime garbage collector |
[2024.50 --> 2030.26] can use to quickly scan memory for pointers or something like that in a way that essentially |
[2030.26 --> 2031.94] batches the work and makes it a lot faster. |
[2032.42 --> 2037.64] So you might get the runtime GCs being like a few percent faster, even if you don't care |
[2037.64 --> 2038.66] about new CPUs. |
[2038.66 --> 2044.12] So even if you're not going to make use of it, maybe the Go tooling and runtime and bits |
[2044.12 --> 2045.52] and pieces do. |
[2045.72 --> 2046.50] Very interesting. |
[2047.08 --> 2051.32] I do want to speak about one more subject before we get onto workspaces if we can. |
[2051.46 --> 2053.18] And this is something I use a lot. |
[2053.26 --> 2055.32] And these are the templates in Go. |
[2055.32 --> 2059.30] So we've got text template and HTML template. |
[2059.80 --> 2064.62] And these sometimes get criticized as being too rudimentary and too low level. |
[2065.68 --> 2068.60] But it sort of has enough of what you need. |
[2068.70 --> 2073.40] As long as you mix in Go code, usually in functions that you make available to the templates, |
[2073.88 --> 2075.60] you can kind of really do everything you need. |
[2076.08 --> 2078.76] But are we getting some new functionality in templates? |
[2079.34 --> 2079.48] Yeah. |
[2079.72 --> 2083.42] So I added a couple here, which are pretty simple to understand, I think. |
[2083.42 --> 2088.08] They both revolve around control flow or logic, if you want to think of it that way. |
[2088.40 --> 2090.62] So one is about adding break and continue. |
[2090.94 --> 2096.32] So it's the same feature that you have in regular Go loops, but for ranges within a template. |
[2096.86 --> 2104.72] And the other one is that the AND and OR operators in Boolean expressions now short circuit in a |
[2104.72 --> 2110.62] template like in Go, which means that if you do A or B and A is true, then B is not evaluated. |
[2111.02 --> 2113.26] Whereas right now it evaluates all the expressions. |
[2113.42 --> 2115.98] And then works out the Boolean expression. |
[2116.46 --> 2116.56] Yeah. |
[2116.68 --> 2120.26] And the result on the expression itself is the same, isn't it? |
[2120.32 --> 2124.82] But if you like you're calling functions within that, then you can save those functions. |
[2124.92 --> 2126.02] They won't need to get called. |
[2126.46 --> 2128.82] So that short circuiting sometimes is very important. |
[2129.38 --> 2130.72] That's very nice to know. |
[2131.14 --> 2135.08] So the break and continue, I guess they are quite simple then. |
[2135.08 --> 2137.70] So continue is going to loop back. |
[2138.26 --> 2140.86] And well, actually, I'm not sure that is that simple. |
[2141.22 --> 2143.88] Because the template is kind of declarative, isn't it? |
[2144.34 --> 2145.88] What does the continue do then? |
[2146.26 --> 2150.68] What happens if there was within the block, like content after the continue? |
[2150.92 --> 2151.68] Is that skipped? |
[2151.68 --> 2155.20] So you can think of templates as sort of scripts. |
[2155.68 --> 2159.82] I don't believe they let you run code forever, at least not that I can remember. |
[2159.94 --> 2164.14] But they do have a range statement where you can say range over, for example, a slice. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.