Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Array reads faster than Buffer reads ???
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben Noordhuis  
View profile  
 More options Oct 4 2012, 10:30 pm
From: Ben Noordhuis <i...@bnoordhuis.nl>
Date: Fri, 5 Oct 2012 04:30:35 +0200
Local: Thurs, Oct 4 2012 10:30 pm
Subject: Re: [nodejs] Array reads faster than Buffer reads ???

On Fri, Oct 5, 2012 at 1:08 AM, NodeNinja <aeon6f...@gmail.com> wrote:
> On Friday, October 5, 2012 1:58:17 AM UTC+5:30, Dan Milon wrote:
>> Curious, shouldn't V8 be able to inline the readUInt8 function call, or
>> there's more than that?

> That's what even I was thinking about if all the buf.read*() and the
> buf.write*() functions are much slower than the indexed version. Possibly
> Ben would know better about this.

The read*() and write*() functions do more than simple stores and
loads, they also perform (optional) error checks and byte swaps.
Besides, they're pure JS functions while buf[i] is an intrinsic. Can't
compete with that. :-)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.