Skip to content

Drop `HAS_TEX` for faster startup time

Duncan Macleod requested to merge github/fork/francois-rozet/has_tex into main

Created by: francois-rozet

Hello 👋 I have noticed that a significant part of the startup time of gwpy comes from the execution of has_tex to store the result in HAS_TEX, which is never used later on.

In this PR, I deleted HAX_TEX and cached the result of has_tex in case it would be necessary to call it several times. It reduces the startup time by about 2 seconds which could be huge for some applications.

Before

user@host:~ $ time python -c 'from gwpy.timeseries import TimeSeries'
real	0m3,381s
user	0m2,600s
sys	0m2,091s

After

user@host:~ $ time python -c 'from gwpy.timeseries import TimeSeries'
real	0m1,360s
user	0m1,430s
sys	0m1,419s

Merge request reports