Add timing for other app._compile events
This commit is contained in:
parent
8e3962426e
commit
f8eba338e0
@ -999,6 +999,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
should_compile = self._should_compile()
|
should_compile = self._should_compile()
|
||||||
|
|
||||||
if not should_compile:
|
if not should_compile:
|
||||||
|
with console.timing("Evaluate Pages (Backend)"):
|
||||||
for route in self._unevaluated_pages:
|
for route in self._unevaluated_pages:
|
||||||
console.debug(f"Evaluating page: {route}")
|
console.debug(f"Evaluating page: {route}")
|
||||||
self._compile_page(route, save_page=should_compile)
|
self._compile_page(route, save_page=should_compile)
|
||||||
@ -1027,6 +1028,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
+ adhoc_steps_without_executor,
|
+ adhoc_steps_without_executor,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with console.timing("Evaluate Pages (Frontend)"):
|
||||||
for route in self._unevaluated_pages:
|
for route in self._unevaluated_pages:
|
||||||
console.debug(f"Evaluating page: {route}")
|
console.debug(f"Evaluating page: {route}")
|
||||||
self._compile_page(route, save_page=should_compile)
|
self._compile_page(route, save_page=should_compile)
|
||||||
@ -1065,12 +1067,12 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
custom_components |= component._get_all_custom_components()
|
custom_components |= component._get_all_custom_components()
|
||||||
|
|
||||||
# Perform auto-memoization of stateful components.
|
# Perform auto-memoization of stateful components.
|
||||||
|
with console.timing("Auto-memoize StatefulComponents"):
|
||||||
(
|
(
|
||||||
stateful_components_path,
|
stateful_components_path,
|
||||||
stateful_components_code,
|
stateful_components_code,
|
||||||
page_components,
|
page_components,
|
||||||
) = compiler.compile_stateful_components(self._pages.values())
|
) = compiler.compile_stateful_components(self._pages.values())
|
||||||
|
|
||||||
progress.advance(task)
|
progress.advance(task)
|
||||||
|
|
||||||
# Catch "static" apps (that do not define a rx.State subclass) which are trying to access rx.State.
|
# Catch "static" apps (that do not define a rx.State subclass) which are trying to access rx.State.
|
||||||
@ -1154,6 +1156,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
_submit_work(compiler.remove_tailwind_from_postcss)
|
_submit_work(compiler.remove_tailwind_from_postcss)
|
||||||
|
|
||||||
# Wait for all compilation tasks to complete.
|
# Wait for all compilation tasks to complete.
|
||||||
|
with console.timing("Compile to Javascript"):
|
||||||
for future in concurrent.futures.as_completed(result_futures):
|
for future in concurrent.futures.as_completed(result_futures):
|
||||||
compile_results.append(future.result())
|
compile_results.append(future.result())
|
||||||
progress.advance(task)
|
progress.advance(task)
|
||||||
@ -1191,6 +1194,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
progress.stop()
|
progress.stop()
|
||||||
|
|
||||||
# Install frontend packages.
|
# Install frontend packages.
|
||||||
|
with console.timing("Install Frontend Packages"):
|
||||||
self._get_frontend_packages(all_imports)
|
self._get_frontend_packages(all_imports)
|
||||||
|
|
||||||
# Setup the next.config.js
|
# Setup the next.config.js
|
||||||
@ -1217,6 +1221,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
# Remove pages that are no longer in the app.
|
# Remove pages that are no longer in the app.
|
||||||
p.unlink()
|
p.unlink()
|
||||||
|
|
||||||
|
with console.timing("Write to Disk"):
|
||||||
for output_path, code in compile_results:
|
for output_path, code in compile_results:
|
||||||
compiler_utils.write_page(output_path, code)
|
compiler_utils.write_page(output_path, code)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user