Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18451
| References | <4f02e31c$0$15724$426a74cc@news.free.fr> <mailman.4346.1325591848.27778.python-list@python.org> <4f0315c6$0$10967$426a74cc@news.free.fr> <CABicbJLZvii2Z1e-xUuaNVdJOLGEg33doSJtmTB-S-nH-RtwiQ@mail.gmail.com> <338F7336C21B4801A4DE16740B8CC736@teddy> |
|---|---|
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
| Date | 2012-01-03 15:38 -0500 |
| Subject | Re: Regular expression : non capturing groups are faster ? |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4384.1325623160.27778.python-list@python.org> (permalink) |
> I tested 10 million matches on my computer using capturing groups and it took ~ 6 seconds, but only ~ 2 seconds with non-capturing params.
Are you talking about Python or Perl? I can't reproduce this in
Python. Best I can do is a 3:4 ratio between running times. ('(a)*
versus '(?:a)*)
Also, wouldn't say "very fast". Compare those two groups with 'a*'.
I'm not sure what's going on there.
-- Devin
On Tue, Jan 3, 2012 at 3:07 PM, Octavian Rasnita <orasnita@gmail.com> wrote:
> From: "Devin Jeanpierre" <jeanpierreda@gmail.com>
> Subject: Re: Regular expression : non capturing groups are faster ?
>
>
>>> You meant Perl Documentation, didn't you ?
>>
>> I guess that works too. I did mean Python, though -- its intent is to
>> say "you shouldn't worry about this", but in the process it says "this
>> does not exist" (a lie).
>
>
> **
> However, the Perl documentation doesn't lie.
>
> I tested 10 million matches on my computer using capturing groups and it took ~ 6 seconds, but only ~ 2 seconds with non-capturing params.
>
> So yes, it is very fast anyway, but ~ 3 times faster with non-capturing params, so there is a difference.
>
> Octavian
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Regular expression : non capturing groups are faster ? candide <candide@free.invalid> - 2012-01-03 12:14 +0100
Re: Regular expression : non capturing groups are faster ? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-03 06:56 -0500
Re: Regular expression : non capturing groups are faster ? candide <candide@free.invalid> - 2012-01-03 15:50 +0100
Re: Regular expression : non capturing groups are faster ? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-03 14:31 -0500
Re: Regular expression : non capturing groups are faster ? "Octavian Rasnita" <orasnita@gmail.com> - 2012-01-03 22:07 +0200
Re: Regular expression : non capturing groups are faster ? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-03 15:38 -0500
Re: Regular expression : non capturing groups are faster ? "Octavian Rasnita" <orasnita@gmail.com> - 2012-01-03 13:59 +0200
csiph-web