poppit could tune ig.Sound.channels to improve memory usage

RESOLVED WONTFIX

Status

P4
normal
RESOLVED WONTFIX
5 years ago
24 days ago

People

(Reporter: bkelly, Assigned: jmunck, NeedInfo)

Tracking

({perf})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [c=memory p= s= u=][MemShrink:P2])

(Reporter)

Description

5 years ago
While investigating bug 957346 I discovered that a little more than half the 70MB memory in use by poppit was due to loading the game sounds.  In particular, impactjs loads each sound multiple times in order to allow them to be played simultaneously.  With the HTML5 audio element this results in duplicated decoded audio data and decoder library resources.

Currently impactjs loads each sound resource 4 times by default.  This can be tuned using the |ig.Sound.channels| property before calling |ig.main()|.  See the documentation here:

  http://impactjs.com/documentation/class-reference/sound#ig-sound-channels

From playing poppit, it seems unlikely that the game needs to a full 4 channels for each sound effect.  It would be nice if we could talk to the game developer about possibly tuning |ig.Sound.channels| to 2 or 3.  This would reduce the memory footprint of the game by around 10MB to 20MB which is quite significant.
(Reporter)

Comment 1

5 years ago
Elisa, do you know who we could talk to about possibly tuning this value in poppit on fxos?  Thanks!
Flags: needinfo?(ehelton)
Elisa no longer works for Mozilla, so I'm redirecting this to Karen.
Flags: needinfo?(ehelton) → needinfo?(kward)

Updated

5 years ago
Blocks: 871236
(Reporter)

Comment 3

5 years ago
Or even better, we should encourage the software vendor to try the git version of impactjs which has been re-written to use Web Audio for sounds.  I dropped in this version of the code into poppit and saw memory usage drop from ~70MB to ~40MB.

Updated

5 years ago
Whiteboard: [c= p= s= u=][memshrink] → [c=memory p= s= u=][memshrink]

Comment 4

5 years ago
adding Harald and Louis to cc.  Will one of you reach out to Poppit with this suggestion?
Flags: needinfo?(kward)
I'll get in touch with them. If the game worked just fine with the latest stable release that would be a swell upgrade path.
Assignee: nobody → hkirschner
(Reporter)

Comment 6

5 years ago
(In reply to Harald Kirschner :digitarald from comment #5)
> I'll get in touch with them. If the game worked just fine with the latest
> stable release that would be a swell upgrade path.

The Web Audio implementation of impactjs is not quite released yet.  I've been told "in the next few weeks".  I believe it will be in impactjs 1.24 when it is available.  The game developer should also have access to the git repo which contains the implementation as well.
Whiteboard: [c=memory p= s= u=][memshrink] → [c=memory p= s= u=][MemShrink:P2]

Comment 7

5 years ago
Are there any updates regarding this bug?
Status: NEW → ASSIGNED

Comment 8

5 years ago
Julia, please review and provide a fix date.  Thank you
Assignee: hkirschner → jmunck
Flags: needinfo?(jmunck)

Comment 9

4 years ago
Julia - are there any updates regarding this bug?
Priority: -- → P4

Comment 10

4 years ago
Are there any updates regarding this bug?
Mass closing on Tech Evangelism::Preinstalled B2G App as Firefox OS is no longer a thing.
Status: ASSIGNED → RESOLVED
Last Resolved: 24 days ago
Resolution: --- → WONTFIX
Mass closing on Tech Evangelism::Preinstalled B2G App as Firefox OS is no longer a thing.
Mass closing on Tech Evangelism::Preinstalled B2G App as Firefox OS is no longer a thing.
You need to log in before you can comment on or make changes to this bug.