The !find version is C code optimised to do one thing, find files in
your directory structure, which happens to be what you want to do.
General regular expression matching is harder.

Carl Friedrich Bolz investigated regular expression algorithms and their
implementation to see if this is the sort of task that a JIT can improve.
He blogged about it in 2 posts (part1 and part2).  There are benchmarks
for part2.  Benchmarks in part2.

see:
http://morepypy.blogspot.se/2010/05/efficient-and-elegant-regular.html
http://morepypy.blogspot.se/2010/06/jit-for-regular-expression-matching.html

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.

Laura

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to