Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

regex re speed

>>> import re, regex
>>> import timeit
>>> p_re = re.compile('(.*)sol(.*)')
>>> p_regex = regex.compile('(.*)sol(.*)')
>>> s = "ciao mandi "*1000 + "sal " + "ciao mandi "*1000
>>> timeit.timeit("p.findall(s)", 'from __main__ import s, p_re as p', number=1)
2.4578459990007104
>>> timeit.timeit("p.findall(s)", 'from __main__ import s, p_regex as p', number=100000)
1.955532732012216
Comment

PREVIOUS NEXT
Code Example
Python :: python read file with class 
Python :: pypi autopep8 
Python :: python code to find duplicate row in sqlite database 
Python :: sensitivity 
Python :: Python NumPy asarray Function Example Tuple to an array 
Python :: Python NumPy ascontiguousarray Function Syntax 
Python :: Python NumPy concatenate Function Example when axis equal to none 
Python :: Python NumPy column_stack Function Example with 2d array 
Python :: percentile of a score python 
Python :: Python NumPy tile Function Example when (repetitions == arr.ndim) == 0 
Python :: midpoint line drawing algorithm 
Python :: Python __ge__ 
Python :: django ejemplo de un formulario crud 
Python :: setstylesheet python 
Python :: scipy kullbach leibler divergence 
Python :: django disable foreign key checks temporary 
Python :: Termfastapi get ip 
Python :: python mysqldb sockets 
Python :: python truncade number 
Python :: server localhost for shar file 
Python :: finding-the-largest-three-digits-number-within-a-number 
Python :: vscode show when variable is protected or private python 
Python :: lmplot color] 
Python :: string exercise 
Python :: python tuple index access 
Python :: check if id is present in elasticsearch using python 
Python :: ring Create Lists 
Python :: ring Load Syntax Files 
Python :: python get message Exception 
Python :: get most recurring element in a list python 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =