The average American driver drives something like 15,000 miles in a year. That represents at least 250 hours of driving (based on an average speed of 60 miles per hour). The average car has a range of around 300 miles, so that 15,000 miles represents 50 trips to the pump, which at 5 minutes per fill up would be a little longer than 4 hours. So overall the average commuter is spending the equivalent of about 31 eight hour days driving every year... a full months worth.
The average plug-in hybrid driver probably only needs gas 10 times a year or so, or 50 minutes at gas stations in a year. However, they need to plug the car in, which might take a minute or so, and unplug it before they leave, which could take another minute, so over the course of a year there's 12 hours of plugging in and out. There's some experimental "park over" chargers that might help eliminate that, if you take the time to install that... in both your garage floor and in your car. And there is the time for having the plug-in charger installed, though that will no doubt be done by someone else.
So time wise it's about 254 hours for a gas car, and 263 hours for a plug-in electric hybrid car. So it costs 9 hours more, or 3.5% more time to plug-in. The average hourly wage is something like $19.50, though it fluctuates, so overall driving time represents a loss of productivity of around $5,000 per person. $175 more if you drive a plug-in hybrid.
The workforce participation rate is something like 65%, so this $5000 per person represents about $1.17 Trillion in lost productivity. If all workers switch to plug-in hybrids (this isn't likely), the productivity lost will increase to $1.2 Trillion. There's that 3.5% again... so $35 Billion more lost since GDP is something like $15 Trillion that would be only a 0.25% decrease in the GDP. All based on a few minutes plugging in every day.
Tim Attwood's Blog
Friday, February 15, 2013
Friday, January 18, 2013
Large Files (some understandings)
Haskell tries to memoize everything at top level. That is, it tries to store the results in memory. So if you have some function that is supposed to be processing for a single line in a file ProcessLine :: Handle -> IO() then what happens is that if that code prints something that depends on the input, that is it depends on some content in the file you are opening, then it will evaluate the action. Otherwise it just stores the action to execute later. With a large file that might mean that every call to a ProcessLine function is just storing more into memory. More worryingly, it breaks specified action order sometimes, calling file actions after the file is closed. So essentially Haskell's handling of imperative programming order is somewhat broken, which makes sense, that part of the language is the part that the gurus don't like, so they write their code as pure functions, that part of the code remains untested in places, or they just think it's what should be.
The solution then is just to go ahead and fit all IO into one monolithic call that fits into memory, and write things in pure code like ProcessFile::IO() and ProcessLine :: String -> String and then just map a whole file lazily. In general, since ProcessFile is returned as a single action at the top level, using hGetContents will end up not being all stored in memory unprocessed. There's still some limits here, because ProcessLine might get memoized, and there's no method that I've found yet to just say not to do that.
The solution then is just to go ahead and fit all IO into one monolithic call that fits into memory, and write things in pure code like ProcessFile::IO() and ProcessLine :: String -> String and then just map a whole file lazily. In general, since ProcessFile is returned as a single action at the top level, using hGetContents will end up not being all stored in memory unprocessed. There's still some limits here, because ProcessLine might get memoized, and there's no method that I've found yet to just say not to do that.
Tuesday, May 1, 2012
Large Files
It's been a while. I'm looking for a good understanding of the memory leaking in GHC haskell. In general things that should be compiled in a simple manner tend to start turning into unevaluated chunks of stuff until some value is needed. That's great, lazy is handy sometimes, but sometimes it's just bad. The compiler should be making smarter choices about optimizing, there should be some sort of option to let it know you want to minimize memory usage anyway. As it is it always optimizes for speed, or code size or something. That leads to refactoring code in the hope of making it all behave better, one liners turn into massive libraries and weeks trying to understand how someone else managed to make something they think works, when a lot of time it's really experimental. There are dozens of versions of libraries about dealing with long files, almost all aren't tested, none seem to have any ease in using them. Reading values and processing something from a file should be easy, just sequence it all one chunk or line at a time, it shouldn't always try to force huge memory usage. This is the sort of thing that makes people say haskell is a toy language.
Saturday, August 20, 2011
Picnic
Tuesday, February 9, 2010
Killer Cars
Toyota gas pedals: vroom...splat!
Prius brake computers: vroom...splat!
Volvo gas pumps: drip, drip...kaboom!
I wish that car companies weren't in such a hurry to add new features, and that government would stop being so strict on emissions. I had a two door Sunbird in the 80's that got 45 MPG and was sporty, I'm fairly sure the EC had been removed, but it ran clean. I'm sure a Prius isn't getting much better than 50 MPG, probably because of emissions laws. I've heard that a lightweight diesel car with manual transmission and good aerodynamics can get around 100 MPG if you drive it right.
It's the KISS thing, why spend billions redesigning something that already worked fine? Especially if the new one isn't really all that much better.
Prius brake computers: vroom...splat!
Volvo gas pumps: drip, drip...kaboom!
I wish that car companies weren't in such a hurry to add new features, and that government would stop being so strict on emissions. I had a two door Sunbird in the 80's that got 45 MPG and was sporty, I'm fairly sure the EC had been removed, but it ran clean. I'm sure a Prius isn't getting much better than 50 MPG, probably because of emissions laws. I've heard that a lightweight diesel car with manual transmission and good aerodynamics can get around 100 MPG if you drive it right.
It's the KISS thing, why spend billions redesigning something that already worked fine? Especially if the new one isn't really all that much better.
Wednesday, November 11, 2009
Thursday, August 27, 2009
Politics, Death, and the End of Free Speech
For anyone that has been following American politics lately it can be overwhelming. There are more minor scandals than any average person has time to hear about, much less do anything about. I've come to the conclusion that it's the political version of a document dump. If you are unfamiliar with the term "document dump", it's a tactic used by big company lawyers when they are forced to provide some document, then they'll bury it in entire rooms full of mostly unrelated documents for the opposing lawyers. It's one of those loopholes in the law that most people don't care about, since everyone hates lawyers anyway. Whatever it is that the politicians are up to, it probably is major. For one thing Obama seems to have no intention of stopping warrantless wiretapping, or ending the war, the sort of things that typical Democrat voters really expected. Instead DoJ keeps up their appeals, and Striker gets re-deployed. You might think that the health care reform is where the effort is going, but most representatives haven't taken the time to read it, and Obama doesn't seem to care that his speaches about health care aren't anything like what is in the bill. They don't care that the cancer survival rates in places with universal care are 25% lower, they want control, and power. And more than anything, they want to control the media, with the media they can get re-elected, and get revenge on political opponents. Unfortunately for us the internet is part of what politicians consider the media, I'm sure it'll be a target.
Subscribe to:
Posts (Atom)

