[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

#defines in Ruby's .c files

ptkwt

1/31/2006 5:35:00 AM

I was talking to someone on irc who was trying to speed up sockets - he came up
with a way to do it by modifying sysread() so that a new buffer doesn't always
have to be allocated on each call. (sped up sockets by 314x by his account, BTW
:) However, he had to patch the Ruby source code to do this because he was not
able to access a macro (READ_DATA_BUFFERED) from his extenstion code. Turns
out that the macro READ_DATA_BUFFERED is defined in io.c, so you can't use it
from an extenstion.

So, I got to thinking that maybe #defines like that should go into .h files,
not .c files (maybe it should be #define'd in rubyio.h) so that they are
accessable in extenstions.

Would it be possible to move some of them to .h files for 1.8.5 (or at least
before 2.0)?

Phil
3 Answers

Yukihiro Matsumoto

2/2/2006 6:28:00 AM

0

Hi,

In message "Re: #defines in Ruby's .c files"
on Thu, 2 Feb 2006 06:45:53 +0900, ptkwt@aracnet.com (Phil Tomson) writes:
|
|I was talking to someone on irc who was trying to speed up sockets - he came up
|with a way to do it by modifying sysread() so that a new buffer doesn't always
|have to be allocated on each call. (sped up sockets by 314x by his account, BTW
|:) However, he had to patch the Ruby source code to do this because he was not
|able to access a macro (READ_DATA_BUFFERED) from his extenstion code. Turns
|out that the macro READ_DATA_BUFFERED is defined in io.c, so you can't use it
|from an extenstion.
|
|So, I got to thinking that maybe #defines like that should go into .h files,
|not .c files (maybe it should be #define'd in rubyio.h) so that they are
|accessable in extenstions.
|
|Would it be possible to move some of them to .h files for 1.8.5 (or at least
|before 2.0)?

How about merging his patch to io.c? I would be very glad to apply if
it increases io performance 314 times.

matz.


ptkwt

2/2/2006 7:42:00 AM

0

In article <1138861656.852332.2507.nullmailer@x31.priv.netlab.jp>,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
>Hi,
>
>In message "Re: #defines in Ruby's .c files"
> on Thu, 2 Feb 2006 06:45:53 +0900, ptkwt@aracnet.com (Phil Tomson) writes:
>|
>|I was talking to someone on irc who was trying to speed up sockets - he came up
>|with a way to do it by modifying sysread() so that a new buffer doesn't always
>|have to be allocated on each call. (sped up sockets by 314x by his account, BTW
>|:) However, he had to patch the Ruby source code to do this because he was not
>|able to access a macro (READ_DATA_BUFFERED) from his extenstion code. Turns
>|out that the macro READ_DATA_BUFFERED is defined in io.c, so you can't use it
>|from an extenstion.
>|
>|So, I got to thinking that maybe #defines like that should go into .h files,
>|not .c files (maybe it should be #define'd in rubyio.h) so that they are
>|accessable in extenstions.
>|
>|Would it be possible to move some of them to .h files for 1.8.5 (or at least
>|before 2.0)?
>
>How about merging his patch to io.c? I would be very glad to apply if
>it increases io performance 314 times.
>
> matz.
>
>

It looks like he found some other problems with that patch (core dumps). So
the idea is being rethought.

Phil

Habitat for Humility

6/22/2012 9:20:00 PM

0

On Fri, 22 Jun 2012 13:44:28 -0700 (PDT), mg <mgkelson@yahoo.com>
wrote:

>On Jun 22, 11:04?am, Islander <nos...@priracy.net> wrote:
>> The decision on Affordable Health Care was expected last Monday, then
>> Tuesday,...delayed each time until we have run out of week. ?I really
>> expected it to occur today, Friday, in the tradition of burying news
>> before the weekend. ?But it didn't happen. ?Now it is expected some time
>> next week.
>>
>> What has caused the delay? ?Could it be that SCOTUS is having a bit of
>> an internal problem? ?Are they afraid of what the public reaction will be?
>
>My knee-jerk guess is that the mandate part has already been struck
>down 5-4, along predicted political lines, and now the Republicans on
>the court are trying to dig up some sort of legal justification for
>striking down the rest of the law, but are having a hard time finding
>even a flimsy excuse to ax the rest of it.

---

The following comments brought
to you by Habitat for Humility:

Without a severability clause the excuse presents itself.