My work has kicked into top gear in the last couple of weeks. I’ve had so many demands on my time that I have been unable to do any coding. Now I know that that is part and parcel of being a Tech Lead but the moment you step away from the code you start to lose the qualities that make you so useful to the business, i.e. being able to stick your nose into the codebase and shout “Yep, I know what this bit does.”
So I’ve been spending a few hours every night keeping my skills sharp on a project that a) has a direct impact on what I do everyday and b) is bloody good fun. How much fun I here you ask? So much that my wife forced me to sleep in the “huff” bed (the spare room – where you go when you are too angry or too drunk to sleep together) since I kept talking about what I was doing.
So what is it? Some multi-threaded mayhem of course!
Not really of course. I regard manual thread manipulation and the last refuge of fools and geniuses and I ain’t either. My current project is a web application which makes a large number of concurrent requests for each page request. We use various bits of the java.util.concurrent libs to do this. This works great but at scale can cause issues since each thread takes a few MB. Once you’ve spun up a couple of thousand of them, your machine has eaten itself. A solution to this would be to use Actors instead and since the excellent Akka framework can be used in Java and not just Scala I thought I would give it a go. At the same time, since it was a home project I thought I would use Git for version control.
I finished up the project today and it’s pretty cool. Akka’s syntax in Java is comparatively clunky to its syntax in Scala but I’ve seen far worse. Some perf testing on Monday should show what difference it makes and if it is good enough I might take it to the next LJC meeting.