Bug 1063050 - Don't use DataView in DataBuffers. #1701
Conversation
/botio test |
From: Bot.io (Main)ReceivedCommand cmd_test from @mbebenita received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/5d9b52e6e29eaf6/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/5d9b52e6e29eaf6/output.txt Total script time: 14.97 mins
|
/botio test |
From: Bot.io (Main)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 1 Live output at: http://areweflashyet.com:8081/8363286452a20b0/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/8363286452a20b0/output.txt Total script time: 16.00 mins
|
/botio test |
From: Bot.io (Main)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/168a4be21358cf1/output.txt |
From: Bot.io (Main)SuccessFull output at http://areweflashyet.com:8081/168a4be21358cf1/output.txt Total script time: 15.45 mins
|
Bug 1063050 - Don't use DataView in DataBuffers.
It may make sense to revisit the way we handle read/write doubles, reading 8 bytes one at a time doesn't see too great. |
Main change here is that we no longer use DataViews to read unaligned values, instead we just read byte by byte and do a little bit shifting. The second change, is that we no longer try to be clever about when to use different kinds of views. For instance, if you look at the current implementation of readInt(), you would think that optimizing it to check for 4 byte alignment and using a i32View would be more efficient. In reality it doesn't really make a difference and can actually be slower because of more branches and possibly making the function less inline worthy. I've experimented with this a bit, and I've concluded that the best thing to do here is to keep things as simple as possible.