import templates beforehands
This commit is contained in:
parent
0ae79b1b18
commit
eb016119a0
@ -4,11 +4,20 @@ from reflex.compiler.compiler import _compile_page, _compile_stateful_components
|
||||
from reflex.components.component import Component
|
||||
|
||||
|
||||
def import_templates():
|
||||
# Importing the templates module to avoid the import time in the benchmark
|
||||
import reflex.compiler.templates # noqa: F401
|
||||
|
||||
|
||||
def test_compile_page(evaluated_page: Component, benchmark: BenchmarkFixture):
|
||||
import_templates()
|
||||
|
||||
benchmark(lambda: _compile_page(evaluated_page, None))
|
||||
|
||||
|
||||
def test_compile_stateful(evaluated_page: Component, benchmark: BenchmarkFixture):
|
||||
import_templates()
|
||||
|
||||
benchmark(lambda: _compile_stateful_components([evaluated_page]))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user