My x120 still gets more than 6 hours on its original 9-cell battery. Sway works great on it -- heavyweight DEs long since became unusable. The only problem it's developed is that if I pick it up by the bottom of the keyboard, it locks up. Some loose internal wiring, no doubt. Have to remember to pick it up by the hinge end.
I generally upgrade when the battery can't keep up any more (or the damn thing falls apart, like my old X201). My 1st gen Thinkpad X1 was put out to pasture when the battery would only last about 2 hours and the (proprietary) ssd started going bad. Upgraded to a T460 with an i5 and love it. The hot-swappable battery is great in my book, although I don't understand why they don't have a separate charging dock for them.
A small NiCad (though I'll be swapping it with a newer super capacitor soon) keeps the memory contents available when you swap out the four AA batteries if they run low (you get several days of runtime off them).
When it comes to battery, no one talks about performance. If I yank the power cable, my battery lasts maybe 1-2 hours, but the performance is 1/2 or even less. So I just avoid it.
I do have a similar experience. However, when I start compiling, the battery goes down in 2-3 hours. Simply because the compilation takes so much time...
Or if you have some spare basement space, pick up an old Dell PowerEdge or some HP equivalent from eBay and slap ESXi on it. Works well for me, and I use my PowerEdge T410 for some other home services. 12 cores, 24 threads and 64GB DDR3 ECC RAM goes a pretty long way.
If you’re an Emacs user, TRAMP makes running compilers on an external system feel almost completely transparent. New shells automatically open up on the remote machine and it feels almost local if your network latency is low enough.
You can also get NOS batteries on eBay for virtually nothing. Recently got a 68+ for my T440 for £39 delivered.
Be careful though as anything over 4 years old can be DOA as the batteries slowly discharge and the BMS in the battery itself disconnects them permanently for safety. This applies to ones Lenovo sell as well. I found this out when I bought the above but the seller sent another one out FOC. I dismantled the dead one, pulled the 18650s out and charged them up standalone and they were fine. Free cells!
If I work on a laptop, I don't want to have to look for a power socket around, I need something to work on battery for at least half day.