This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
MIDIMessage is currently defined as a dictionary. In the case of thousands of MIDIMessages being pumped through the system, that would be less efficient than a type that can be explicitly typecast.
(In reply to comment #0) > MIDIMessage is currently defined as a dictionary. In the case of thousands > of MIDIMessages being pumped through the system, that would be less > efficient than a type that can be explicitly typecast. I'm not sure what you mean by a type that can be explicitly typecast, could you clarify? Do you mean using a constructed type instead, like `new MIDIMessage(data, timestamp)`?
(In reply to comment #1) > I'm not sure what you mean by a type that can be explicitly typecast, could > you clarify? Do you mean using a constructed type instead, like `new > MIDIMessage(data, timestamp)`? In essence, except the other way around. A Dictionary type just means an Object with those members; unfortunately, they can be organized in any way, and the members need to be "searched" for; these types cannot be optimized down to essentially a struct behind the scenes. I received feedback that it is best to avoid Dictionary types for basic structures unless absolutely necessary.
(In reply to comment #2) > (In reply to comment #1) > > I'm not sure what you mean by a type that can be explicitly typecast, could > > you clarify? Do you mean using a constructed type instead, like `new > > MIDIMessage(data, timestamp)`? > > In essence, except the other way around. A Dictionary type just means an > Object with those members; unfortunately, they can be organized in any way, > and the members need to be "searched" for; these types cannot be optimized > down to essentially a struct behind the scenes. I received feedback that it > is best to avoid Dictionary types for basic structures unless absolutely > necessary. True. Since we've already simplified the MIDIMessage interface to just contain the data and the timestamp, we might take it a step further, i.e. change the `send(MIDIMessage)` signature to be `send(Uint8Array data, DOMHighResTimeStamp? timestamp)`, and change the MIDIMessage from a dictionary to an interface (since dictionary makes no sense if it's not ever created by the user). Thoughts?
That's pretty much the conclusion I'd reached as the solution for https://www.w3.org/Bugs/Public/show_bug.cgi?id=18764 - i.e. as the consolidation of send() and sendMIDIMessage(). I'll edit it later today.
Moved to interface (although the difference is irrelevant, now, since MIDIMessage objects are only created inside the implementation, not by developers. https://dvcs.w3.org/hg/audio/rev/f939eca58e74
No objection in 2 weeks since resolution. Closing.