Spotify Performance

Just a quick post to report on my find­ings of mea­sur­ing the ener­gy impact of three dif­fer­ent ways to have Spo­ti­fy play­ing in the back­ground: the Spo­ti­fy app and the web play­er using two dif­fer­ent browsers (Safari and Fire­fox).

Inspec­tion of the pack­age con­tents of the desk­top app reveals it to be just a con­tain­er ver­sion of the web play­er, bring­ing with it its own instance of a Chromi­um Embed­ded frame­work (for a whop­ping 168 MB, no less). So what we are real­ly see­ing is the per­for­mance of the web play­er in three dif­fer­ent brows­er engines.

So here are the num­bers, tak­en from the ‘ener­gy’ tab in Activ­i­ty Mon­i­tor, on a Mac Book Pro 15″ (2017), and in all cas­es the win­dow was invis­i­ble off-screen*. I also includ­ed iTunes play­ing a local file for comparison:

idle play­ing
Web play­er in Safari 14.0 < 0.1 2.1
Web play­er in Fire­fox 86 < 0.1 13.8
Spo­ti­fy App 1.1.53 (Chromi­um embedded) 2.3 3.4
iTunes 12.9 < 0.1 1.7

(*the respec­tive app was first expand­ed full screen, and then the focus was switched back to the desk­top so that the app win­dow was total­ly not shown, not even a min­i­mized win­dow or icon)

And the win­ner for run­ning Spo­ti­fy with the least ener­gy impact is actu­al­ly the Safari brows­er. Con­grat­u­la­tions to the Apple engi­neer­ing team! The desk­top app run­ning Chromi­um Embed­ded comes sec­ond (but with a curi­ous­ly high idle activ­i­ty), while Fire­fox only comes last.

In the hope that this infor­ma­tion was use­ful, make of it as you will :)

EDIT: I just learned that the web play­er does not sup­port loud­ness nor­mal­iza­tion so it is not even an apples-to-apples comparison!

Safari 14, Shadertoy and WebGL 2

This is a quick post thrown togeth­er to report on my expe­ri­ence with the new Safari 14 regard­ing sup­port for WebGL 2. The news of improved WebGL sup­port was float­ed last month in the Shader­toy Com­mu­ni­ty Group:Fast for­ward to today and the Safari 14 update has now come to my lap­top (which still runs macOS Mojave). So the first thing I did check out all my shaders on Shader­toy and then some to see if the promis­es were true. My ver­dict (TL/DR):

Weit­er­lesen

GPU Pro 3 has arrived

I found my copy of the book in the mail today. I was a lit­tle sur­prised by the mod­er­ate size—other vol­umes of this series were just that: vol­umes! I think this one is about half the size than the pre­vi­ous tomes. By the way, this post is a shame­less plug because there is an arti­cle writ­ten by me in it. Thanks go to Wolf­gang Engel, the series edi­tor, and Christo­pher Oat, my sec­tion edi­tor, and CRC press for mak­ing it pos­si­ble! I will post some com­ments on the oth­er arti­cles when I read them through.

Edit:
I found one very good and com­pre­hen­sive arti­cle on data dri­ven engine design by Don­ald Revie. The ideas pre­sent­ed in there res­onate very well with the designs that I found worked well in the past, so this part gets a sol­id +1 from me.

(I end­ed up with a tri­ad of IRen­der­Ob­ject, IRen­der­Ge­om­e­try and IRen­der­Pro­gram, where the ren­der object would AddBatch­es() to a draw list, each of which refers to one geom­e­try con­tain­ing the mesh and one pro­gram for set­ting the ren­der state. For instance, a SpeedTree™ ren­der object would typ­i­cal­ly add three batch­es, one for each of the branch­es, fronds and leaves, where each batch would pair the spe­cif­ic geom­e­try with an appro­pri­ate pro­gram. The draw list is then sort­ed in one go via a gen­er­al 128 bit sort key, and the batch­es ren­dered in order. This sys­tem is gen­er­al enough that the UI sys­tem also can just AddBatch­es() to this list (so the UI sys­tem, as a whole, is just one instance of a ren­der object). In this case, the indi­vid­ual UI geom­e­try objects just rep­re­sent views into one big dynam­ic ver­tex buffer. I prob­a­bly want to explain this sys­tem in detail in anoth­er post.)

Anoth­er two very inspir­ing arti­cles so far are the one about geo­met­ric post­process antialias­ing, by Emil “Humus” Pers­son, and the piece about glob­al illu­mi­na­tion using a vox­el grid, from the teams at the Unis Koblenz/Magdeburg. I already read their ACM paper before and I think it is a viable method.