Author Topic: saving power with asm...  (Read 772 times)

felipe

  • Member
  • *****
  • Posts: 1250
  • Eagles are just great!
saving power with asm...
« on: March 27, 2019, 03:35:04 AM »
i was reading how was the management engine of intel designed (at a high level) taking in consideration the mobile computing. so the engine is embeded in mobile devices too. anyway, one of the issues  into consideration for the design was how to safe power so to extend the battery of the device. and it said that whenever feasible you (the programmer) should privilege performance over memory consumption.
so i was thinking: "that's cool, using short instructions, saving some bytes here and there and trying to make your program fast is still usefull this days (you should know that a lot of people belive assembly is not worth it because compilers... :(), because mobile devices running big programs that uses a lot of memory would consume more battery each time."
so there you have, consider mobile users with their mobile devices battery when you do big apps in asm with this tip and you will be the king of the programming horizons... :t (well, you get the idea... :icon_mrgreen:)
Felipe.

Raistlin

  • Member
  • ****
  • Posts: 503
Re: saving power with asm...
« Reply #1 on: March 27, 2019, 03:55:36 AM »
So here's an interesting question eventually.
(You answered it already) Faster
code equals less power consumption.
BUT does data weigh anything ? Harddrive
before data versus harddrive full of data...
Are we screwing with gravity by accumulating
knowledge ? Will knowledge (via gravity) attract
more knowledge ? ( mistazism welcome  :icon_confused:)
Are you pondering what I'm pondering? It's time to take over the world ! - let's use ASSEMBLY...

TimoVJL

  • Member
  • ***
  • Posts: 488
Re: saving power with asm...
« Reply #2 on: March 27, 2019, 04:34:13 AM »
What kind of mobile devices ?
May the source be with you

daydreamer

  • Member
  • ****
  • Posts: 993
  • I also want a stargate
Re: saving power with asm...
« Reply #3 on: March 27, 2019, 05:12:13 AM »
i was reading how was the management engine of intel designed (at a high level) taking in consideration the mobile computing. so the engine is embeded in mobile devices too. anyway, one of the issues  into consideration for the design was how to safe power so to extend the battery of the device. and it said that whenever feasible you (the programmer) should privilege performance over memory consumption.
so i was thinking: "that's cool, using short instructions, saving some bytes here and there and trying to make your program fast is still usefull this days (you should know that a lot of people belive assembly is not worth it because compilers... :(), because mobile devices running big programs that uses a lot of memory would consume more battery each time."
so there you have, consider mobile users with their mobile devices battery when you do big apps in asm with this tip and you will be the king of the programming horizons... :t (well, you get the idea... :icon_mrgreen:)
1:wonder what is best power consumption a complex calculation of a math function inside cpu/fpu or use memory with LUT?
2:I think its important to change mindset from polling and MSDOS way of game takes 100% of cpu power in a hard loop like old game to newer mindset of eventhandlers:for example put code in WMpaint and other messages and some games/apps dont need to run at several 100 frames per second,because android apps can also have OpenGL
3:you can do native apps,but I dont know if asm is possible,but to use C++ or C# and mostly think in assembly using the lowlevel << >> and other things that you know compiles into shifts,ands,ors,xors
big apps in asm,seem more likely to be most lots of image,3dmodels,sound fx/music 

how many of member here has computers with cpus that throttle up when needed?,I have that with my newest laptop and if I just put things in WM_paint its lowpower,but if I start to put lots of winapi calls in a loop that causes WM_paint messages, the cpu throttles up and I hear the cpu fan runs loud
I think that is the closest thing to know if your program is good lowpower or highpower
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

felipe

  • Member
  • *****
  • Posts: 1250
  • Eagles are just great!
Re: saving power with asm...
« Reply #4 on: March 27, 2019, 07:39:20 AM »
it says mobile devices and mobile endpoints. i assume with that, at least laptops. anyway i haven't finish the reading yet.  :idea:
Felipe.

daydreamer

  • Member
  • ****
  • Posts: 993
  • I also want a stargate
Re: saving power with asm...
« Reply #5 on: March 29, 2019, 11:05:46 PM »
this thread gave me the idea to experiment underclock my computer
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

K_F

  • Member
  • *****
  • Posts: 1540
  • Anybody out there?
Re: saving power with asm...
« Reply #6 on: April 14, 2019, 07:12:06 PM »
All (most) silicon now days is created with MOS technology.
The higher the frequency of operation, the more power it uses.

What is more important is the transition time between logic states - The faster the transition time (higher frequency ;) ) the less power is used.
While the device sits idle in either binary state, it uses leakage (very low) power.

So if a piece of software can perform the same function faster and get back into cpu idle mode, the less power is consumed.
;)

'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

felipe

  • Member
  • *****
  • Posts: 1250
  • Eagles are just great!
Re: saving power with asm...
« Reply #7 on: April 15, 2019, 12:56:34 AM »
Now, that's a good tech info k_f  :t  :icon14:
Felipe.