Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'url:pypi': 0.03; 'discovery.': 0.09; 'extension.': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'report,': 0.09; 'bug': 0.10; 'cc:addr:python-list': 0.10; 'python': 0.11; '>to': 0.16; 'fnmatch': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message- id:@fido.openend.se': 0.16; 'received:89.233': 0.16; 'received:89.233.217': 0.16; 'received:89.233.217.133': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'regex,': 0.16; 'slow,': 0.16; 'two.': 0.16; 'laura': 0.18; 'python?': 0.18; 'shell': 0.18; '(or': 0.21; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'cc:no real name:2**0': 0.23; '2015': 0.23; 'matching': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; 'wondering': 0.25; 'linux': 0.26; '+0200,': 0.27; "doesn't": 0.28; 'regular': 0.29; 'fast.': 0.29; 'received:se': 0.29; 'themselves': 0.29; 'that.': 0.30; 'code': 0.31; 'point': 0.33; 'url:python': 0.33; 'surprised': 0.33; 'utility': 0.33; 'could': 0.35; 'something': 0.35; 'but': 0.36; 'too': 0.36; 'url:org': 0.36; 'faster': 0.36; 'modules': 0.36; 'subject:: ': 0.37; "won't": 0.38; 'version': 0.38; 'mean': 0.38; 'build': 0.40; 'sure': 0.40; 'reached': 0.60; 'your': 0.60; 'claim': 0.61; 'fun': 0.61; 'grab': 0.61; 'header :Message-Id:1': 0.62; 'more.': 0.62; 'here:': 0.62; 'more': 0.62; 'here': 0.66; 'results': 0.66; '8bit%:40': 0.66; 'beat': 0.66; 'matthew': 0.66; 'everybody': 0.67; 'boost': 0.67; 'skip:\xe2 10': 0.70; 'received:89': 0.80; 'gain': 0.81; 'cecil': 0.84; 'find.': 0.84; 'westerhof': 0.84; 'have.': 0.93 To: Cecil Westerhof cc: python-list@python.org From: Laura Creighton Subject: Re: Find in ipython3 In-Reply-To: Message from Cecil Westerhof of "Sun, 07 Jun 2015 08:20:46 +0200." <87sia4ox8h.fsf@Equus.decebal.nl> References: <87y4k2hyvf.fsf@Equus.decebal.nl> <87bnguhbec.fsf@Equus.decebal.nl> <874mmlqhul.fsf@Equus.decebal.nl> <87sia4ox8h.fsf@Equus.decebal.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <31294.1433669623.1@fido> Content-Transfer-Encoding: 8bit Date: Sun, 07 Jun 2015 11:33:43 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [89.233.217.130]); Sun, 07 Jun 2015 11:33:45 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433669632 news.xs4all.nl 2898 [2001:888:2000:d::a6]:59749 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92218 In a message of Sun, 07 Jun 2015 08:20:46 +0200, Cecil Westerhof writes: >> You may get faster results if you use Matthew Barnett's replacement >> for re here: https://pypi.python.org/pypi/regex >> >> You will get faster results if you build your IPython shell to use >> PyPy, but I would still be very surprised if it beat the C program >> find. > >I have to look into that. But I prefer to write a version that can be >used by ‘everyone’. Well, everybody can download Matthew Barnett's regex, and get pypy, and the claim is that ipython just works with pypy, and if it ever doesn't the ipython team wants a bug report, so I am not sure what you mean by 'used by "everyone"' here that these don't have. >There is no gain to get in standard Python? By switching from fnmatch >to re I got almost a speed gain of two. So I was wondering if I could >do more. That's because speeding up regular expression matching is something that people have put a significant amount of effort in, but under the hood, so to speak. Other modules are likely to be slower, as people haven't gone to so much effort to make them fast. You have reached the point where, if your python code is too slow, and you don't want to use PyPy, people go grab Cython (or Boost or Swig, but Cython is a whole lot easier and more fun to use) and make themselves a C extension. Which you can, of course, do as part of your voyage of discovery. But I am still betting that it won't perform as well as the linux utility find. :) Laura