If you want *really* fast buffer access for larger integer types and float 
types, you can set up a native module that 
calls SetIndexedPropertiesToExternalArrayData a few times on your Buffer 
and gives you a native indexed view into the buffer for whatever primitive 
type you want to read (much, much, much faster than trying to read a float 
byte-by-byte and assemble it).  We do this in our internal networking 
buffers, and got quite a speed-up compared to combining bytes in JS (though 
either are *way* faster than calling into native methods to do the read, 
except maybe with floats).  Note: for un-aligned reads (e.g. reading a 
64-bit float from 3 bytes within a buffer), I think this only works on some 
platforms, but those platforms include x86 and x64, which is all we care 
about in our case.

  Jimb Esser
  Cloud Party

On Wednesday, October 3, 2012 5:38:38 PM UTC-7, NodeNinja wrote:
>
>
>
> On Thursday, October 4, 2012 5:44:16 AM UTC+5:30, Ben Noordhuis wrote:
>>
>> They won't, they're there mostly for convenience*.
>>
>
> Now that's an* eye opener* Ben!
> I hope that line finds its way to the documentation.
> Many thanks!!
>
>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to