A deep infrastructure library for Python 3.14+ focused on extreme startup time optimization via lazy imports and speculative loading.
Project description
Zenith
Zero-latency boot infrastructure for Python applications.
Zenith is a deep infrastructure engine designed to eliminate startup latency in Python CLI tools, desktop applications, and serverless environments. By leveraging Python 3.14's free-threading capabilities and automated lazy loading, Zenith speculatively pre-loads your heavy dependencies in the background, resulting in near-instant application boot times.
How It Works
Zenith operates transparently beneath Python's import system using two key architectural components:
- MetaPathFinder Interceptor (
ZenithLazyFinder): Implements a low-overhead import hook insys.meta_pathto intercept module import requests. Instead of performing slow, synchronous loading of heavy packages at boot time, it returns custom lazy modules (ZenithLazyModule). - Speculative Pre-loading Engine (
SpeculationEngine): Operates on an isolated background thread utilizing Free-Threading (PEP 703) available in Python 3.14+. It loads heavy modules concurrently without incurring the Global Interpreter Lock (GIL) overhead, resolving dependencies before your main thread even requests them.
Performance Benchmark
The following benchmark demonstrates boot time comparison when loading heavyweight libraries (such as multiprocessing, urllib, sqlite3, and parsed XML structures):
| Environment | Boot Time | Speedup |
|---|---|---|
| Native Python | ~0.15s |
Baseline |
| Zenith (Warm Cache) | ~0.04s |
70% faster |
Installation
Please note that while the package is installed as alenia-zenith, the import statement in your Python code remains zenith.
pip install alenia-zenith
Quick Start
Initialize Zenith at the absolute top of your application's entrypoint before any other imports:
import zenith
zenith.ignite()
# Your heavy imports go here (will be processed lazily & speculatively)
import pandas
import numpy
Configuration
Zenith automatically generates a lightweight, persistent dependency graph file in the root of your project:
.zenith_cache.json: This file records actual module usage during execution. On subsequent boots, theSpeculationEnginereads this cache to proactively queue and pre-load modules on background threads, ensuring instant availability.
License
Distributed under the ALENIA STUDIOS TOOL LICENSE Version 1.0. See LICENSE for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alenia_zenith-0.1.0.tar.gz.
File metadata
- Download URL: alenia_zenith-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
271da278285aaca70acdcdecb06e5a05a5c559963dd6b0b16c1621cacf6a1196
|
|
| MD5 |
7e9647ad4ed18828fccffeacb847ec61
|
|
| BLAKE2b-256 |
339f05ece035d897a5320812f2e1b6b7e60ff663bef2b1211607243cde144f46
|
File details
Details for the file alenia_zenith-0.1.0-py3-none-any.whl.
File metadata
- Download URL: alenia_zenith-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12eb4f960de53f2efdaebf35d628d9caad72d6903cf6ca2dc524d569780ad91d
|
|
| MD5 |
0e18a6f2af7badb9f806c7759f3aca7d
|
|
| BLAKE2b-256 |
662e588a0559bee0e455ef4cfaded97e35ca3f8ef77d7f4951c66bac4a823f10
|