[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[ANN] CGIExt 0.0.2 released - a re-implementation of cgi.rb in C extension

Makoto Kuwata

11/26/2007 2:00:00 PM

Hi, all.

I have released CGIExt 0.0.2.
http://rubyforge.org/projec...


== About

'CGIExt' is a re-implementation of 'cgi.rb' in C extension.
It makes your web application faster.

Currently, not of all functions are implemented.

Notice: This module is still 'alpha release' and it's specification
may change in the future.


== Install

You need C compiler and Ruby's header file to compile CGIExt.

$ tar xzf cgiext-xxx.tar.gz
$ cd cgiext-xxx/
$ ruby extconf.rb
$ make
$ sudo make install


== Usage

The following is an example.

require 'cgi'
require 'erb'
require 'cgiext' # replaces functions automatically

If you require 'cgiext', the following functions are replaced by
faster implementation of CGIExt.

* CGI.escapeHTML()
* CGI.unescapeHTML()
* CGI.escape()
* CGI.unescape()
* CGI.rfc822_date()
* CGI.parse()
* ERB::Util.h()
* Erubis::XmlHelper.escape_xml()
* Tenjin::HtmlHelper.escape_xml()

Notice that these are replaced only when you have required that
module.
For example, if you have not required ERB before requiring 'cgiext',
ERB::Util.h() is not replaced.


== Benchmark

Try 'bench.rb' included in CGIExt archive.
This script tests functions of CGI and ERB.

### without CGIExt
$ ruby -s bench.rb -N=100000
user system total real
CGI.escapeHTML 5.110000 0.020000 5.130000 ( 5.188709)
ERB::Util.h 5.030000 0.020000 5.050000 ( 5.109625)
CGI.unescapeHTML 31.090000 0.090000 31.180000 ( 31.492502)
CGI.escape 4.630000 0.020000 4.650000 ( 4.679305)
CGI.unescape 3.780000 0.000000 3.780000 ( 3.800455)
CGI.rfc1123_date 2.020000 0.010000 2.030000 ( 2.049406)
CGI.parse 12.030000 0.030000 12.060000 ( 12.156096)
CGI.new 19.670000 0.050000 19.720000 ( 19.854737)

### with CGIExt
$ ruby -s bench.rb -N=100000 -cgiext
user system total real
CGI.escapeHTML 0.990000 0.010000 1.000000 ( 1.026906)
ERB::Util.h 0.960000 0.000000 0.960000 ( 0.971983)
CGI.unescapeHTML 1.200000 0.000000 1.200000 ( 1.210950)
CGI.escape 0.470000 0.000000 0.470000 ( 0.478267)
CGI.unescape 0.340000 0.000000 0.340000 ( 0.343116)
CGI.rfc1123_date 0.600000 0.010000 0.610000 ( 0.634919)
CGI.parse 1.990000 0.000000 1.990000 ( 2.003067)
CGI.new 8.990000 0.020000 9.010000 ( 9.084454)

The result shows that CGIExt makes functions of CGI and ERB
extremingly faster.


== License

Ruby's license


== Authoer

makoto kuwata <kwa(at)kuwata-lab.com>


== Bug reports

If you have bugs or questions, report them to kwa(at)kuwata-lab.com.


--
makoto kuwata

10 Answers

Michael Black

11/3/2013 8:44:00 PM

0

erilar

11/4/2013 9:01:00 PM

0

In article <l566cm$mul$9@dont-email.me>,
Ubiquitous <weberm@polaris.net> wrote:

> drache@chibardun.net.invalid wrote:
> > Ubiquitous <weberm@polaris.net> wrote:
>
> >> What did you watch?
> >
> >Dr Who on PBS; there was an episode I hadn't seen, and next week they
> >start the next season, which I believe is the last with Matt Smith.
>
> PBS? I did not know they aired Doctor Who.

Depends on the station. It's on Wisconsin PBS, not Minnesota PBS. I get
both.

--
Erilar, biblioholic medievalist


erilar

11/4/2013 9:04:00 PM

0

In article <alpine.LNX.2.02.1311031542481.26090@darkstar.example.org>,
Michael Black <et472@ncf.ca> wrote:

> On Sun, 3 Nov 2013, Ubiquitous wrote:
>
> > drache@chibardun.net.invalid wrote:
> >> Ubiquitous <weberm@polaris.net> wrote:
> >
> >>> What did you watch?
> >>
> >> Dr Who on PBS; there was an episode I hadn't seen, and next week they
> >> start the next season, which I believe is the last with Matt Smith.
> >
> > PBS? I did not know they aired Doctor Who.
> >
> I wondered too. The Vermont PBS station used to air Doctor Who, but that
> was decades back, the Doctor with the curly hair. But that was a long
> time ago. It seems like Doctor Who has gone mainstream in more recent
> times, and has appeared on more commercial channels.

I first watched it when Tom Baker(curly hair, long scarf) was the
Doctor, then later earlier and later incarnations, always on Minnesota
PBS back then. I've been dependent on PBS for BBC series for years.

--
Erilar, biblioholic medievalist


Michael Black

11/4/2013 10:31:00 PM

0

Ubiquitous

11/4/2013 11:22:00 PM

0

et472@ncf.ca wrote:
>On Mon, 4 Nov 2013, erilar wrote:
>> Michael Black <et472@ncf.ca> wrote:
>>> On Sun, 3 Nov 2013, Ubiquitous wrote:
>>>> drache@chibardun.net.invalid wrote:
>>>>> Ubiquitous <weberm@polaris.net> wrote:

>>>>>> What did you watch?
>>>>>
>>>>> Dr Who on PBS; there was an episode I hadn't seen, and next week they
>>>>> start the next season, which I believe is the last with Matt Smith.
>>>>
>>>> PBS? I did not know they aired Doctor Who.
>>>>
>>> I wondered too. The Vermont PBS station used to air Doctor Who, but that
>>> was decades back, the Doctor with the curly hair. But that was a long
>>> time ago. It seems like Doctor Who has gone mainstream in more recent
>>> times, and has appeared on more commercial channels.
>>
>> I first watched it when Tom Baker(curly hair, long scarf) was the
>> Doctor, then later earlier and later incarnations, always on Minnesota
>> PBS back then. I've been dependent on PBS for BBC series for years.
>>
>It was Tom Baker I was thinking of, he's the only Doctor Who that comes to
>mind. I was going to say "and a scarf" but I wsan't sure if that was
>specific to his Doctor Who or if they all had scarves.

Yeah, like there's another one who wears a scarf?

I haven't seen Doctor Who on PBS in scores.

--
Q: Why is ObamaCare like a turd?
A: You have to pass it to see what's in it.

suzeeq

11/5/2013 1:09:00 AM

0

Michael Black wrote:
> On Mon, 4 Nov 2013, erilar wrote:
>
>> In article <alpine.LNX.2.02.1311031542481.26090@darkstar.example.org>,
>> Michael Black <et472@ncf.ca> wrote:
>>
>>> On Sun, 3 Nov 2013, Ubiquitous wrote:
>>>
>>>> drache@chibardun.net.invalid wrote:
>>>>> Ubiquitous <weberm@polaris.net> wrote:
>>>>>> What did you watch?
>>>>> Dr Who on PBS; there was an episode I hadn't seen, and next week they
>>>>> start the next season, which I believe is the last with Matt Smith.
>>>> PBS? I did not know they aired Doctor Who.
>>>>
>>> I wondered too. The Vermont PBS station used to air Doctor Who, but that
>>> was decades back, the Doctor with the curly hair. But that was a long
>>> time ago. It seems like Doctor Who has gone mainstream in more recent
>>> times, and has appeared on more commercial channels.
>> I first watched it when Tom Baker(curly hair, long scarf) was the
>> Doctor, then later earlier and later incarnations, always on Minnesota
>> PBS back then. I've been dependent on PBS for BBC series for years.
>>
> It was Tom Baker I was thinking of, he's the only Doctor Who that comes to
> mind. I was going to say "and a scarf" but I wsan't sure if that was
> specific to his Doctor Who or if they all had scarves.

Just him.

Arthur Lipscomb

11/5/2013 4:21:00 AM

0

On 11/4/2013 1:03 PM, erilar wrote:
> In article <alpine.LNX.2.02.1311031542481.26090@darkstar.example.org>,
> Michael Black <et472@ncf.ca> wrote:
>
>> On Sun, 3 Nov 2013, Ubiquitous wrote:
>>
>>> drache@chibardun.net.invalid wrote:
>>>> Ubiquitous <weberm@polaris.net> wrote:
>>>
>>>>> What did you watch?
>>>>
>>>> Dr Who on PBS; there was an episode I hadn't seen, and next week they
>>>> start the next season, which I believe is the last with Matt Smith.
>>>
>>> PBS? I did not know they aired Doctor Who.
>>>
>> I wondered too. The Vermont PBS station used to air Doctor Who, but that
>> was decades back, the Doctor with the curly hair. But that was a long
>> time ago. It seems like Doctor Who has gone mainstream in more recent
>> times, and has appeared on more commercial channels.
>
> I first watched it when Tom Baker(curly hair, long scarf) was the
> Doctor, then later earlier and later incarnations, always on Minnesota
> PBS back then. I've been dependent on PBS for BBC series for years.
>

I was the same way except for me it was KTEH in the SF Bay Area. Of
course now I get my British TV from BBC America.

erilar

11/5/2013 7:57:00 PM

0

In article <l59a64$hcn$1@dont-email.me>,
Ubiquitous <weberm@polaris.net> wrote:

> et472@ncf.ca wrote:
> >On Mon, 4 Nov 2013, erilar wrote:
> >> Michael Black <et472@ncf.ca> wrote:
> >>> On Sun, 3 Nov 2013, Ubiquitous wrote:
> >>>> drache@chibardun.net.invalid wrote:
> >>>>> Ubiquitous <weberm@polaris.net> wrote:
>
> >>>>>> What did you watch?
> >>>>>
> >>>>> Dr Who on PBS; there was an episode I hadn't seen, and next week they
> >>>>> start the next season, which I believe is the last with Matt Smith.
> >>>>
> >>>> PBS? I did not know they aired Doctor Who.
> >>>>
> >>> I wondered too. The Vermont PBS station used to air Doctor Who, but that
> >>> was decades back, the Doctor with the curly hair. But that was a long
> >>> time ago. It seems like Doctor Who has gone mainstream in more recent
> >>> times, and has appeared on more commercial channels.
> >>
> >> I first watched it when Tom Baker(curly hair, long scarf) was the
> >> Doctor, then later earlier and later incarnations, always on Minnesota
> >> PBS back then. I've been dependent on PBS for BBC series for years.
> >>
> >It was Tom Baker I was thinking of, he's the only Doctor Who that comes to
> >mind. I was going to say "and a scarf" but I wsan't sure if that was
> >specific to his Doctor Who or if they all had scarves.
>
> Yeah, like there's another one who wears a scarf?
>
> I haven't seen Doctor Who on PBS in scores.

One wore celery. Wasn't that Peter Davison?

--
Erilar, biblioholic medievalist


Ubiquitous

11/5/2013 11:16:00 PM

0

drache@chibardun.net.invalid wrote:
> Ubiquitous <weberm@polaris.net> wrote:
>> et472@ncf.ca wrote:
>> >On Mon, 4 Nov 2013, erilar wrote:
>> >> Michael Black <et472@ncf.ca> wrote:
>> >>> On Sun, 3 Nov 2013, Ubiquitous wrote:
>> >>>> drache@chibardun.net.invalid wrote:
>> >>>>> Ubiquitous <weberm@polaris.net> wrote:

>> >>>>>> What did you watch?
>> >>>>>
>> >>>>> Dr Who on PBS; there was an episode I hadn't seen, and next week they
>> >>>>> start the next season, which I believe is the last with Matt Smith.
>> >>>>
>> >>>> PBS? I did not know they aired Doctor Who.
>> >>>>
>> >>> I wondered too. The Vermont PBS station used to air Doctor Who, but that
>> >>> was decades back, the Doctor with the curly hair. But that was a long
>> >>> time ago. It seems like Doctor Who has gone mainstream in more recent
>> >>> times, and has appeared on more commercial channels.
>> >>
>> >> I first watched it when Tom Baker(curly hair, long scarf) was the
>> >> Doctor, then later earlier and later incarnations, always on Minnesota
>> >> PBS back then. I've been dependent on PBS for BBC series for years.
>> >>
>> >It was Tom Baker I was thinking of, he's the only Doctor Who that comes to
>> >mind. I was going to say "and a scarf" but I wsan't sure if that was
>> >specific to his Doctor Who or if they all had scarves.
>>
>> Yeah, like there's another one who wears a scarf?
>>
>> I haven't seen Doctor Who on PBS in scores.
>
>One wore celery. Wasn't that Peter Davison?

Yes.

--
Q: Why is ObamaCare like a turd?
A: You have to pass it to see what's in it.

David Barnett

11/6/2013 4:59:00 AM

0

In article <alpine.LNX.2.02.1311041729340.28461
@darkstar.example.org>, et472@ncf.ca says...
>
> On Mon, 4 Nov 2013, erilar wrote:
>
> > In article <alpine.LNX.2.02.1311031542481.26090@darkstar.example.org>,
> > Michael Black <et472@ncf.ca> wrote:
> >
> >> On Sun, 3 Nov 2013, Ubiquitous wrote:
> >>
> >>> drache@chibardun.net.invalid wrote:
> >>>> Ubiquitous <weberm@polaris.net> wrote:
> >>>
> >>>>> What did you watch?
> >>>>
> >>>> Dr Who on PBS; there was an episode I hadn't seen, and next week they
> >>>> start the next season, which I believe is the last with Matt Smith.
> >>>
> >>> PBS? I did not know they aired Doctor Who.
> >>>
> >> I wondered too. The Vermont PBS station used to air Doctor Who, but that
> >> was decades back, the Doctor with the curly hair. But that was a long
> >> time ago. It seems like Doctor Who has gone mainstream in more recent
> >> times, and has appeared on more commercial channels.
> >
> > I first watched it when Tom Baker(curly hair, long scarf) was the
> > Doctor, then later earlier and later incarnations, always on Minnesota
> > PBS back then. I've been dependent on PBS for BBC series for years.
> >
> It was Tom Baker I was thinking of, he's the only Doctor Who that comes to
> mind. I was going to say "and a scarf" but I wsan't sure if that was
> specific to his Doctor Who or if they all had scarves.
>
> Michael

My late wife knitted me Dr Who scarves, which were a
comfort in a cold London.

--
David Barnett