Runtime Arguments
Conversations about technology between two friends who disagree on plenty, and agree on plenty more.
Runtime Arguments
39: Sometimes a complete rewrite is the right choice
Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.
Episode 39 is the show's 40th, since numbering started at zero. Jim and Wolf ask listeners whether a video version would be worth doing, and Wolf adds "rules" to the values-and-goals framework from episode 36. In their weekly catch-up, Jim sets up his new Mac Studio M5 Max, and Wolf gets PRs merged into direnv and Quarto while recovering from wrist surgery.
MAIN TOPIC: REWRITING THE CLINIC DASHBOARD
Background
Jim's company, Avairis, writes radiology software. His biggest client since 1985 is the largest freestanding mammography clinic in the US, which sees 500 to 600 patients a day across 6 or 7 offices in western New York. In 2006 Jim built "Dashboard" to track patient flow, so no one gets left in a waiting room, and to log hundreds of event metrics. It shows configurable "views" of boxes, each representing a room or a patient state, and lets staff drag patients between boxes.
The prototype that stuck
The original version was a JavaScript front end, a Perl back end (later moved to mod_perl), and Postgres. Every session polled the database every 10 seconds, with up to about 140 sessions at once. The clinic grew to 252 views. Users could write their own WHERE clauses, and the queries became bloated, some taking 18 seconds. Jim had wanted to rewrite it for about 15 years.
The new system: Avairis Data Engine (AVDE)
Jim started on June 1 and wrote it in TypeScript on Node.js, choosing TypeScript so the compiler would catch errors before users did. The core idea is to flip polling into push:
- Triggers: lightweight Postgres triggers only send NOTIFY messages, and the Node service LISTENs for them.
- Shared worker threads: each unique query, identified by a hash, gets one worker thread. Every client running a view with that query subscribes to the same worker, so 30 users means one query.
- Deltas over WebSockets: a client gets the full dataset once, then only the changed rows.
- Update-storm handling: a 10 ms debounce collapses duplicate notifications. If more than 25 are queued, the service drops them and does one full requery.
- Reconnect grace period: workers stay alive for 60 seconds after the last client disconnects, so a reconnect doesn't trigger a full reload. All of these timings are tunable.
- Leaner queries: each query selects only the fields its view needs.
- Drag-and-drop actions: "on-drag" and "on-drop" actions run a small stack-based DSL that Jim wrote, parsed with Perl's Yapp and executed server-side, with a plugin system for adding functions.
Because views can now be built on anything in the database, not just appointments, the clinic can track things like accounts receivable aging.
Rollout and switching cost
Wolf asked his standard question: what does it cost users to switch? Jim's answer was nearly nothing. A right-click converts an old view, and old and new views appear in the same list, with a column marking AVDE views. A view stays hidden from users until it's published. 85% of views convert cleanly. The other 37 all failed for the same reason: they mixed AND and OR without parentheses, which the new DSL now forbids because non-programmers can't predict what such conditions will do.
In the demo, Jim converted the infamous 18-second view and it loaded in under a second, which got a real reaction from the staff. The two-hour session overwhelmed them a bit, but by the next day staff were asking good questions and building views. Real load testing with about 140 live sessions starts next week.
Wolf's verdict
Despite the episode title, Wolf had no fight to pick. His rule against total rewrites is really about not "stopping the train," as Netscape did when Microsoft overtook it. Jim's rewrite never stopped the train and made more progress than incremental work would have. Wolf praised the design, especially the WebSockets, which Jim had forgotten to mention. He tied it to how he sees his own job: making things faster means optimizing the whole system, including the human workflow and perceived performance, not just CPU cycles.
WRAP-UP
Episode 41 will feature the show's first guest, Marlon from Meta, talking about performance.
Wolf described his new "answer first, then offer more detail" rule for keeping his answers short.
They invited listeners to the Saturday 11 a.m. nerd lunch at Biwako in Saline
Township. Wolf's next topic is cargo cults, with a nod to Feynman.
Hosts:
Jim McQuillan can be reached at jam@RuntimeArguments.fm
Wolf can be reached at wolf@RuntimeArguments.fm
Follow us on Mastodon: @RuntimeArguments@hachyderm.io
If you have feedback for us, please send it to feedback@RuntimeArguments.fm
Check out our webpage at http://RuntimeArguments.fm
Theme music:
Dawn by nuer self, from the album Digital Sky
Hey, everybody! It is another episode of Runtime Arguments. This is episode number 39. Sometimes, a complete rewrite IS the right choice. Um, there's a lot for me to disagree with in this episode, and it… you've already heard the first thing. So, I'm Wolf. And I'm working with my best friend, as always, Jim. And here's Jim.
Jim McQuillan:Hey guys, how you doing?
Wolf:Uh, this is episode number 39, our 40th episode. Uh, I gotta tell ya, uh, everywhere I go, every day, I have to explain my name to someone. Uh, it's always a different person, and it's always roughly the same conversation. I'm not gonna give you the stupid details. Um, and of course, we have a podcast where there's a thing we have to explain every day. Yes, it's episode number 39, our 40th episode. Because we started at zero. Um…
Jim McQuillan:Yes. Can you, can you believe, uh, can you believe this is our 40th, though? That's crazy.
Wolf:Today. That's a lot, especially… and we do them every two weeks, so we're, um… we are over a year, and now people are actually starting to listen. I think we might be up to five.
Jim McQuillan:We're still doing it. Five, six, eight.
Wolf:No, we actually… we actually have a lot of… a lot of downloads. I think we are getting close to 5,000 downloads total.
Jim McQuillan:Yeah, yeah, yeah, which is, it's nice.
Wolf:Everything takes longer than you think it's going to take.
Jim McQuillan:Uh, it does.
Wolf:That is the rule. But the nice side of… the other side of that coin is, um, you're gonna be surprised every time by how little you can do in a day or a week.
Jim McQuillan:It does.
Wolf:And you're going to be surprised every time by how much you can do in a year. Um, anyway, let's start with some feedback. I've got some things, you've got some things. Um, you want me to go first?
Jim McQuillan:Yes. Yeah, I have a hunch there's some overlap here, so you go first. If there's anything left, then I'll say.
Wolf:Um, I'm gonna do mine kind of out of order. This is important. Jim and I are investigating on the advice and some insights from friend of the show, Marlon. There might be a way for us to quit being, um, what in my sport we call FUDs, as in Elmer FUD, like people who are antique and doing the wrong thing. Our, uh, website starts with HTTP. And every time we say it, I'm overwhelmed with shame. Uh, and Marlon has explained to us there might be a path to our redemption, so that's a thing we're investigating. Second. Uh, people are asking for this, and I see value. But, um, what I want to know is, would any of you out there. Find value yourselves in us supplying. a version of the podcast alongside the audio that is audio and video. up front, I'm gonna tell you, there are obstacles. It would be new for us, process, it would be more work, it would cost more money, stuff would have to stay… like, we'd have to go to extremes to make the right thing happen. But what I care about is, is this a thing you value? Would it benefit you? If it would, then it's worth me and Jim, like, investigating further and figuring out what goes on. So, this is absolutely, absolutely I want to hear about it.
Jim McQuillan:Yeah, yeah. Yeah, one of the benefits, to me, the big benefit, other than you get to see what we look like, I'm not sure that's a benefit, but the big benefit is this is audio only right now, and sometimes we would like to show visuals.
Wolf:It is not a benefit.
Jim McQuillan:There's things we need to show you that we just can't describe in audio.
Wolf:A picture is worth a thousand words, which means one picture for each time I talk.
Jim McQuillan:Um, yeah. Yeah. That's a… that's… that's a lot of words. or a lot of pictures. Anyway, um, so that's the benefit, but yeah, as Wolf said, there's some challenges we need to overcome to make that happen. Uh, it certainly would change the workflow, how we put these things together. Uh, but hey, we're not afraid to try new things, are we, Wolf?
Wolf:Um… I'm not!
Jim McQuillan:Long pause. He's pausing. He's pausing because he's the guy that always tries new things and I'm not that guy. But I'd be willing to try this.
Wolf:Which is not to say you don't do new things, you do. And so it would be unfair to say that you don't. I've seen you do new things. Like, you switched to Zshell on your personal computer. You are using…
Jim McQuillan:Yeah, yeah. I… Yes.
Wolf:uh… a ton of things that I suggest… you know, like, he switched to Git! Uh, that was a… this was a while ago, but it was a…
Jim McQuillan:Oh, yeah. Yeah, like 14 years ago, but yeah.
Wolf:The move to get is a big deal, there's no question about that.
Jim McQuillan:Yeah.
Wolf:Okay, next feedback item is basically just happiness in me because yeah, people are asking questions about the show and where feedback on the show is appropriate. But also, we're getting into more and more conversations with people who just are listening to the show and want to say things. So not necessarily, or ask things, not necessarily stuff that… requires us to mention it on the show, but conversations. Our show is putting questions in people's minds about how, in a lot of these cases, how can they do better? And where we have some answers about stuff we've seen that might lead them in a direction that could be beneficial to them. I want these conversations, and that they're asking, uh, makes me feel like we're starting to make a difference, and I love that.
Jim McQuillan:It's great.
Wolf:Yeah. Um, one of the episodes, uh, that I, uh, led a little while ago, episode 36, uh, Leaning the Ladder. values and goals. Values are forever and goals are like a place that you're going to and then when you get there you're going to go someplace beyond that. Uh, like, for instance, a value for me is, I believe human beings all have a right to be alive. Even the ones you don't like. Even… well, I'm not gonna go into details. But that's a value. I'll never be done with that. I want to, for instance. lose a certain amount of weight. That is mostly a goal. I want to weigh somewhere around 175, somewhere around there. I am going to get to that weight.
Jim McQuillan:Yeah, you're not too far. You're not too far from that.
Wolf:I'm feeling pretty good about that. I actually had to go into the Secretary of State today to renew my driver's license, not because I had to go in.
Jim McQuillan:Yeah.
Wolf:but because I wanted a new picture that matches what I look like. And I'm so happy with these with these teeth.
Jim McQuillan:Good for you.
Wolf:I got them to take a second picture where I'm actually smiling. It's a weird picture, but… but I like it. Anyway…
Jim McQuillan:Yes.
Wolf:I think I left out a thing, um, that turns out to be super important. It's not just values and goals. There's a slightly smaller thing that we call rules. And. Rules are like a tiny recipe that is aimed at a specific goal. For instance, on the road, the goal is… The cars don't touch. They have different ways of saying it, probably. But, like, for instance, they want all human beings to be safe, unharmed, and alive at the end. So, our rule is, don't go faster than X, the speed limit for that piece of road, 70, where we live in Michigan, for these, uh, highways and stuff. Umm. But the rule is not the value. The value is human life here, the goal is everybody is safe, and the rule is don't go faster than 70. The rules are to help you get to an answer without re-deriving everything from scratch. Umm. Something that, in a lot of cases, you just can't do, or it's a waste of time, or whatever. They're a recipe. But because they're just a recipe. They only usually get you to the goal or value. Not always. And sometimes they're in conflict. Like, there's a rule that says 70, and the full rule is, no faster than 70. No slower than 60. Most people don't know that rule because it's not posted, but where there is a maximum speed limit posted on a highway, the minimum speed limit is 10 miles per hour slower than that. If you are exceeding 70, or going slower than 60. And it's not like an exit ramp or a whatever. You're breaking the law. But what if everybody's going 80? If you went 70 now, you would be a danger. You'd be obeying the law, but you would not be hitting the goal or the value. You would be a hazard. So, almost every state has a law, which is usually called the Law of Competing Harms. And in some states, they just go right out and say it, the Law of Competing Evils. Um… And the problem is, you only have two choices here. I mean, I guess you could get off the highway. But the two choices are, you can break the law and go faster, but now you're traveling the safe speed, the same speed as everybody else, assuming weather, blah blah blah. Or, you could present a hazard, but obey the law. Either way, it's a bad choice. Um, and the thing I wanted to say, the thing I didn't mention in the Leaning the Ladder episode is… When there are values and/or goals. They win. That's how you know what the right thing is when you are facing competing harms. Laws, or rules, or guidelines, or a rule of thumb, or whatever, is just a recipe so you didn't have to think about it. That's kind of bad on its face, because you should never abdicate the role of thinking. You only have limited attention. That was the point of episode 36. Rules super help. You want them. But you gotta know when not to do them.
Jim McQuillan:Okay, let's… Let's back up just a second. You said when there are values and there are goals. They win over rules.
Wolf:Rules.
Jim McQuillan:Right?
Wolf:When they conflict.
Jim McQuillan:There are tons of people out there with bad goals and bad values. That doesn't win over the law, over the rule. Right?
Wolf:That's true, and also, that's not how you will be judged in a court of law. In a court of law, if you broke a law, and the goal that you are breaking the law to follow, instead of what the law follows.
Jim McQuillan:Right, right, so.
Wolf:If that's not the goal of society as we have encoded in the law, nobody is going to back you up.
Jim McQuillan:Right.
Wolf:But if you are not following the no trespassing law, because a park ranger collapsed a hundred feet into. private property? And you jump over the fence to rescue that person? you are following a goal or value that is respected by society. But if you're actually jumping the fence because you've got a knife and you're gonna stab him to death, and your goal is all park rangers must die.
Jim McQuillan:Yeah.
Wolf:Guess who's not on your side?
Jim McQuillan:Right, right.
Wolf:Anyone.
Jim McQuillan:Right. Well, probably.
Wolf:Nobody who has a vote, I'll tell you that.
Jim McQuillan:Yes.
Wolf:So this is a thing that came up in episode number 36. I wanted to mention it in the feedback segment of episode 37 and it sort of fell by the wayside and I just wanted to make sure I got to it.
Jim McQuillan:Yeah, yeah, okay. Yeah, so the real story is, if you're speeding and you get pulled over, just tell the officer he needs to listen to episode 36.
Wolf:And. Okay, now I want to say a rule. This is not a law, but it's a guideline.
Jim McQuillan:Yeah.
Wolf:Um, I come from a family of law enforcement, and I am interested and do a lot of study on certain kinds of topics, and there's one thing I know for an absolute fact.
Jim McQuillan:Yep.
Wolf:On the side of the road. When you are in the driver's seat, and there is an officer of the law at your window. There is ZERO chance that an argument between the two of you. It's something you win. What you do is you be safe. You follow instructions, and if you have anything to challenge this situation, you say it in court.
Jim McQuillan:Yeah.
Wolf:He has a hard job, and you don't want part of his hard job to be shooting you.
Jim McQuillan:Yeah, you definitely don't, because that goes against your goal.
Wolf:Yeah, like, if I ever get pulled over, and I don't think I've been pulled over in decades, but if I ever get pulled over, the thing I'm gonna say to the police officer, second, is, I have three things I'm thinking about right now. Number one is you and me. Walking away from this at the end, in as good a shape as we are right now. No extra holes. Number two is, I want to obey the law at all times, unless it puts holes in either one of us. And number three is, I want to do everything you ask me to do, unless it puts holes in us or breaks the law. Those are the things I'm going to say.
Jim McQuillan:He's gonna laugh and say, "Have a good day.
Wolf:He will. I hope.
Jim McQuillan:Yeah.
Wolf:I sure hope. Um… And you have some feedback. What feedback do you have? Tell me all about it.
Jim McQuillan:Well, we received a couple of items of feedback from listeners. Let's see if I say this name right, Ehsan, E-H-S-A-N. He just sent us a real nice email letting us know that he's just really enjoying the podcast. We like that kind of feedback, but we'll take anything. And then somebody from Black Coin Dev, he didn't tell us his name, but he and Wolf carried on a nice little conversation about…
Wolf:They're, they're… Yeah, because they're doing the thing we said. They're writing tests. They're trying to validate what I call invariants in their code. And they want to make progress on the thing they're doing.
Jim McQuillan:Testing. Yeah.
Wolf:in the fastest and most reliable way, and when they… and they have questions, and that means they're doing the right thing. I don't know what they're working on. I don't know who they are or where… I don't know anything.
Jim McQuillan:Yep. Yep.
Wolf:But I know that they are trying to do better, and that is a thing I can admire.
Jim McQuillan:Yeah, Wolf is all about that. I mean, I am too, but Wolf, uh, Wolf engaged with this person, and it's, it's an interesting conversation. I've been watching it. It's a lot of fun. So, yeah.
Wolf:Did you have? Other feedback?
Jim McQuillan:No, I don't think so. Did I?
Wolf:In that case, why don't you tell me how was your week?
Jim McQuillan:Oh, my last couple of weeks was busy. I traveled to Rochester, New York. That's where my big customer is that I do an awful lot of work for. And that's really kind of the subject of today's conversation. We'll get into it more later. But I've sort of hinted at this project that I've been working on for a few months using TypeScript and Node and stuff. And we're gonna talk all about that in a couple of minutes. The other thing is, while I was gone, Apple sent me a, I ordered a computer. ordered a new, uh, Studio M5 Max. Um, for, like, 4 or 5 years, or 6 years, I've had a Studio M1.
Wolf:Which is still an amazing computer.
Jim McQuillan:And I've been very happy with it. Yeah, it really is. It really is. But I upgraded, and so I picked that up last week, and I spent a good part of Saturday and Sunday, and even into Monday, basically moving into that computer. you know, it's always a lot of work when you move into a new computer. I could have taken the time machine back up and just restored it, but, you know, every 5 years or so, it's good to just start fresh. So that's what I did. And it was a…
Wolf:I feel the same way about marriage.
Jim McQuillan:Every five years, start fresh. No, you don't.
Wolf:No, I don't. I've actually been married 36 years, and she is my person I'm absolutely not changing.
Jim McQuillan:Yeah, yeah. I thought you were going to say it 36 times. But I know you. Anyway, so I spent several days getting moved in, and I think by about Wednesday, I shut off the old machine, put it off to the side, and I'm strictly using the new one, and I'm loving it. And a neat thing, I guess other computers can do this too, other operating systems. You know, I was a long-time Linux. user. In fact, all of my server stuff is still Linux, but my, uh, I don't know, 8 years ago or 9 years ago, I moved over to Mac on the desktop. And one of the neat things about Mac is you can take two Macs. Plug them together with a Thunderbolt 4 cable. And it just automatically creates a network between the two. Gives an IP address to each one in the 169 range, and it's… you know, it does the MDNS thing where they each get a hostname.local, and… And, uh, and then you can SCP, or, uh, uh, Rsync, or whatever, you can SSH over to it. And it's really quite nice, and it's, you know, Thunderbolt 4… is 40 gigabits per second. So that beats the snot out of my gigabit network. And it's way better than Wi-Fi. So I connected my two computers together, I had a Thunderbolt 4 cable, and apparently if I'd had a Thunderbolt 5 cable. These two machines would have talked that.
Wolf:Let me see if I've got this right. Um, Thunderbolt 4 is 40 gigabits per second.
Jim McQuillan:Yes. Yeah. Okay.
Wolf:in each direction. And then Thunderbolt 5… Thunderbolt 5 is like the Golden Gate Bridge during rush hour. You can use…
Jim McQuillan:Yeah, bidirectional.
Wolf:uh, both directions together as one direction. So you can get 80 gigabits per second out of it by consuming the entire thing. I mean, that's not actually how the Golden Gate Bridge works, but…
Jim McQuillan:Okay. Yeah, and, and, yeah, and when you're just trying to push data from one machine to another. it's almost all in one direction, right? You get the axe back, sure, but it's almost all in one direction, so that makes sense. But it turns out that the bottleneck, in this case, was not the. network, I end up getting a throughput of about 350 gigabytes per second.
Wolf:Small files.
Jim McQuillan:Is that Lewis? 300… I don't know. Um, well, small file… gigabyte files, you know, they're… they're…
Wolf:It's always small files.
Jim McQuillan:or… or, like, a lot of Postgres stuff, and those things, I think, are 16 megabytes, so… is that small? Uh, in this day, I guess… I guess it is. But I was… I… I was doing…
Wolf:It is.
Jim McQuillan:Got it, let me see. 350 megabytes per minute, or per second. 350 megabytes per second, so that's 3.5 giga… bits per second, which is way below the 40 gigabits per second. It turns out it's not the network that's the bottleneck, it's, uh, rsync chews up some CPU, uh, it's SSH because it encrypts, uh, and rsync compresses, and so all those things added up. They make it not hit the full bandwidth of the connection, but there are some tricks you can play.
Wolf:I wonder if… I wonder if the ROI for this specific problem, where it's short distance, like 3 feet, and, um… there's no intervening switch, and you just want the highest throughput. Does the speed you get from sending less bytes overall, because of compression. Um… Does that? Is that a win? Did you get that back from the cost of…
Jim McQuillan:No, you want to turn off compression. It turns out, I started this process a couple of times, uh, to more or less.
Wolf:Yeah, I thought you might.
Jim McQuillan:play with it to see how I could get the best speed. And several searches and help from Claude, and it turns out you want to. Turn off compression. which makes sense. Um, and you want to use an… you want to use an SSH cipher that is, um, uh, as lightweight as possible. So there's an option you can pass to rsync to tell it to use SSH with, uh, I don't even remember what compression algorithm I used.
Wolf:Probably encryption.
Jim McQuillan:But that's how I ended up at 3.5 gigabits per second. Um, and we got, like, 2 terabytes to send. It still takes a little while, but it was way faster. Before I tweaked, before I tuned all those performance things, it would've taken me like 18 hours to push that data across.
Wolf:It is remarkable.
Jim McQuillan:And instead, I did it in 20 minutes.
Wolf:It is remarkable how much the scaffolding costs. This was a big discussion you and I had, and I had to perform experiments to.
Jim McQuillan:Yeah. Yeah.
Wolf:prove that I was actually saving time, uh, by reducing the number of total, um, round trips across the wire to my Postgres server.
Jim McQuillan:Oh, with your Postgres. Yeah, yeah, with your database stuff you were doing, right?
Wolf:Yeah, collapsing into single statements, and reducing the number of round trips, and blah blah blah. Uh, it was not immediately obvious to a person who deals in data 1 tenth or 1 hundredth of the size that I was working with, that these could possibly help in any way.
Jim McQuillan:Sure. Sure.
Wolf:And it turns out, scaffolding is always an obstacle.
Jim McQuillan:Sure. Well, there's a lot of layers between the bare metal and what you're trying to do. And in your case, those tweaks you made, collapsing all your statements into one big one. It doesn't come for free. It increases your memory, your memory requirements.
Wolf:It does. And also, it turns out there's limits because Postgres has a built-in maximum number of terms in a standalone SQL statement. I can't remember if it's a million or 100,000, but if you're supplying individual values.
Jim McQuillan:But when you have a lot of memory.
Wolf:for cell and column, like, you gotta stop.
Jim McQuillan:Yeah. Okay. Yeah, yeah. At some point you exceeded that. But anyway, so I got all my data moved over. I was really happy with that Thunderbolt thing 'cause I didn't want it to take 19 hours to move over. But the other thing I did, I started fresh.
Wolf:I did.
Jim McQuillan:Certainly, I have a bunch of apps that I had to move over. I use Homebrew for a whole bunch of pieces of software, and there's a nice way to migrate those over. You can export a list.
Wolf:Bundle.
Jim McQuillan:a bundle, right, and import it on the other machine, and that all works really nice. But I also cleaned up my environment a little bit, and you know what? I moved to Starship for my command prompt. That is a delight. You've been telling me about this for an awful long time, and I finally switched to it, and it is a real delight.
Wolf:Who says you don't try new things?
Jim McQuillan:but it did take me some getting used to, because, you know, I'm… for those that don't know what Starship does, it gives you a different prompt on your command line. I spend an awful lot of time in a shell.
Wolf:And customizable.
Jim McQuillan:It's very customizable, uh, and what threw me off at first was, uh, it's not just text. It shows little graphic symbols and stuff, and I'll tell you, I'm used to things not being so colorful and not being so graphic. You know, I'm old school. I just like a good old text terminal.
Wolf:If you want.
Jim McQuillan:And this changes it a little bit, and it took me some getting used to. I'm still kind of getting used to it, but I really like it. It shows little symbols. If you're in a directory that's a Git repo, it gives you symbols to tell you if, you know, if your branch is clean, or if you've made changes, or if you have things that you've added.
Wolf:And what branch you're on?
Jim McQuillan:Yeah, yeah, and it tells you what version of, uh, you know, if I'm in my Node project, it's telling me what version of Node I'm running. Uh, if I'm in a directory that's full of Perl code, it'll show me what version of Perl I'm in. Some of these things aren't so important. Yeah, Python, or…
Wolf:In Python, it'll tell you the active virtual environment.
Jim McQuillan:A ruby here, yeah, and you know, version.
Wolf:Um, and I want to tell you, you use ZShell for interactive stuff.
Jim McQuillan:Yes. I do, yeah.
Wolf:It turns out that a Starship, when used with Zshell, can do a really neat thing. Zshell can do this by itself, but it's annoying to set up. Your prompt on ZShell is like the status line in Vim, where it can have a part. on the right. You can say, here's some stuff to put on the right side.
Jim McQuillan:Yeah, yeah, yeah, yeah. Yeah, I'm not ready for that. I saw that I could do that. I saw some examples of that. But I am using Zshell on my desktop on my computer here on my desk, but I spend a lot of time logged into remote systems and those systems run on Bash and I set up Starship there. And it's equally as nice. And I installed, I use iTerm2 as my terminal emulator. I installed the nerd fonts. I forget which one I use, but you gotta install the nerd fonts to get all the symbols. Otherwise you end up with question marks in some places. Um, but I installed that, and I'm really quite happy. It's a real delight. It's kind of neat. And, uh, so yeah, so I've been busy playing with my new, new machine, and, uh, it's, it's much faster. It's, my old one was an M1 Studio, this is an M5. studio, and uh… for instance, I do some Xcode stuff, and Xcode gets really, really pokey, especially if you open up the storyboard editor on a very large application. Um, uh, there's times where the storyboard editor would take me 2 minutes to load, and… and now, um, it's… it's, like, worst case was, like, 11 seconds, and I'm quite happy.
Wolf:I have to tell you. there was a day when, you know, we were working on Netscape, and that's compiled code, not like the Perl you're using, or the JavaScript, or the Python I'm using. We had to actually compile it, it was C++.
Jim McQuillan:Yeah. Right, right.
Wolf:And compiling for one machine on a desktop-class computer, which meant the best that they could get me.
Jim McQuillan:Yeah. Yep.
Wolf:Um… was long enough for me to lay down under my desk and take a nice nap. I mean, it was… it was minimum 3 or 4 hours.
Jim McQuillan:Yes. Oh, yeah. I've worked in situations like that. And when you can only get two compiles in a day, it forces you to rethink how you do your work. Right? Yeah.
Wolf:It really does. So when you say two minutes, um, I feel like a friend of the show, Dave, who addresses any first-world problem, like, oh, and I didn't have a, um…
Jim McQuillan:Yep.
Wolf:you know, I didn't have a USB-C cable or whatever, right? He will say to you.
Jim McQuillan:Yeah, yeah.
Wolf:Um, you, you think about that, and then think about the kids who haven't had food or left their bomb shelter in 10 days.
Jim McQuillan:Yeah, yeah. First world problems. I get it. But when you're working all day in a program like Xcode, and you're in and out of the storyboard editor, and you're changing files and switching back and forth. Oh, it's a it's a delight when you when you have a fast machine.
Wolf:Yeah, you're… the 10 on your pain meter? is the… is 10 for you. And it… sure, there's people who've been paralyzed or robbed or whatever, their 10 is a lot more, uh, carries a lot more weight than yours, but your 10 is still your 10.
Jim McQuillan:Yeah, yeah, yeah. Yeah, so, so, yeah. Yeah, certainly I have a lot to be grateful for, but it's just been nice the last couple of days. I've been doing a lot of Xcode the last few days, and it's just nice working on a fast machine, so I'm happy. And I'm wondering how long it's going to take before this feels slow. I'm going to have to upgrade again.
Wolf:There's a word for that in medicine, which is called, um, acclimation.
Jim McQuillan:Yes. Acclimation, yeah. Yeah, well, I didn't go, you know, this is an M5 Max, I didn't go with the Ultra because that added, I could have doubled the memory then, but that adds like at least $4,000 to the price tag, and I just couldn't justify that. I'm happy with the Max.
Wolf:Like you want to go faster, but your want has bounds.
Jim McQuillan:Yes, I have limits. There's my speed limit right there. My goals and my values don't overcome the fact that I don't want to spend $4,000. So…
Wolf:Um, I have some things like that. I am not getting an iPhone Duo at this moment.
Jim McQuillan:Yeah, right, right. I figured version 2 or 3 of that thing, and I might be interested. I got enough other stuff going on right now.
Wolf:It's reasonable. Here.
Jim McQuillan:But anyway, hey, we've been talking for, like, 30 minutes, and we haven't even gotten to the meat.
Wolf:Or my week.
Jim McQuillan:Should we? Yeah. Sorry, Wolf, there's no time for your week. All right. All right. How's your week, Wolf?
Wolf:It was a lot of stuff since our last recording. I have had two open source PRs accepted by two different projects, both of which are very important to me. Um, one is, I use DIRENV. Um, I'm not going to go into detail about what DIRENV is, but if you're not using it.
Jim McQuillan:It's a D… It's D I R E N V.
Wolf:That's right. If you're not using it, go look it up, because you want to use it. And I… it's cross-shell, and it's cross-language, it's cross a whole bunch of stuff. It definitely applies to you, and it can definitely solve some of your problems, especially with credentials and whatnot.
Jim McQuillan:Yep.
Wolf:Um, and one thing that DirEnv knows is whatever language you might be working with. it knows what your projects look like, and so, like, what kinds of things it needs to activate, or put on the path, or stuff. Like, in Python, there's a thing called a virtual environment, and it has tools in it, and libraries, and they need to be in certain paths for you to reach them. So normally, whatever kind of project it is, you CD into that directory, and then you activate that thing, by hand. Durand will do that for you. The problem is, I use a tool in Python called UV, uh, made by Astral, it's super, super fast, written in Rust. And DirEnv doesn't know the shape of a UV project. That doesn't stop you. You can just write a piece of configuration that will make it do the right thing. But so many people use this. A while ago, I put together a PR that teaches DirEnv. How to do layout UV. And I submitted it, and there was feedback, and I collected stuff, and I made changes, blah blah blah. Months and months and months and months went by. Not quite a year, but a really long time. And I assumed it was dead, and that was gonna be it. And then, um, one of the maintainers… looked at it, did a further evaluation, said, yeah, this is going to help people, and it's written well enough, let's make a PR. It was accepted? merged, and he said it was important enough that it was worth doing a release right that minute, so that everybody could have it. By the time I read this email, the release that provides it, which is version 2.38.1. He did that on October 6th. I could already get from Homebrew.
Jim McQuillan:So if I'd install… if I were to install that right now, I would get it with your fix. That's pretty nice. And, uh, back up just a second. Uh, you mentioned DirEnv and what it does, and, like, activating a virtual environment, and all activating a virtual environment really is is setting some environment variables, right?
Wolf:You would. Uh, uh… That's right.
Jim McQuillan:Yeah, and DurEnd basically does that. You switch into a directory, and those variables automatically get set. So, like, your credentials for AWS or whatever, they get set, your environments you need for your virtual environment get set. It's really a slick little. piece of code that does that.
Wolf:And even better, it does it by starting a subshell. So when you leave that directory, and by the way, this works at any depth, like you can go five down and it sees that you set stuff at the top of the project you're working on. 5 up. And it does those things. And once you leave that area, the place that is where the… where the sub-shell exits, and all those things go away. Even if they were weird, custom things that you made happen by hand.
Jim McQuillan:Right. The subshell exits. Right.
Wolf:Specifically as part of your end startup. Durham doesn't need to know how to undo them, because all it does is make the subshell go away, and they're gone.
Jim McQuillan:Right, right, and environment variables are only for that shell and any of its children, not for its parent. But that's interesting 'cause you could set an environment variable while you're in that directory, and when you back out of that directory, it's gone.
Wolf:That's right.
Jim McQuillan:Yeah, interesting.
Wolf:Yeah, okay. Second PR. Um, I use, uh…
Jim McQuillan:PR is a pull request in Git speak. Yes.
Wolf:That's right. Uh, and a pull request is what they call it on GitHub, because this thing where you say, I have changes, let's get them in, that's not a feature of Git. That's a feature of a service that is hosting Git repos.
Jim McQuillan:Mmhm. Sure.
Wolf:So, GitHub is one such thing, and it calls this feature a pull request, and then Bitbucket calls it a merge request. I might have those backwards, it doesn't matter. What matters is it's a request. Um, the other thing is, in my Python projects, I use a tool called GreatDocs. Um, and GreatDocs assembles all of your, um. docstrings, the place where you say, this function or method does this, this module does that, these tests, blah blah blah. It finds all those in your code, and builds documentation from them, as well as finding the API itself, all the function names. It builds automated documentation from that machinery. So not the stuff that you write yourself by hand, like the README or the ROADMAP or any of that stuff. All the automated stuff. Underneath, it's built on a separate project called. Quarto. And one thing that Quarto does is it generates a sidebar, um, that is… I think it's a table of contents, or links, or, you know, relate… it's stuff. like, Quarto has a bug, or had a bug. Um, I could see immedi- I mean, this is what I do, so I saw it immediately, uh, when I started timing stuff. As I was using brake docks, it was taking, like. 11 minutes or something to run, right? And so, I did a little… I did a little analysis, and I saw from my analysis that it was spending a lot of time in that sidebar, so I looked at the code, and.
Jim McQuillan:That's forever.
Wolf:Oh, it's easy there. they're doing the wrong thing, it's M squared. They're looking at every link for every other link, um, which is… I guess there's nice words for it, but none of them come to mind. Anyway, um… Almost all n-squared problems have reasonable solutions, many of them do anyway, and so this one did, and I made a PR. I don't think I gave them exact code, but I said, look, here's what you're doing. I can see why you're doing it, obviously. It's suboptimal. In my personal copy, I did put in a real fix that was not n squared, and I went from, uh, 11 minutes down to 6 seconds, or something really good. It was… it was performant, and. And so I told them what to expect and how to do it. And time went by and I assumed it was never going to have an impact. And then I got an email saying, hey, we saw your fix. You're right. We took your suggestion. The very first thing you said works 100%. We put it in. It's solved. Thank you.
Jim McQuillan:That's how it's supposed to work. That's pretty good.
Wolf:Bye-bye. Yeah. So, those two things, Python 3.15. was released. That's awesome! Python 3.15 fits into the discussion we were just having, because it comes with a brand new sampling profiler, which has an official name, but all the cool kids call it. Tachyon. So… Call it tachyon. Um… I had to have. surgery on my left wrist, and I'm wearing a cast. I am officially incapacitated in this way for a month. It's very inconvenient. The pain's not too bad, but I can't type. Um, it makes. uh, certain kinds of things about driving hard. I have been relying greatly on dictation to get stuff done, um, and dictation in combination with AI, um. and at the risk of being polarizing, uh, in competition, where I'm doing shooting stuff, I'm shooting strong hand only, in every way, not just holding the gun, but also all of the administrative details. Loading, clearing malfunctions, chambering around, racking, all that crap. And even with that. Last session, there's four sessions in the in the competition for us. I did a clean eight for eight run in 9.33 seconds, which sounds great, but I am a D class shooter. I want to fess up to that. I'm not great. I'm okay. And I am 11th out of 14. Of course, I'm the only one who's shooting one-handed, so… Umm… I… have some things I have promised. And I haven't finished them, as promised, so I am gonna fess up. One is, I told you I was working on automation for announcing new episodes of Runtime Arguments, which, of course, everybody is like, why would you need automation? Just make a. freaking post. But for me, I need some automation, and I, uh, haven't finished that yet. I promised that I am switching from, um. 1Password, long time, most favored software status for me, but I can't agree with their values, so I'm switching to Bitwarden. I have not completed that. I think I'm going to finish that up tonight. And for 30 years, I have been working on what is to me a kind of an obsession, a super fast text search algorithm for use on DNA. We don't really search things that aren't indexed. in the real world. So is this applicable? I don't know. There is a best search algorithm in the world right now, which is an incredibly complicated name, that is an acronym where one word in the acronym is itself another acronym. Uh, the name of this search algorithm is BNDM, um, and that D is itself the acronym DAWG, D-A-W-G, which stands for… um… directed a cyclic word graph. Anyway, it's really fast. I had promised a couple people, Jim, one of them, that I would already have it published by the release time of this episode, and I haven't.
Jim McQuillan:Huh.
Wolf:But I'm getting really, really close, so I'm going to do that. Last… we would have recorded this yesterday on Thursday, we were recording on Friday, but we didn't. And the reason we didn't is because I drove an hour to get to Jackson, Michigan. Um… And my friend, friend of the show, Ron Kolcernian, and his wife, Lynn, met me at a first aid class called Stop the Bleed. Now, Stop the Bleed. It's only an hour long, and it doesn't teach you everything about first aid, but it tells you what you need to know to keep somebody alive for the 7 to 15 minutes it's gonna take for people with stuff to get there. People who can. Keep them out of shock and put them on a monitor, get them into the ambulance and to the hospital. All you have to do is make sure they don't bleed out. And this was taught by a terrific registered nurse by the name of Katie Watson. I'm super grateful we went. I'm very happy. I learned stuff. I can now, I believe I can apply a tourniquet if it's the right kind. And, since I'm one-handed, I am absolutely sure I can do it one-handed! So I feel good about that, too! Um…
Jim McQuillan:You won't be able to do it two-handed now.
Wolf:That is also probably true. Um, and I think that is about how my week was, and…
Jim McQuillan:So, so, so let me get this straight. So, in less than an hour. About the time it takes to listen to the intro to this episode, you could learn how to stop the bleed.
Wolf:Yeah, I thought it was nice that she asked a couple of questions that I was able to answer. Like, she started off with, you know, you see someone, and they've been damaged, they're starting to bleed. Um, do you know how long they have? And I said, well, it depends on exactly the nature of the wound, right? But if they've got a laceration across their femoral artery, if somebody cut their thigh and they're bleeding out of the big artery in their thigh, they've got about three minutes. You are the responder.
Jim McQuillan:I'm surprised it's… I'm surprised it's that long.
Wolf:And she said, "Yeah, that's right." And then she talked about different scenarios. And it turns out ambulances are faster than I realized. An ambulance, if you live in town, can get to you in seven to 10 minutes, 15 if it's bad.
Jim McQuillan:It's a lot more than 3.
Wolf:Yeah, if you can keep somebody alive. for. You know, maybe as long as 15 minutes. It could be that you've saved a life. And to me, that's important. Yeah. Man, have we spent a long time… I think we've done episodes shorter than this.
Jim McQuillan:Yeah, that's worth something right there. That's good. Yeah, in fact, we have. But that's all right. We're having fun.
Wolf:Um… But, here we are, let's do the meat. Let's hand it over to you, and then I'll fight.
Jim McQuillan:You got your… got your dukes up. Alright, so a little bit of background. A little bit of background. I… I own and run a company. Uh, we write software for doctors.
Wolf:I kinda do.
Jim McQuillan:And my biggest customer is a mammography clinic. They do mammograms detecting breast cancer for women. Mostly women, there's actually male patients as well. I've had them as a customer since 1985. So I've known these people a long, long, long time. And in 2006, they asked me to. come up with a solution to help with their patient workflow. This is a clinic, they're the largest freestanding mammography clinic in the United States. They see between 500 and 600 patients a day, between 6 or 7 offices. spread around western New York. So they needed help. to do things like make sure they don't lose a patient, right? It's awful when a patient shows up, they check in, they're told to go sit over there, and somebody will call you, and 2 hours later, nobody has called you. Um, or you're…
Wolf:Like when you're sitting in hell in, uh, Beetlejuice.
Jim McQuillan:Yes, or worse, you know, you think you have breast cancer and they do the x-ray and then they tell you, sit over there, we'll get back to you in a few minutes with the results and a couple hours goes by. I'm not saying this happened there. But, uh, they, they could see that it could be a potential problem. So they asked me to help them create a system, uh, to track the patients. So that involved, uh, a couple of things. First off, uh, uh… tracking events. Every time something happens with a patient, an x-ray is done, they checked in, they checked out, all these things. There's thousands of metrics, well, hundreds of metrics that we track, and we write an event for every one of these. So that was so that they could measure the problem. How long did a patient sit there in the waiting room before coming back into the exam room?
Wolf:And you know I'm totally in favor of this!
Jim McQuillan:Yeah, so lots of metrics, so that was a part of it, and that turned out really nice. Then they asked to create a user interface so that they could. track patients and direct the flow of patients. This is back before digital x-rays, before they had digital mammograms. They were just using film screen mammography, which is just, you know, you've seen the x-rays, right? It's a. film, you know, they snap it like a photograph, they develop it, they put it up on a film reader, which is just a light board hanging on the wall, and they read the x-ray. Well, not… back then, it was all… it was all, uh, that type of mammogram. And then, uh, around 2006, 2007 or so, they were moving to digital. And they…
Wolf:And packs!
Jim McQuillan:and a PAC system, a picture archive storage system, uh, that's what you need when you go digital on, on, uh, on, on x-rays. Um… Uh, so, they wanted me to develop a system where they could, um, see at a glance on the screen, um, which rooms, uh, uh, you know, the waiting room, uh, the changing room, the exam rooms, the… inside waiting room, where they wait for the results, and several other things. They wanted to see that on a screen, and how many patients are in each one, and be able to see who are the patients in each one, and if a patient has been someplace too long, pop up a red flag, or, you know, some kind of indicator, so that. They had a worker there named a patient advocate. It was that person's job to make sure the patient knew what was going on and was taken care of in a timely fashion. So this tool was for them to help do that. And I created something using JavaScript on the front end, Perl on the back end, Postgres as the database, and 2006, we gave them the first version, and until last week, that's all they had. It was a prototype. It was a… Oh!
Wolf:And it was a huge leap. It was from zero to one.
Jim McQuillan:Yeah, it was a prototype. that stuck.
Wolf:Which they do. That's what they do. That's how they get you.
Jim McQuillan:And yeah, that's what happened. I created a project, I showed them and they wanted to start using it and they did. And they have the ability to create what we call views. And you go into this, the program is called Dashboard. It's not a name I chose, it's not quite the right name for it. but it's called dashboard, and they can create dashboard views, and each view has a bunch of resources on it, there are boxes on the screen. This being an audio podcast, I can't show you what it looks like, I can't take you through a demo, but I can try to describe it. So on the screen, for each view, they call up the dashboard program, they select a view, and they run it, and there's boxes on the screen, and each one of those boxes initially meant. An exam room, or a changing room, or outside waiting room, that kind of thing.
Wolf:So just to make sure this is clear.
Jim McQuillan:Mmhm.
Wolf:You are showing them numbers and data. You don't have a floor plan. They don't see a thing that is Room 3.
Jim McQuillan:I wanted… I wanted to do the floor plan. They didn't want that. I laid out a view that looked like a floor plan. They weren't interested. Yeah, they just… they could think in terms of, you know, exam room 1. They have 12 exam rooms. They could think in terms of those exam rooms. Then they knew what it all meant.
Wolf:Interesting.
Jim McQuillan:So within this box on the screen that represents one of the rooms, there's a list of patients in that box. Now, in an exam room, there's only one patient. In the waiting room, there might be 20 patients. In the changing room, there might be 10 patients. Anyway, these are patients in this box. And so that was kind of nice. So as patients move around the office, the view would update automatically. And the way that we did that was every 10 seconds, the view would refresh, it would hit the server. Hit the Postgres database and select all of the patients, select all of the patients that were in the office that day. And then there was some filter logic that would run to figure out, okay, this patient's in the waiting room, this patient's in exam room.
Wolf:It's a cron job!
Jim McQuillan:13 or 12, I said they only have 12 exam rooms. So they're in exam room nine, right? Or this person has checked out. So it would automatically filter and figure out what box to put those patients into. And that worked for a while. And it was nice.
Wolf:Did it… so, like, it obviously has to do this query at least once, but did it do it for each workstation, or did it do it once and then the workstation fetched a file?
Jim McQuillan:Yes. It did it for… it did it for… it did it every 10 seconds for every session that was running.
Wolf:So there could be five on a workstation.
Jim McQuillan:And a workstation could run multiple sessions. On a single workstation, yeah. So it was not uncommon to see 140 sessions hitting the database every 10 seconds. And…
Wolf:So, absolutely the right decision if the thing you're writing is a prototype. Absolutely the wrong mechanism if what you're writing is, here's what we're using.
Jim McQuillan:Yeah. Yeah. Oh, yeah, yeah, yeah, but it worked. It worked in their eyes. It worked so well. They didn't want to. They didn't want to pay me to make it better. It was good enough, and it worked and fine. Okay, well, the practice grew. They got more remote offices, more doctors, more patients.
Wolf:Yep.
Jim McQuillan:So, uh, and then… and then they wanted something added where now, not only does… does a box represent a room, it could represent some state. Um, the… the patient, um, uh… What's a good one?
Wolf:Has insurance.
Jim McQuillan:The patient, oh yeah, the patient has insurance. The patient hasn't gotten the results yet. The results aren't available yet. Right, right, right. The patient hasn't filled out their health history form yet.
Wolf:And they overlap. Like they're in a room and they're in a state.
Jim McQuillan:The patient hasn't signed their consent agreement yet. So they ended up with 252 views that a user could choose from with all kinds of different things. And every time they came up with a new view, they came up with new things that needed to be in the query and the query grew quite large. And there were some times the query could take 18 seconds to run.
Wolf:Wait, wait, wait, wait. Are you saying a query you wrote?
Jim McQuillan:So… Uh…
Wolf:Took 18 seconds? Or is this like they wrote both?
Jim McQuillan:Well, here's what I did. I gave them the ability to write queries, to write not the full query, but the where clause.
Wolf:Or, as I would say it, you gave them the ability to take 18 seconds, as opposed to the ability for you to write it and have it take 1 tenth of a second.
Jim McQuillan:Yes. Yes. Yes. Yes. Yeah, and I spent a lot of time analyzing their queries, and I… one of the things I get great satisfaction from is analyzing queries and making them faster. I…
Wolf:Well-deserved satisfaction.
Jim McQuillan:I love doing that. I love running the explain analyze and figuring out why a query is slow. And a lot of times it's because there's not an index on a column that there should be. But sometimes they're just doing stupid things in a sub query that could maybe be better done as a join or something. I get great satisfaction of taking a query. that runs for 18 seconds and getting it down to like 20 milliseconds. That's a lot of fun. But some of these queries, you know, I used all of my tools, all of my skills, and some of these queries, I just could not get to be fast enough. So, for, like, 15 years now, I've had it in my mind that I have to rewrite this. I have to do something different. I have to make it better.
Wolf:But not just because of the queries, right?
Jim McQuillan:Uh, why else? Oh, because it's a bad idea?
Wolf:Well, no, I'm actually curious, like… you know, my… that search algorithm that I've been working on for 30 years is… is an obsession. Am I able to explain it? Um, I do… I do have an elevator pitch on one sentence. Here's why I'm… why I'm doing it.
Jim McQuillan:Right, right. Oh, yeah. Yeah, yeah. Right, right.
Wolf:Is it Bad Queries? Is that your elevator pitch?
Jim McQuillan:Yeah, that's the big thing. That's the biggest reason. Bad queries are the wrong way to do it. All right, you talk a lot about how to optimize things, and one of the things you… the first thing you go and look at is, are they doing it the right way, or are they doing it wrong?
Wolf:Or are they even doing the right thing?
Jim McQuillan:Yeah, right. Right.
Wolf:Like, for instance, uh, you know, what's the best path to drive to Los Altos? Um, or Los Altos, whatever, right? And it turns out, you could pick a really good path, but the right thing was to fly.
Jim McQuillan:Yes. Yes. How do they do it? And they're using the right algorithm, right? So in 15 years, at least 15 years, I've had it in my mind that I needed to do better. I wanted to do better. And I finally convinced them that they needed me to do this. They needed to pay me to spend some time. This is a business for me. You know, sure, I do a lot of work for free, but this was something that was going to take more than a few hours to do. And I…
Wolf:Do you have an idea? If you give them the new thing, which I assume you have, and that's what we're hearing about, how much money are they going to save?
Jim McQuillan:Mm-hmm. I have. Oh, I can't even begin to… to, uh, put a number on that. Um…
Wolf:Bigger than a bread box, does it pay for itself?
Jim McQuillan:Yeah, yeah, yeah, yeah. Well, yeah.
Wolf:Does it do the thing the M5 just did for you? Does it turn an experience that has become painful into something they can now smile about?
Jim McQuillan:Yeah, okay. Oh, yeah. Oh, yeah. Oh, yeah. Yes, it not only does that, it opens up the world to what they can do. Because the old system was strictly about appointments. It was about, you know, there's 550 people coming in today, those 550 appointments. It was about managing those appointments. The new system is about anything in the database. They can write a view that tracks anything in the database that they want. You want to track patient AR?
Wolf:For me, that's the elevator pitch.
Jim McQuillan:Yeah, you want to track patient AR, you want to look at, you know, which patients are 30 days past due on their payment, which patients are 180 days past due.
Wolf:I had to actually deduce from first principles that when you said AR, you meant accounts receivable.
Jim McQuillan:You can do things like that. Accounts receivable, yes.
Wolf:Also, I don't want to forget this, but you were telling me about horrible nested queries and stuff. I happen… I happen to have been going through existing Postgres code, and I learned about something.
Jim McQuillan:Yeah, that's… Some queries, sure.
Wolf:awful. I don't even understand why this is allowed. Um, there's a thing that you CAN do.
Jim McQuillan:Yeah? Yeah?
Wolf:to solve certain kinds of problems, and I saw it. It was a thing I would never want to use, and I wish I could forget it. It's called a recursive query.
Jim McQuillan:Yeah? Oh, yeah!
Wolf:If you have to use a recursive query, you need to rethink some life choices.
Jim McQuillan:Well, I have some recursive queries. And they're, they're…
Wolf:Did you mean to buy an airline ticket?
Jim McQuillan:No, no, they are the reason that something works now. This has nothing to do with this system. Same customer, but a whole different problem. If you ever play with SNOMED codes. yeah, you're gonna need a… you're gonna get into directed acyclic graphs and recursive queries before you know it. Anyway, so I've sort of described the old system and some of the problems with it, and I started to touch on what the new system is. Now, the old system was. Perl, and a long time ago, after the prototype was working, and there was some performance issues, I changed it to ModPerl, so that was a big performance boost, but a pain in the butt.
Wolf:Because it ran in process.
Jim McQuillan:It ran in process. Yeah. And it, and it's more like a service than a, than a CGI script. And that, that helped. Um, okay. But still, you know, you're hitting the database, uh, 140 sessions every 10 seconds, and some of these queries take 18 seconds. It's kind of ridiculous. So, I wanted to do something different. So… Instead of the… client pulling the server every 10 seconds to see if anything changed. And think about it, there's an awful lot of times where nothing changed, but we're still hitting the server to see if anything changed. I flipped it upside down. Now, the database monitors data, that's what a database does, right? It stores data, and you can set up triggers, and you can monitor the data, and when the data changes, push that change out to the client. Way better idea, especially if you implement it correctly. So I started. like I said, I've been talking about this or thinking about this for 15 years. June 1st of this year, I finally sat down and said, this is it, I'm starting. And I started June 1st and. what I ended up writing was, uh, instead of using Pearl, and I know you like. Wolf when when I don't use Pearl. I'm using, you do, 'cause I can tell, 'cause you give me the side eye whenever I talk about Perl. I am using, I chose the language TypeScript to write this in, the server component of it.
Wolf:Yeah, I kind of do. Which is a good choice, I approve of TypeScript.
Jim McQuillan:It's, yeah, I wanted something that the compiler would find errors for me before the user finds them. And Pro was not the answer for that. And I didn't really want a compiled language, like, first off, I don't know Rust, and I didn't want the learning. curve to learning Rust. So I chose TypeScript, and there was still a big learning curve for me, but I was very, very confident in JavaScript. So this is a layer on top, a fairly complex layer, and I've been using Node.js for years and years. I've been using Node.js for, like. 18 years. When it was…
Wolf:Now, Node.js runs on top of V8.
Jim McQuillan:Version 4. Uh, yeah. Yeah, it's… Node.js basically is server-side JavaScript.
Wolf:V8. I am not the hugest Google fan in the world.
Jim McQuillan:It's a way to run JavaScript.
Wolf:But V8 gets props. V8 is good engineering, it does a good thing, and TypeScript takes everything that's good about JavaScript and adds types, which helps you make promises, and we all know how I feel about promises.
Jim McQuillan:It kind of rocks. Yeah, yeah, yeah. Yeah. Yep. Yeah.
Wolf:I'm 100% behind every decision you just said.
Jim McQuillan:Yeah, so I wrote a service in TypeScript running under Node.js. That connects to the database, and of course, the clients connect to it. And, uh… a user opens up a view. uh, it's just our normal system stuff here. They, they, they open, they run the, the program, they open up a view, and then. The client hits the node service. and pulls the data for the view. There's a lot of metadata. There's things about the view. What are the resources? What are the labels that appear on the screen? What is the query that runs? Uh, for that view. Now, all the other views, or most of the other views, had a big, big, ugly query that queried way more information than it needed to. That's part of the reason why those queries were so slow. Uh, and this one only queries what it needs to. The select statement that selects the data only selects the fields that you need to support that view. And um it it it. The service running in Node gets that request from the client and opens up a connection to the database and starts running that query and delivers the results. And there's a lot of things I did.
Wolf:So the query is happening.
Jim McQuillan:to make this better.
Wolf:at the node location. In other words, on the server.
Jim McQuillan:Node is making the Postgres connection. Yes, yes. Node is making the connection to Postgres and executing the query, or feeding the query to Postgres, and Postgres returns the data back to Node, and then the Node… process, we'll send it back to the client. Um, I've used Node for a long, long time, and with Postgres, and it works nice. The issue with that, though, is you can only have. Um… Uh, one… for every connection you make to the database, you can only run one query. and any other queries you submit. Node is asynchronous. You submit a query to the database, and then Node goes about doing all kinds of other things. It's a JavaScript thing, right? It's just a constant event loop. So Node will feed the query to Postgres, Postgres will churn on that query while Node is doing other things. responding to other clients connecting up, and those clients connect, and they'll issue a query, and it just gets queued. So the query doesn't even start yet.
Wolf:Does… does no need… Does Node give you the same machinery that web workers do? Because JavaScript itself is about threads, but web workers are better than threads.
Jim McQuillan:It sure does! It sure does. Yes. So I knew this about node going in and I knew this, I was gonna have to solve this issue. And. Um… So instead of all my clients connecting up and issuing their queries and then sitting in the queue waiting for their query to run and getting the results, as a client connects up and we tell it what view we're running, and by the view we know what query is going to run. Uh, now… I create a worker thread, that's what they're called in Node, worker thread. I create a worker thread, I spawn a new thread to run that query. And so that query runs, and if another user connects up and they're running the same view, so therefore the same query, it doesn't spawn another worker thread, it subscribes to the same worker thread.
Wolf:Great design, I love it!
Jim McQuillan:So now, if I had 10 users… if I had 10 users, or 30 users, running the same view, they're all gonna subscribe to a single worker thread, so there's one query running, hitting the database. So the first time you connect up.
Wolf:It's just like Git. When you've got 50 files that are identical, there's one object in the database, and because… and once it… because you have the hash of that object.
Jim McQuillan:Yeah. Deduplication. Yep. Right.
Wolf:You all use it. It's the same thing.
Jim McQuillan:Yeah, I'm using a hash. I'm using a hash. I take the query, and I create a hash value of it, so that's how I know that that query is different from any other query, or it's the same as a query. And they don't even have to be running the same views. If they're running different views, but those views happen to use the same query. It's one worker thread.
Wolf:Love it.
Jim McQuillan:So, so I thought you were going to argue with me. I'm waiting. Okay. Okay.
Wolf:I am! Like, the title sucks!
Jim McQuillan:We'll get to that eventually. So the worker thread starts up and it hits and it fetches the data from the server. And it might return 540 rows. And then that data gets pushed back to the main thread that's running in Node. And then it gets sent out to each subscriber. of that query.
Wolf:Here comes the magic word. I've been waiting for you to say the magic word.
Jim McQuillan:So the clients get the update. Um, okay. We'll see if I say it. Um… Uh, so the clients get the data, and there's filters along the way so that those 540 rows will get filtered out, and so now we know where they belong on the screen. And… And that really helps. Now, the first time a session or a client connects up, they get the full set of data. for that… for that view. So if there's 500 patients in the office, they're gonna get all 500 patients on the screen in one payload, right? But now, as data starts changing, there's trigger functions on tables in the database, and that sends… you know, Postgres has got this cool thing called Notify. you can issue a notify command, and it's a message queue. So you do a notify, and you can give it a payload, and you give it a name. And then the server issues a listen. So it's sitting there listening for these notifications or these messages. And so now when data changes, the trigger function doesn't notify the node process. Does the listen, and it… it gets a notification that says, oh, this row changed, or this… this patient changed, or this… something changed. So it does a query of the database.
Wolf:I gotta stop here right now. And I'm wearing my user hat now, but this is also for me, because I just want to know. I have come to…
Jim McQuillan:Okay. Yes. Yes.
Wolf:disrespect many uses of trigger functions. Trigger functions can be used to turn your database into a doorstop. So.
Jim McQuillan:Yeah. Oh, it could be a mess. It could be a huge mess.
Wolf:My question for you is. How are you not doing that? Are you only installing or enabling and disabling, because that can happen depending on what level you've set the trigger at, whether it's a system or a user, for instance. Are you…
Jim McQuillan:Mmhm.
Wolf:installing them and uninstalling them as you are… are you turning them on and off? Are you… or is it the case that the changes you're detecting.
Jim McQuillan:No. No.
Wolf:are root enough that seeing those changes is all you need to satisfy any query or know that it's time. Fill me in, how is it not a doorstop?
Jim McQuillan:I'm not sure I totally understand your last question, but let me explain how they do it. First of all, the trigger function is very, very lightweight. There's not much happening in the body of this trigger function. It basically says, oh, the appointment. a record changed, I'm gonna send a notify. And notifies are lightweight, they're very efficient, so all it does, it doesn't do any processing on the data, it just sends a notify. So, yes, I have a lot of triggers triggering, but they're all doing very lightweight things, just sending notifications. So the server, we're back in Node.js, the server is listening for these, these, uh, messages, and it gets a message with a payload that says, appointment, uh, uh, let's say, appointment 1234, uh, has been updated. So the server re queries the appointment. It runs the query for that appointment one, two, three, four, and it just retrieves the one row. and it takes that row, and now it sends deltas to the client. So instead of sending 500 rows to the client in one big payload, it sends. One row changed. Here it is. Here's the data for that one row.
Wolf:All right. Let me make sure I understand.
Jim McQuillan:So now my payloads are much smaller.
Wolf:The client… is a node, or the client is a view on a workstation.
Jim McQuillan:The client is a view on the workstation running JavaScript.
Wolf:And there can be, you know, there could be 30 views that are using the same query. And some of them are going to be older in terms of when they last got data than others. So one is going to need this one appointment.
Jim McQuillan:Could be 140 of them. Yeah. Yeah, yeah. Yep. Yep.
Wolf:And another is going to need five.
Jim McQuillan:Well. If five rows changed, there's going to be five messages sent. And and and 5 listens 5.
Wolf:I see. These happen one at a time, no matter what.
Jim McQuillan:Yes, yes, but. There's some… there's some logic where, uh, when we get a notify, we wait 10 milliseconds before doing anything with it, so that if we get an update storm. Right? If you… if you issued an update, uh, like a bulk load on a table, you could get.
Wolf:You can cluster.
Jim McQuillan:you could get tens, or hundreds, or thousands of rows, uh, all sending, uh, uh, messages, right? All run the trigger function, all sending messages, the server responding to all those messages, and, and, you know, having to… if you sent a thou… if you updated a thousand rows. uh, the server would have to do a thousand queries, which is nuts, right? So, uh…
Wolf:But because you're clustering, it could be one.
Jim McQuillan:Because we're clustering. It could be one. In fact, if it's, um… if it receives multiple messages for the same payload. it will just… it'll collapse them down to one, which is nice, but if it receives multiple messages for lots of different rows, if it's more than 25, if the queue grows to more than 25 of these messages, it just throws away all the notifications. It forgets about those and just does a full query.
Wolf:Oh, that's nice! Like, hey, I can do magic, but by the time you get to X, forget magic, let's just pretend you're starting up again. Uh, that's simple, that's fast, it's easy to debug, I love it!
Jim McQuillan:So it's… Yeah, it, it. Yeah, I'll. Yeah, right. So it'll do the full load. Isn't that nice? So, um… you know, the data gets down to the client, and they see it on the screen. Now, I think I mentioned earlier that you can, like, drag a patient from one box to another. Did I say that? Maybe I said we were just viewing the data, okay?
Wolf:You had said that in previous episodes, you had not said it today.
Jim McQuillan:But… Okay, so, okay, so, uh, one of the things that you can do with these views is, uh, let's say you have a patient that's ready to check out. You can take the patient from one box and drag them to the checkout box. And when you do that, code can run. So, these are… I call these actions. It's either an on-drag or an on-drop. So, when you drag a patient out of one box, the on-drag action runs. When you drop them on another box, the on-drop action runs. And these actions are written in a language, a domain-specific language that I wrote. It's a very simple stack-based language that just… you know, it's got some if, you know, some conditional logic, and then run some functions. And those functions are… I've made available to them. I give them a list of them. And there's a whole plug-in architecture for adding more functions without having to, you know, do a big update.
Wolf:Stack based like like postscript and forth.
Jim McQuillan:So these… Yeah, I suppose. I mean, you're pushing arguments. It's like any language, really. You're pushing arguments onto a stack, and when you call a function, it pops the arguments off the stack and does things with them. Name a language that doesn't work that way. I know there are some.
Wolf:That's awesome.
Jim McQuillan:But so it's like, it's a little virtual machine that's running that, you know, that, I mean, virtual machine, I mean, in terms of a, like a Java VM, a JVM kind of a thing. It's just a little runtime that's running.
Wolf:I hear you.
Jim McQuillan:you know, looking at the code, and looking at the stack, and pushing, and popping, and running, and all this stuff. And that's a language I wrote, it's a little domain-specific language I used. Some of this code, like, when you drag a patient, that code actually runs in Perl back on the server. it's not running in the Node application. It just makes an API call back to the server, and it runs it in that. So that language is written in YAP, which, you know, if you've ever used, uh… if you've ever created a compiler, you may have used YACC, Y-A-C-C. Well, there's a Perl equivalent called YAP, yet another.
Wolf:Yeah, right.
Jim McQuillan:Perl parser, or something like that. Um… So I wrote it using that, because that's the language I'm most familiar with. And so that all works beautifully. So they're dragging patients around, doing all kinds of neat things with conditionals and everything. So that all works really nice. So… anyway, this whole system is up and running. I installed it, uh, about 10 days ago. I actually installed it a month ago, but I went out there to show them to start using it. And I created a conversion utility so they can take one of the old views in the old system and right-click on the view and say, okay, convert it to the new system. By the way, the new system, yeah, I mentioned way at the top, I own my own company. The name of that company is Avaris, it's A-V-A-I-R-S. We write RISC software for, RISC stands for Radiology Information Systems, so we write software for radiologists. Uh, so that's part of where the name came from. Um, anyway, this program is called, uh, the Averis Data Engine, and I know Wolf's got something to say about why did I call it a data engine, but it's the Averis Data Engine, AVDE for short. So I gave them AVDE while I was out there, and, uh, did this whole nice little… we had 2 hours to show them, you know, how it works, and… or we allocated 2 hours to show them this, and quite frankly, I overwhelmed them. Um… did you ever… did you ever have an idea in your head about how people are gonna respond to things? And in the back of your mind, thinking, yeah, this is gonna create a standing ovation?
Wolf:Yeah, I have to. Every. Single. Time. And do you know how many times I get that standing ovation? It is approaching zero.
Jim McQuillan:Yeah, okay, that is zero. Yeah, yeah. So in my mind, that's what was gonna happen. But I realized about halfway through that I was just overwhelming them. I was showing them way more than they were able to take in. in that period of time. I've got a nice 50-page manual for this, and we went all out on this project.
Wolf:Yeah, that's how people respond to me when they say, how are you doing?
Jim McQuillan:At the end, they did start asking questions, so I knew they understood what I was doing. And then the real payoff came the next day. You know, I gave them the manual, I printed out copies of the manual for it, and they all went home, and I thought, yeah, okay, they're overwhelmed, they're not gonna do anything. Well, the next day, a couple of the people that used this. um, had really good questions, and, and they were already creating views, so I, I was quite happy with that. That, that was, uh, that was a good time, yeah. So…
Wolf:That is awesome. I have to instantly ask you THE question.
Jim McQuillan:Yes. Yeah, the question.
Wolf:This is the question that you… I always fail when I'm trying to get you to try something. You, one way or another, ask me this question, and you are never happy with the answer. And so…
Jim McQuillan:Yeah. Okay, what's that?
Wolf:You don't switch. And that is, uh… What is the switching cost? What do they have to do to use the new thing, and what do they get in return for that work?
Jim McQuillan:Great question, and I've got a really good answer for that. The switching cost is near zero.
Wolf:Okay. Because of your app, your tool that switches.
Jim McQuillan:Yes, the old view and the new views come up in the same list of views. So it's not like they have to go to a different program to see these new ones. They appear in the same list of views. So you point to one of the old views, you right-click on it, and you say, convert it to the new system, to AVDE.
Wolf:Oh, you can tell the difference. When you see an old one and a new one side by side, they're just their names. It tells you.
Jim McQuillan:twenty. Twice. Yes, there's a… the name of the view is the same, but there's a column that says either AVDE or blank, so you can tell which one it is.
Wolf:Okay.
Jim McQuillan:And the users, the actual users that are gonna run this, don't get it until you publish a view. You can create a view, you can do all the tweaking you want on it, nobody sees it until you publish it. And then once you publish it, then it shows up in the users menu. as a view that they can run. So the switching cost is nearly zero. I mean. you know, 20 seconds to point at it, and convert it, and…
Wolf:For a person who's using them. But the switching cost for a person who's creating them is higher.
Jim McQuillan:Oh, no, that is the switching cost for creating them, for creating the views. They point at it, they convert it, and I mentioned they have 252 views. That was as of the day that I gave it to them. Uh, 85% of those views convert perfectly. I ran every one of them over and over and over again, and 85% of them convert perfectly. 15%, that's 37 views. They have a little bit of problem with that domain-specific language, because that changed a little bit. I tightened it up a lot. They had a problem where, you know, I said they can have these conditions where they can say, you know, if the appointment type is this, and the location is this. You know, then do something.
Wolf:So the old one had that DSL also.
Jim McQuillan:Well, they had… It did. This one's rewritten to be much tighter. Uh, the old one…
Wolf:But it's the same language.
Jim McQuillan:Uh, very similar language, yeah. Yeah. The, the, the, uh, uh, I could convert the differences between the two, but the, the problem is the old one let them mix ANDs and ORs in the same conditional.
Wolf:Mostly.
Jim McQuillan:And as a programmer, I know how to deal with, you know, structuring my order of my ifs, you know, my conditions to get what I want.
Wolf:Aha.
Jim McQuillan:You know, and it largely involves parentheses.
Wolf:Yeah, use parentheses. Any time it might be misunderstood, because…
Jim McQuillan:And the language… Anytime it's ambiguous, use parentheses, right? So, so, um, and my language supports that. It supports it beautifully, but they don't, they weren't forced to do it. So they had 37 views. All of the failures were for the exact same reason. They had mixed ands and ors.
Wolf:Right. That's right.
Jim McQuillan:Together. Uh, in the same condition, without parentheses. So now, if the appointment type equals, uh, screening, and the location is, um, uh, waiting room. Yeah. um… The patient's age is 85 or older. What's it gonna do? Right? And try to explain that to them. They're not programmers. I've been… I've given them a programming language, but they are not programmers. So what do you do?
Wolf:Mm-hmm. Which, by the way, is why AI is not going to solve all our problems. But keep going.
Jim McQuillan:No, no. So I now strictly enforce that they can't have mixed AND and OR. I don't care about order of precedence. It doesn't matter in this case because they can assume the wrong thing.
Wolf:Yeah, what matters is, a human being cannot have ANDs and ORs in the same sentence, and know what they're going to get.
Jim McQuillan:Yeah, so that's the… so the switching cost, 85% of the time, is zero. Right? They convert the view. Test it a little bit. So there's a few seconds or a few minutes there. Then they publish that view and they disable the old view. And the user, the next time they go pick the view that they want to run, the one that they've always been running, they're just going to get the new system. So the switching cost is very, very low. And I'm really happy about that. The conversion was a huge help. If I didn't do the conversion, they would never convert all those views on their own. Absolutely would not. So… so, yeah. So, I'm… That's it in a nutshell, in a long nutshell, in an hour-long nutshell. But I'm really quite happy with how it's working. They've converted a few views already, some people are using it, not the level I wish they would. Um, oh, remember I talked about that 18-second query? The one that took 18 seconds to run? During my demo, when I was explaining this whole system, I chose that view. And I said, now let me show you how easy it is to convert these views. I right-clicked on it, I converted it. Everything converted perfectly. I knew it would. I saved the converted view. and then I ran that view. Less than one second, almost as quickly as you could start the view running, the data was on the screen.
Wolf:And did they notice?
Jim McQuillan:Oh, God, yeah. In that case, I didn't get the standing ovation, but they kind of erupted with happiness.
Wolf:I like that.
Jim McQuillan:So they knew it was better. So anyway, I've got them to commit to next week spending some time converting more of these views and getting users using them. Because… you know, I did a lot of testing, I did a lot of work on this thing, but I have no idea what it's gonna be like when 140 real sessions are doing real things with this. But based on the way the queries work, um… I believe it's gonna be so much faster.
Wolf:Alright, so let me ask you a couple practical questions, because I think everybody who listens to this podcast has heard me say that, um, you don't do a total rewrite.
Jim McQuillan:So. Yes.
Wolf:Umm.
Jim McQuillan:Right.
Wolf:And that's sort of a summary, a rule of thumb, you don't do a total rewrite. The real statement, the full thing is, you don't pull the stop.
Jim McQuillan:Mmhm.
Wolf:uh, strap on the train, and bring the entire train to a stop so that you can build a new train. Um, is… is the idea. You need to be NOT JUST! uh… getting a brand new thing to parody. You need to be making the same forward progress you would have made. If it wasn't a total rewrite. And to me, it sounds like… The thing that you did didn't stop the train, hasn't stopped the train, and you were making forward progress. You got better than you would have been in the same time. Like, you would have made forward progress if you had not done the total rewrite.
Jim McQuillan:Mmhm.
Wolf:But you made better progress with the total rewrite than even from that. Um… So, I think that is a thing we don't get to fight about today. Um… And also, when we say total rewrite, usually we mean, hey, you're going to spend X years doing it, right? Like when I worked at Netscape, they wanted to.
Jim McQuillan:Right.
Wolf:uh, completely replace the rendering engine inside. And they said, the people who wrote the rendering engine, this will take us, um… three months to do. The rendering engine is written, all we have to do is plug it in. Those were their words. And they asked every other engineer, and we said, it's a minimum of two years. Um…
Jim McQuillan:Yeah.
Wolf:You can stop now, we'll put it in, two years later, we'll ship our next one, and it won't be better.
Jim McQuillan:Right. Right.
Wolf:It'll be exactly what we have now, but working in a way where we can see it's better.
Jim McQuillan:Right.
Wolf:Do not stop the train.
Jim McQuillan:Right, it's a better starting point. Yeah, it's a better point to move forward on. But this…
Wolf:And they stopped the train. Right. They… But they… they stopped the train, and uh… and then Microsoft ate our lunch. So all of the stuff that I'm complaining about, and said we were gonna fight about.
Jim McQuillan:This wasn't that. Yeah, yeah.
Wolf:You didn't do.
Jim McQuillan:Well, I guess that's good.
Wolf:You did the right thing, and you got to the right answer. And I think that's great.
Jim McQuillan:Well, thanks. Thanks. Thanks. I, uh, you know, I've said it over and over again. I've been thinking about this for 15 years, so I had a lot of time to consider my options, and so when I hit the ground on June 1st to start doing the real work.
Wolf:All right.
Jim McQuillan:I already knew what I was going to do. Right. I maybe hadn't hadn't worked out every single detail. but I already pretty well knew what I was gonna do. And my thoughts in the past, they involved things like Redis, storing data in Redis so I could get at it quickly. Turns out, I didn't need that. This just works so well. Oh, and one thing I didn't mention, you know, these worker threads that I spawn when a user connects up, when all users disconnect, I don't throw away that worker thread yet. I hang onto the worker thread for 60 seconds because what if your connection gets disrupted? Right? Wouldn't it be awful if your connection was disrupted, and the worker thread went away, so then when you reconnect. Um, it… it, uh, has to go do all that big work again, do the full query, and… and… and that's just… that's just nonsense. So, for 60 seconds, I'm hanging onto that worker thread, and there's no subscribers, so there's no data to push out to the clients, but it's still sitting there. Watching for updates and updating its internal state.
Wolf:That sounds like a reasonable balance to me. Like, I feel like the thing you're describing as the BigQuery and stuff like that, if you really didn't have any connections, doing it again, it would not be as big as the words you're using.
Jim McQuillan:Um, but… Yeah, yeah.
Wolf:But the balance that you picked is probably reasonable.
Jim McQuillan:Yeah, maybe not. Well, there's… there's always data updating in the system. You know, there's… there's… they got 140 employees, they're always doing stuff, whether it's in this application or not, so the database is constantly being updated. So, you know, the query is gonna be getting updates, you know, the worker thread is gonna be getting notifications of updates, and it's gonna requery those individual rows, but there's just no clients yet, you know, to send it to. But that seemed like a good thing, and it's a tunable parameter. you know, that earlier parameter, the 10 milliseconds that we use for debouncing duplicates, or deduplicating the duplicates, and the 60 seconds to hang on to a worker thread, those are all tunable things. That's just a starting point. We're gonna see how it goes.
Wolf:Yeah. Um… So. I don't know if people can tell when they listen to our episodes. Both of us will occasionally choose a topic that we ourselves think is fantastic. I talk about, in particular, things that are really interesting to me. And lots of times that means.
Jim McQuillan:Yes. Yeah.
Wolf:There's a whole fraction of the listeners out there who don't care, and sometimes, sad as it is, and we don't normally tell each other, uninteresting to. the guy on the other side of the Zoom screen.
Jim McQuillan:Yeah.
Wolf:You have no question, picked topics, and I'm like, I support you, Jim. I just don't care about 2038.
Jim McQuillan:Right.
Wolf:This is not one of those times. Uh, the topic you chose, and I knew it was going to be interesting and even exciting to me up front, um. This one was one that was pure fascination, because it has all the parts I care about. The story of weighing the different things against each other, what costs time, what costs storage, what costs what…
Jim McQuillan:Oh, thank you.
Wolf:You didn't say the magic word I wanted to hear, which is WebSockets. WebSockets.
Jim McQuillan:Oh, what was that? Oh, I didn't even say that, did I? That's how we communicate between the client and the Node.js server. In fact, that's my reason years ago why I chose Node.js, because it does WebSockets so well. And WebSockets are way better than…
Wolf:Yeah, what…
Jim McQuillan:plain old HTTP, uh, uh, calls. Um, it's bi-directional, and the data flows both ways, so the client is not sitting there polling. The server is…
Wolf:Yeah, they really are.
Jim McQuillan:Absolutely, pushing the data out to the client when there's data to push.
Wolf:For realsies.
Jim McQuillan:Yeah, so yeah, WebSockets are the way to go. One of the big cool points about this project. So yeah, you could probably tell I'm excited about this. I'm so happy with how it's turned out. I'm so happy with how it's turned out.
Wolf:Yes. Totally agree. I and when well, you should be. I love it when. Um, I wasn't really a big A-Team fan when I was growing up, but there was a thing that Hannibal used to say, which was…
Jim McQuillan:Yeah, yeah.
Wolf:I love it when a plan comes together. Uh, but the… let me tell you THE reason.
Jim McQuillan:Yeah.
Wolf:This is so exciting to me. Um, I have brain damage or whatever, like, I care about certain things, and I just don't care about certain other things. And, um…
Jim McQuillan:Okay. Sure.
Wolf:There's a certain kind of problem to me. That… I get more enjoyment out of than any other kind of problem.
Jim McQuillan:Kind of like me and SQL queries.
Wolf:It could be, but my problem is a very big one, and that is, you know, when I say it on my resume.
Jim McQuillan:Okay.
Wolf:I say it like this. I do a thing, and that thing is… I make things go faster. But that sentence, um, is doing a lot of heavy lifting. Because when you say, make something go faster, when I say it, what I mean is. It's not about the CPU cycles. It's about every piece of the system. And that means how much RAM, how much storage, how much network bandwidth, how long it takes to get from one end to the other. What does it take for the human being to enter the information? Did it come the right way? Is it shown the right way? Do they go through the right steps? Is the AP… I want to build something that, from STEM to. Stern is the ship that gets you there for the right price.
Jim McQuillan:Mmhm. Mmhm.
Wolf:That's what I mean. And to me. There's this huge factor, uh, people… Hire me because I can make it be less CPU cycles. Okay, fine, yes, I can do that. That part's actually pretty easy. But. Part of making it go fast is… What are the people doing? What order are they doing it in? How do they make the thing they want with the pieces you give them that let them make things? Is it easy to run them? Is it easy to put them in the right order? Do they persist for…
Jim McQuillan:Mmhm.
Wolf:There are a ton of… and also, there's places where you don't actually make it faster, but you make it better because it seems faster. Maybe because here's a place where you can overlap two things that didn't overlap before.
Jim McQuillan:Hey.
Wolf:Or…
Jim McQuillan:Perceived performance is more important than actual performance.
Wolf:Now we might fight, but it absolutely is super important. And I knew that your system. Everything you described was not just going to be about the cost of a query, about the obstacle of a round trip, but was going to include. the handles you put on it, so that somebody could carry it down to the basement. I knew you were gonna tell me the big picture. And that, to me, was the thing I care about. So I got everything out of this episode I was hoping for and more.
Jim McQuillan:Well, good.
Wolf:Thank you.
Jim McQuillan:Thanks. So, take us out. I'm tired.
Wolf:Yeah. It is… it's been the end of a long week. Things are… it's hard. Uh, let me say all the important things. First of all, thank you so much for listening. Uh, the fact that you are listening, and that this is making a difference for you, and that you even want to take the time to talk about it.
Jim McQuillan:Yeah, yeah.
Wolf:That is the whole reason we're doing this. That means we love your feedback. Send us feedback. You can e-mail us, feedback@realhealth.com. runtimearguments.fm. You are already looking at a show, so you've got the show notes. You probably don't need to know that you could go to the website, which is, at this moment, http colon slash slash runtimearguments.fm. Maybe we can fix that. Right now, we're audio only, but we do provide a transcript, which you have with you if you're looking at the show notes in your podcast player. Um, we are thinking of doing… Maybe a visual component. We need your feedback. It would be hard and different for us. Is it worth pursuing? If you say it is, we'll look into it. We'll figure out if it's… if it's in the scope of our powers. Um…
Jim McQuillan:Yes.
Wolf:Okay.
Jim McQuillan:You know?
Wolf:Yep.
Jim McQuillan:There's one thing I should have mentioned at the top of the show. We have never had a guest on an episode yet.
Wolf:But we have thought of some.
Jim McQuillan:That's gonna change. That's gonna change. Let's see, this is episode 39. Episode 41, we are gonna have a guest. We have mentioned a few times in passing that we've got this brilliant friend. He's a genius. He works at Meta.
Wolf:Here's a guy we love. Friend of the show.
Jim McQuillan:in, uh, uh, friend of the show, uh, a great friend of mine for 25-plus years, uh, Marlon. Uh, he is gonna be a guest on our show. Um, I'm really looking forward to that.
Wolf:We've known him since he was, I want to say, just a kid, right? Like, he wasn't married, he didn't have a job, but you already knew. When you looked at him, you knew.
Jim McQuillan:He was in college. He was in college. He was like 19 years old. In fact… In fact… Today is his birthday. Not the day that you're listening to this, but today, what is today? October 16th is his birthday.
Wolf:Is it?
Jim McQuillan:So that's exciting. Oh, 40 something.
Wolf:Can you say how old he is? A kid. He's a kid.
Jim McQuillan:I know, just a kid, I know. Um, anyway, he is going to be a guest. We're going to be talking about performance. He's got a lot to say about performance, because in his world. Everything is about performance. He works at Meta, he works on the infrastructure, he works on the infrastructure, so when they have a library that somehow got a couple of milliseconds longer at executing something.
Wolf:Welcome to my world too!
Jim McQuillan:that's a huge deal so he's going to talk to us about some of that and I'm really looking forward to that one.
Wolf:So, when we were discussing the idea of Marlon being a guest, a lot of existing podcasts, when they have a guest, or maybe they call it doing an interview, if they're a two-host.
Jim McQuillan:Mm-hmm.
Wolf:show, like we are, sometimes when they have a guest. The other host goes away, and it's just one host. Um… And when I found out what the topic was, that the topic is performance, I'm like, they'll take my slot as a host on that show when they tear it from my cold, dead hands.
Jim McQuillan:We're not… No. No, there would be 3. No, I think, as I mentioned to you, when you said that to me, was a lot of times it's when one of the hosts can't make it for an episode, then they pull in a guest as a replacement. That is not what we're doing here. It's going to be Wolf. And myself, talking to Marlon. And, uh, and really, I think, uh, you know, Wolf talks a lot, but I have a hunch Marlon's gonna do most of the talking.
Wolf:Oh, I actually wanted to say something about the talking problem. Uh, yeah, I don't answer questions quickly enough, uh, and we had talked about that, and that my plan was to start a stopwatch, and that has not been working.
Jim McQuillan:And I'm really looking forward to it. Yeah?
Wolf:And so, because it requires judgment, like I have to look at the watch and say, yeah, it's been two minutes, that was too long. No. I need to, for things where I have bad judgment, I need to make a rule where I don't. Make a judgment. Like, for instance, I have made a new rule in the house, I don't watch TV. At all. Ever. I unplugged the TV in my office, and I'm not allowed to turn on the TV in the living room. I have uninstalled YouTube. I have set my limits on my screen time, so I can't run YouTube. There's lots of great stuff on YouTube. But YouTube will make me stay up too late. Here's my talking solution that I'm about to try. At least for answering questions. It doesn't solve all my problems, but maybe it solves this one. When I answer a problem, a question, anything. First. The answer. Then. But there are some fringe, whatever, like explain that there might be more. Do you wanna talk about it? So when you say, Hey, does a bowling ball and a feather drop at the same rate? The answer is yes. At that scale, there's more to talk about, but that might be enough for you. The real answer is no, they don't. You just can't tell the difference. If one of them was the moon…
Jim McQuillan:Right.
Wolf:There is a difference because the moon has gravity of its own. Do not start with the moon. Bowling ball and a feather. That's what they wanted to know.
Jim McQuillan:Yeah, yeah. All right. I look forward to asking you questions and getting an answer like that.
Wolf:Man, I hope I can do it. Is there anything else I needed to take us out with? I said feedback. I said that you can reach us both on Mastodon and our show, Runtime Arguments, has a Mastodon address, Mastodon…
Jim McQuillan:Oh… Yes.
Wolf:runtimearguments at hackyderm.io, and I am yesjustwolf at hackyderm.io, and Jim is jamms…
Jim McQuillan:J. It's J-A-M-M-C-Q.
Wolf:So I was going to say the right thing. jammcq@hackyderm.io. So you can reach us all on Mastodon and you would have found those in the show notes. Please talk to us. Tell us what you want to hear. Tell us what we said right. Tell us what we said wrong.
Jim McQuillan:Add. Yep. Yep.
Wolf:Tell us what questions you still have. Teach us new things we don't know so we can share it with everybody else. we're kind of friendly, and it's not that we're friendly because we want people to listen, we just are friendly. If you talk to us. Guess what? You get to cross over a line into a different circle in the Venn diagram, and that circle is labeled Friends of the Show, or Friends of Us! So do it!
Jim McQuillan:Yeah. Yeah. Yeah.
Wolf:You, Jim, got anything else to close us out with?
Jim McQuillan:Uh, hey, join us for lunch. We meet at a place called Biwako, uh, just south of Ann Arbor. It's in Saline Township every Saturday morning at 11 a.m. Uh, you're welcome to join us. Just walk in, it'll be obvious where we are. And, uh, we… I think last week… we had, like, 8 people. Maybe last week was, like, 5, but we get anywhere from, uh, 3 to 8 people showing up, and it's a blast. We just talk about all kinds of neat stuff. So join us, we would love to have you if you're in the area or near the area.
Wolf:All nerds, all people who specialize in different things, and at different levels and different ages, everybody who shows up learns stuff, I learn stuff, everybody does.
Jim McQuillan:So, yeah. All… all nerds. Yep, yep. All right, all right. Our newest friend is a rocket scientist. He's a professor of aeronautical engineering at University of Michigan.
Wolf:And he works with a big telescope! His name is Jamie! I love this guy!
Jim McQuillan:Jamie, yeah, yeah. So hey, pop in and join us. It would be a blast. And hey, as always, Wolf, thank you for podcasting with me.
Wolf:Thank you!
Jim McQuillan:All right.
Wolf:Especially since you brought the receipts this time.
Jim McQuillan:Ha, thanks.
Wolf:I had a great time, thanks. Um, we'll see what people think of next week. Next week, or next show, I'm gonna talk about something. I'm not directly gonna bring in my number one hero, Dick Feynman, but I kinda am. Because I'm, I'm gonna talk about, um…
Jim McQuillan:All right. Yes. Okay.
Wolf:Cargo cult.
Jim McQuillan:Ooh, that sounds like fun. And I don't know what that is, but I'm going to learn what that is next episode.
Wolf:All right, everybody. Thanks for listening. Talk to you next time.
Jim McQuillan:All right. Bye-bye.
People on this episode
Podcasts we love
Check out these other fine podcasts recommended by us, not an algorithm.
CoRecursive: Coding Stories
Adam Gordon Bell - Software Developer
Two's Complement
Ben Rady and Matt GodboltAccidental Tech Podcast
Marco Arment, Casey Liss, John Siracusa
Python Bytes
Michael Kennedy and Calvin Hendryx-Parker