- Jul 13, 2010
- 143
- 0
- 0
this thread and OP is fail.
Better fail virtually than actually. :twisted:
this thread and OP is fail.
Better fail virtually than actually. :twisted:
So I tried to figure it out unscientifically. If each computer uses 1 Cent less energy a month, and we have a billion computers laptops and so on, we get a saving of 10 000 000 Dollars.![]()
You sure about this? An OS is rather dynamic, sometimes those "useless instructions" might actually be vital for proper operation. IOWs, you sure those Instructions are not there to address occasional Variables?
I can possibly see a situation where a Programmer uses a Command that does more than he/she Needs, but is that the fault of the Language or simply a poor choice by the Programmer? If it's the Language, perhaps the Language simply needs a new Command.
Come on, take my word when I say I know what I am ralking about. give me a 100 kilobyte c code and I'll give it back to you in less than 10 kilobytes. But as we all know size is not all. Loop optimization is the main advantage of assembly.
Think about the Energy Efficiency of failure!![]()
I suspect the bigger savings to be had when it comes to reducing electricity usage with personal computers would be to eliminate the need for anti-virus scanners to be running in the background all the time, processing every byte that flows through the system.
The premise of the OP though is about as practical an effort to reduce electricity usage as proposing everyone stops using automobiles for their commute and instead walk to work everyday as a means to reduce fossil fuel usage.
That and breeding unicorns that fart rainbows are two awesome goals to have in life but are not ever going to happen, ever, for fundamentally inescapable reasons.
i spend most of my day writing c++ code for windows. And I can at least somewhat write assembly, at least well enough that if you give me a decompiled win32 app I can tell you what its doing.
I think first off it would take FOREVER to write a real program using it. The main thing though is most C++ compiled code is very well optimized by th ecompiler. Assembly code doesn't really save that much power for one thing. For example windows if it was written all in ASM would just have a lot of loops running in assembly as say services or something. The loops wouldnt be more efficient than efficiently written c++ code that had been compiled into asm.
not to mention you can write really realyl bad asm. So running a loop that say I don't know is waiting for user input in asm, vs in c++ saves you no power. Most of the power waste in a PC is already being fixed by having transistors that power off, and speedstep/power now type things, not becuase the code is slightly less efficient.
So it probably would not save much power, cause tons and tons more bugs, and make writing code take forever.
I have a coworker who used to work at a startup that wanted to make a PDA using all assembly to make it faster. It was fast all right given the hardware. But it was only a little faster than windows CE. and it took them so long to write apps that when win CE came out, they couldn't keep up and it only was barely faster unless it was for a game or something that was actually intensive.
Windows xp search for a file used to take more than a minute on my computer. I wrote assembly code which did it in 14 seconds. I didn't even optimize it.
Hi idontcare. I have read some of your posts and they are mostly ok. But here you are talking far below yourself. If you think a thread is stupid the clever thing to do is to keep away, unless you are stupid too. :twisted:
Windows xp search for a file used to take more than a minute on my computer. I wrote assembly code which did it in 14 seconds. I didn't even optimize it.
What a bunch of trolls here, I'll feed you as much as you want. it is my favorite passtime. But for now please get out of my thread unless you have something positive to say. D:
I am beginning to wonder if my question is as stupid as you guys make it seem. I thought it was a good question. You say it isn't? so be it.
My post was made in earnest. But it wouldn't be the first time I've cast pearls before swines, message received loud and clear.
It's not a bad question to ask how much power savings can come from truly optimized and efficient code. It is quite clear that there is plenty of room for optimization in OS's. Just compare Mac OS to Windows battery life running the same hardware.
That's not what you asked though. You asked what if OS's were written in Assembly.
I don't know how many times it needs to be said, Assembly does not equal efficiency!!!!
You mentioned the 10kb C code down from 100kb. An OS is orders of a magnitude more complicated than that!! It is beyond the reach of a human or team of humans to optimize an OS in assembly like you're proposing. Small code yes, not a huge OS let alone writing it like that.
Assembly has a purpose now days. Being highly efficient in SMALL computers or hardware that require SMALL firmware or OSs. Even then for embedded systems C compilers are very very close to being as efficient as Assembly.
Casting pearls is exactly what I am doing here.
I came here for some interesting ( for me at least) and who knows maybe useful discussion,and I stand by my point and idontcare, because I know what I say makes good sense. Go learn assembly and you'll know what I am talking about.
