text stringlengths 0 2.67k |
|---|
**Justin Garrison:** An index. It's like if I have a book and I want to find a chapter, I can go to the index, I can find the chapter... And I'm like "I can just jump right there, and we can get the thing that I wanted." |
**Jon Johnson:** Exactly. Let's contrast that... So targz's are a tar file, which is just a concatenation of all the files, with metadata in between them, and there's no index at the end. So if you want to access a file on a tar file, you have to read through the entire thing until you find the file you're looking for,... |
**Autumn Nash:** Oh... So that's why the zip files are faster. |
**Justin Garrison:** Yeah, there's no index on that. Yeah. Okay... |
**Jon Johnson:** Exactly, exactly. So the benefit of Targz over zip is that Gzip compresses the entire stream all at once, whereas zip compresses each file individually. And so with gzipped tarballs, if you have a bunch of files that are really similar, and fairly small, then you're going to end up being able to compre... |
**Autumn Nash:** But do you still get the indexing? |
**Jon Johnson:** You don't, unless you use Brad Fitzpatrick's crazy invention that he called Star-gz file. |
**Autumn Nash:** Oh... So you've got the compression of the tar file, but you've got the indexing of the zip file. So it's not only faster and compressing better, but then it's indexing to find stuff easier. |
**Jon Johnson:** Right. It kind of strikes a middle balance between the two... So the way that works, briefly, is that when you're going through the startgz file, every so often you just stop the Gzip stream and reset it. So instead of being one giant Gzip archive, it's actually several Gzip archives, just concatenated... |
**Justin Garrison:** \[38:00\] So you're just like chunking a certain -- so you're not getting as good a compression, but much faster read time, because you're like "Hey, this first meg is compressed", but then I get some metadata to say what's in the next meg. |
**Jon Johnson:** Right. So I think it's every two, or four, or something... Maybe it's every file, honestly, but every so often, you just reset that stream. And then at the end of this stream, you have a table of contents index thing, that is "Hey, here's all the offsets of all the files I just ripped", you write that ... |
**Justin Garrison:** Because you're not getting as good a compression as compressing the entire stream, but you get that faster read time. |
**Autumn Nash:** But you're basically meeting in the middle between performance and read time, which is like a balance that is hard to strike. So that's like really very functional. |
**Jon Johnson:** Yeah. It was super, super-clever. And what I learned from that is that "Oh, Gzip is kind of this interesting format, where you can have multiple Gzips, just concatenated together, and Gzip decoders are cool with that." They're like "Oh, that's fine. I will just keep reading through. Now that I've found... |
**Justin Garrison:** And one thing that -- I mean, I didn't know this for a very, very long time... When you say "concatenate together", you literally mean, like, I can use the cat command with two Gzip files, and I can pipe it to another file. And that is literally just -- you just append the two things together, and ... |
**Jon Johnson:** Yeah. It's really bizarre, but it works. And so I was very excited about this, because it's like "Oh, great, we can get lazy access container images. Everyone should adopt this. Let's do it." And some folks kind of took that and ran with it. And there's another format called eStargz, which is basically... |
**Autumn Nash:** That is really smart. |
**Jon Johnson:** I no longer am championing Stargz, because I learned more things, and I think there's a better option... |
**Autumn Nash:** I love the rabbit hole that you went through... We've gone down an emotional roller coaster of like files, and I love it. |
**Justin Garrison:** This gz roller coaster is taking us for a ride. |
**Jon Johnson:** It has been like a two or three-year journey for me, which is like just so lame... \[laughter\] But I just can't get away from it. And every time I try to, I find out a new thing that I find interesting. |
**Autumn Nash:** That's when you know you're doing good work, though... Like a work that's interesting to you is when the rabbit hole is -- like, that's when you are on the right project. |
**Jon Johnson:** Right. It just keeps going. Like, "Okay, yeah, there must be something here." So the drawbacks to that, right? ...as you mentioned, it doesn't compress quite as well as, say, a zip file would. You also now have in your Gzip archive this table of contents. So when you decompress that container image, th... |
**Justin Garrison:** It's a bonus! \[laughs\] |
**Jon Johnson:** And so that's like "Uhh... The in-band stuff - not great." The other thing is that it doesn't work for existing container images. You have to rebuild with like this special tool, that processes the layers to put them in this format. |
**Justin Garrison:** And yet, just to give the listeners like "This was specifically designed for containers, for speeding up that poll process." Because usually, you're going through and you're like "I have a container image", and that's sending you a metadata list of like "Here's 10 other Gzips you have to download."... |
**Jon Johnson:** \[42:03\] Right, right. And just to contextualize that with some numbers, the public ones I've found, that everyone references, are from this paper Slacker from 2016, and their number -- I wrote these down, because there's no way I could remember this. They claim that 76% of the startup time for a cont... |
I'll pause, because in my life this is where I had this cutoff point. So I obsessed with Stargz a little bit for a while... There was a lot of efforts from people to switch from Gzip to Zstandard, which we could talk about... But let's get back to that later. I had a -- well, my wife had a child with me in the interim.... |
So I have this website I maintain for exploring container images, because that's most of my job. And especially at work, people just ask me stuff... And so I was like "Oh, let me make a website for you, that can answer your question, so I don't have to, and I can do other useful things." So the website is oci.dag.dev. ... |
So I made this, and then someone on Twitter made something very similar. So Agent Steel made a very similar website. And I liked a lot of it, but I didn't like other parts of it... But the thing that I couldn't believe is how fast his website was to load file contents. Because in my mind, you would have to store -- you... |
So there is a tool called I think Gztool, and it allows you to get random access with a tar-gz file without modifying it... Which is something that I thought was impossible. To the point that when I learned how it worked, I couldn't stop thinking about it, and I even wrote -- I wrote a poem basically about Deflate. |
**Autumn Nash:** But you have to read this poem. We need to hear it. |
**Jon Johnson:** So I have an abridged version of it that I might share if I get very comfortable... But yeah, so I was reading like a lot of children's books right at the time, to a toddler, or I guess an infant... |
**Autumn Nash:** \[45:42\] I love that you did this while like not sleeping, because if I told you the amount of times that I figured out code in the middle of the night, or like while holding a sleeping child - it's a low-key flex, okay? Because when you have kids, you are forced to walk away from code sometimes, when... |
**Jon Johnson:** There's something to it, where you have no options; you are only in your mind. And so you're just like "How can I --" |
**Autumn Nash:** And it stops you from writing code too fast. I was reading a book, and it's like about thinking -- it's about doing technical, mathematical and like technical things, and how to like teach yourself more efficiently... And there was a whole part about -- there were different ways that famous people in h... |
**Justin Garrison:** It's part of the process. |
**Autumn Nash:** Yeah, it is a whole proc-- but this whole time you're like "I'm being unproductive", but you're not being unproductive. It's like hacking your mind. And I was like "Oh, my God." |
**Justin Garrison:** Daniel Kahneman has a great book called "Thinking, Fast and Slow", and it's 15 years old now, or something like that, but it's an amazing book on lik, hey, when you're in the moment, you think of things quickly; you have to take a step away, you have to just think slowly... Not necessarily about th... |
**Autumn Nash:** It's amazing. Like, that's why people think of like fixing your code, or whatever, in the shower, or like when you go to sleep, because your brain is working through it subconsciously. |
**Justin Garrison:** Oh, yeah. Naps are my superpower for debugging things. |
**Autumn Nash:** You're such an old man. I love it. |
**Justin Garrison:** I've debugged o many things by like "You know what? I can't think of a solution right now. I'm gonna close my eyes for 15 minutes, and I'm gonna come back." And if I still don't have a solution, I'm gonna go for a walk. |
**Autumn Nash:** Dude. And I thought that was being unproductive. And then I learned how to go for a walk, and take a break... And I was like "No, I have to figure it out now", and you have to be perfect. My favorite TED talk is "Learning how to be brave, not perfect." Shout-out to the lady who created it, Girls that C... |
**Jon Johnson:** I think the only time I can solve problems is really when I'm not trying to, and you're forced to sit with your own thoughts. And I'll share one more example of this. I went with some friends to -- I don't know what... It was like Handel's Messiah, I think, a Christmas play... I was just so bored, beca... |
**Justin Garrison:** "I have to go!" \[laughs\] |
**Jon Johnson:** \[unintelligible 00:49:15.15\] "I've figured this out." She's like "I don't care." Okay... |
**Autumn Nash:** Dude, I told my son that, and I felt like the most old person ever, but I was like, sometimes you have to learn how to be bored. And I was like "Oh, God, I sound like my parents." |
**Jon Johnson:** This is good for you. |
**Autumn Nash:** But it's true, though. I was like "You keep going from one thing to another. You don't ever let your brain sit and think." And my brain is always going from one thing to another, so it's like... To learn to just be like -- |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.