Closed walkinrain2008 closed 5 years ago
For me the import is faster than that (0.5s), it takes some time because of constants being defined in pyjsparser/pyjsparser/pyjsparserdata.py. This could be in theory delayed until the parser is actually used.
i test code , import pyjsparserdata.py is slowly in line 224
for c in map(unichr, range(sys.maxunicode + 1)):
U_CATEGORIES[unicodedata.category(c)].append(c)
test code :
print("begin")
ticks = []
import time
tick_s = time.perf_counter()
import pyjsparser.pyjsparserdata
ticks.append(time.perf_counter() - tick_s)
print("import time =",ticks)
result: begin import time = [1.543109415]
i use pyjsparser in my program
import pyjsparser or from pyjsparser import PyJsParser
when program run , it takes as long time to import . about 2 seconds for import 。 env: os: win10 1609 cpu: AMD athlon II x3 450 mem: 6G py : python 3.7 win32