[issue17441] Do not cache re.compile

2021-02-23 Thread abcdenis


abcdenis  added the comment:

JFYI.
regex library now supports avoiding cache:

https://bitbucket.org/mrabarnett/mrab-regex/issues/387/compilaton-flag-to-avoid-storing-compiled#comment-59117125

--
nosy: +abcdenis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2017-03-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2017-03-07 Thread Matthew Barnett

Matthew Barnett added the comment:

If we were doing it today, maybe we wouldn't cache them, but, as you say, it's 
been like that for a long time. (The regex module also caches them, because the 
re module does.) Unless someone can demonstrate that it's a problem, I'd say 
just leave it as it is.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2017-03-07 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Can this be closed.  Caching of regexes has been around for a very long time 
and I expect that a lot of code depends on it.  This should not be washed away 
without considerable discussion.

--
nosy: +rhettinger
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2017-03-07 Thread Guido van Rossum

Changes by Guido van Rossum :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2017-03-07 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2017-03-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-10-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 So what is a decision?

Is there a clear performance benefit in removing the caching?

If the problem is cache pollution perhaps re.compile can get a separate cache 
:-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-10-28 Thread Christian Heimes

Christian Heimes added the comment:

I don't like the idea that you want to remove a feature without a deprecation 
period.

--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm surprised, but perhaps performance benefit actually exists (check this on 
other computers).

### regex_effbot ###
Min: 0.333525 - 0.325349: 1.03x faster
Avg: 0.342451 - 0.331665: 1.03x faster
Significant (t=12.13)
Stddev: 0.00606 - 0.00651: 1.0738x larger

However the main benefit is that non-cached constructor (re.compile is a 
constructor of regular expression object) is expected to be non-cached, while 
other module level functions can be cached. See for example struct.Struct. We 
can cache non-cached constructor explicitly (as in fnmatch), but when a 
constructor already cached, adding new cache can only add overhead.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-10-28 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

So what is a decision?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-03-24 Thread Charles-François Natali

Charles-François Natali added the comment:

 The docs don't even mention that re.compile() actually uses a cache.

Actually it does:

re.compile(pattern, flags=0)

Note The compiled versions of the most recent patterns passed to re.match(), 
re.search() or re.compile() are cached, so programs that use only a few regular 
expressions at a time needn’t worry about compiling regular expressions.


Now, I agree that it's definitely suboptimal...

--
nosy: +neologix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-03-24 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +flox

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-03-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think we could happily call such code buggy or at least suboptimal. The docs 
don't even mention that re.compile() actually uses a cache.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-03-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Ezio proposed in issue16389 to not cache re.compile. Caching of re.compile has 
no sense and only pollutes the cache.

--
components: Library (Lib), Regular Expressions
messages: 184354
nosy: ezio.melotti, mrabarnett, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Do not cache re.compile
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-03-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file29429/re_compile_nocache.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17441] Do not cache re.compile

2013-03-16 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm not sure I agree. I've seen plenty of code that called re.compile() over 
and over again -- or called it with a computed string that would have only a 
small number of possible values.

--
nosy: +gvanrossum

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com