{"id":459250,"date":"2025-05-12T03:25:53","date_gmt":"2025-05-12T03:25:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=459250"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=459250","title":{"rendered":"<span>\u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u0430\u043f Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u043a\u043e\u0440\u043e\u0442\u043a\u043e<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c<strong> <\/strong>\u043a\u0430\u043a \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u0430\u043f Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0425\u043e\u043b\u043e\u0434\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 \u2014 \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u044b\u0435 \u043f\u043e\u0442\u0435\u0440\u0438: \u0432 \u0434\u0435\u043d\u044c\u0433\u0430\u0445, \u0432 SEO, \u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. Serverless \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, edge-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0435 \u0436\u0434\u0451\u0442, \u0430 \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 \u043d\u0435\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u044a\u0435\u0434\u0430\u044e\u0442 \u043f\u043e\u043b\u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0411\u0443\u0434\u0435\u043c \u044d\u0442\u043e \u0447\u0438\u043d\u0438\u0442\u044c.  <\/p>\n<h2>\u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0437\u043b\u0435\u0442\u0430\u043b\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438\u0437 \u0437\u043e\u043d\u044b \u0441\u0442\u0430\u0440\u0442\u0430.<\/p>\n<h4>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0440\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b<\/h4>\n<pre><code class=\"bash\">python -X importtime -m myapp 2&gt; import.log python -m snakeviz import.log<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0431\u044b\u0432\u0430\u0435\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0440\u0430\u0437\u043d\u043e\u0441:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041c\u043e\u0434\u0443\u043b\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0418\u043c\u043f\u043e\u0440\u0442 \u0437\u0430, \u043c\u0441<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">pandas<\/p>\n<\/td>\n<td>\n<p align=\"left\">320<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">numpy<\/p>\n<\/td>\n<td>\n<p align=\"left\">180<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">scipy<\/p>\n<\/td>\n<td>\n<p align=\"left\">540<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0414\u0435\u043b\u0430\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e<\/h4>\n<pre><code class=\"python\">def enrich(df_like):     import pandas as pd  # noqa     df = pd.DataFrame(df_like)     df[\"ts\"] = pd.Timestamp.utcnow()     return df.to_dict(orient=\"records\")<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 pandas \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong>, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<h4>\u0415\u0441\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043d\u0443\u0436\u0435\u043d \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c LazyLoader<\/h4>\n<pre><code class=\"python\">import importlib, sys  _spec   = importlib.util.find_spec(\"tensorflow\") _loader = importlib.util.LazyLoader(_spec.loader) module  = importlib.util.module_from_spec(_spec) _loader.exec_module(module) sys.modules[\"tensorflow\"] = module<\/code><\/pre>\n<h4>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u043b\u0451\u0433\u043a\u0438\u0439 entrypoint<\/h4>\n<pre><code class=\"python\"># main.py def run():     from myapp.server import app     app.run()  if __name__ == \"__main__\":     run()<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b\u0438\u043a main.py \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0437\u0430 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0442\u044f\u043d\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043a\u0443\u0447\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0441\u0440\u0430\u0437\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0448\u0430\u0433 \u2014 \u043f\u0440\u043e\u0433\u0440\u0435\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435<\/h2>\n<p>\u0423\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u043e\u0440\u043c\u043e\u0437\u0430 \u0443\u0436\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c provisioned concurrency<\/h4>\n<p>\u041d\u0430 AWS Lambda \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0435\u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u041f\u043b\u0430\u0442\u0438\u0448\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0437\u0430\u0442\u043e \u0441\u0442\u0430\u0440\u0442\u0430 0 \u043c\u0441.<\/p>\n<h4>\u0421\u0442\u0440\u043e\u0438\u043c slim-\u043e\u0431\u0440\u0430\u0437\u044b<\/h4>\n<pre><code class=\"bash\">FROM python:3.12-slim-bookworm as builder RUN pip install poetry WORKDIR \/src COPY pyproject.toml poetry.lock .\/ RUN poetry install --no-dev  FROM python:3.12-slim-bookworm COPY --from=builder \/usr\/local \/usr\/local COPY .\/app \/app CMD [\"gunicorn\", \"-k\", \"uvicorn.workers.UvicornWorker\", \"myapp.api:app\"]<\/code><\/pre>\n<p>Slim-\u043e\u0431\u0440\u0430\u0437 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u2248 120 \u041c\u0411 \u043f\u0440\u043e\u0442\u0438\u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 800 \u041c\u0411 \u2014 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0451\u0432 \u0438 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u0435\u0442\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u044b.<\/p>\n<h4>\u0423\u0431\u0438\u0440\u0430\u0435\u043c pip install \u0438\u0437 \u0441\u0442\u0430\u0440\u0442\u0430<\/h4>\n<pre><code class=\"bash\">poetry export -f requirements.txt &gt; requirements.txt pip wheel -r requirements.txt -w vendor pip install --no-index --find-links=vendor -r requirements.txt <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 \u2014 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 fat wheel.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u043a\u043e\u0440\u0438\u043c \u0441\u0430\u043c\u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043a\u043e\u0434\u0435. <\/p>\n<h2>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f hotspot-\u043e\u0432 + \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0421\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0443\u0436\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b, \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0451\u0433\u043a\u043e\u0435 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0442\u044f\u0436\u0451\u043b\u044b\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043a\u044d\u0448\u0430\u043c\u0438.<\/p>\n<h4>\u0412\u044b\u043d\u043e\u0441\u0438\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 Cython<\/h4>\n<pre><code class=\"python\"># fastmath.pyx cimport cython  @cython.cfunc def norm(double[:] v):     cdef double s = 0     for i in range(v.shape[0]):         s += v[i] * v[i]     return s ** 0.5<\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">python setup.py build_ext --inplace<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 <code>.so<\/code> \u043c\u043e\u0434\u0443\u043b\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 &lt; 1 \u043c\u0441.<\/p>\n<h4>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 PEP 684<\/h4>\n<pre><code class=\"python\">import interpreters, asyncio, json, gzip  CACHE = {}  def load_big_cache(path):     with gzip.open(path, \"rb\") as f:         CACHE.update(json.load(f))  async def bootstrap():     interp = interpreters.create()     interpreters.run_async(interp, load_big_cache, \"\/data\/cache.json.gz\")     from myapp import app     return app  app = asyncio.run(bootstrap())<\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043a\u044d\u0448 \u0433\u0440\u0435\u0435\u0442\u0441\u044f \u0432 \u0444\u043e\u043d\u0435, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<h3>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043d\u0444\u0438\u0433<\/p>\n<\/th>\n<th>\n<p align=\"left\">p95 cold, \u043c\u0441<\/p>\n<\/th>\n<th>\n<p align=\"left\">p95 warm, \u043c\u0441<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 + \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\">920<\/p>\n<\/td>\n<td>\n<p align=\"left\">24<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">+ Slim + Lazy imports<\/p>\n<\/td>\n<td>\n<p align=\"left\">620<\/p>\n<\/td>\n<td>\n<p align=\"left\">23<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">+ Fat wheel<\/p>\n<\/td>\n<td>\n<p align=\"left\">410<\/p>\n<\/td>\n<td>\n<p align=\"left\">22<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">+ Cython + PEP 684<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>310<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">22<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c slim-\u043e\u0431\u0440\u0430\u0437\u044b \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0443\u0437\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: cold start \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 2\u20133 \u0440\u0430\u0437\u0430 \u0431\u0435\u0437 \u0443\u0449\u0435\u0440\u0431\u0430 \u043a\u043e\u0434\u0443 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438.  <\/p>\n<hr\/>\n<p><em>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u044b \u043a\u0443\u0440\u0441\u0430\u00a0<\/em><a href=\"https:\/\/otus.pw\/JawA\/\"><em>Python Developer. Professional<\/em><\/a><em>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435:<\/em><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/otus.pw\/o3Mx\/\"><strong>Python \u0438 Web Scraping: \u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/strong><\/a><strong> <\/strong><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/otus.pw\/17OJ\/\"><strong>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 Python: \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/strong><\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905650\/\"> https:\/\/habr.com\/ru\/articles\/905650\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c<strong> <\/strong>\u043a\u0430\u043a \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u0430\u043f Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0425\u043e\u043b\u043e\u0434\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 \u2014 \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u044b\u0435 \u043f\u043e\u0442\u0435\u0440\u0438: \u0432 \u0434\u0435\u043d\u044c\u0433\u0430\u0445, \u0432 SEO, \u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. Serverless \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, edge-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0435 \u0436\u0434\u0451\u0442, \u0430 \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 \u043d\u0435\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u044a\u0435\u0434\u0430\u044e\u0442 \u043f\u043e\u043b\u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0411\u0443\u0434\u0435\u043c \u044d\u0442\u043e \u0447\u0438\u043d\u0438\u0442\u044c.  <\/p>\n<h2>\u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0437\u043b\u0435\u0442\u0430\u043b\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438\u0437 \u0437\u043e\u043d\u044b \u0441\u0442\u0430\u0440\u0442\u0430.<\/p>\n<h4>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0440\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b<\/h4>\n<pre><code class=\"bash\">python -X importtime -m myapp 2&gt; import.log python -m snakeviz import.log<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0431\u044b\u0432\u0430\u0435\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0440\u0430\u0437\u043d\u043e\u0441:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041c\u043e\u0434\u0443\u043b\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0418\u043c\u043f\u043e\u0440\u0442 \u0437\u0430, \u043c\u0441<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">pandas<\/p>\n<\/td>\n<td>\n<p align=\"left\">320<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">numpy<\/p>\n<\/td>\n<td>\n<p align=\"left\">180<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">scipy<\/p>\n<\/td>\n<td>\n<p align=\"left\">540<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0414\u0435\u043b\u0430\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e<\/h4>\n<pre><code class=\"python\">def enrich(df_like):     import pandas as pd  # noqa     df = pd.DataFrame(df_like)     df[\"ts\"] = pd.Timestamp.utcnow()     return df.to_dict(orient=\"records\")<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 pandas \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong>, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<h4>\u0415\u0441\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043d\u0443\u0436\u0435\u043d \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c LazyLoader<\/h4>\n<pre><code class=\"python\">import importlib, sys  _spec   = importlib.util.find_spec(\"tensorflow\") _loader = importlib.util.LazyLoader(_spec.loader) module  = importlib.util.module_from_spec(_spec) _loader.exec_module(module) sys.modules[\"tensorflow\"] = module<\/code><\/pre>\n<h4>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u043b\u0451\u0433\u043a\u0438\u0439 entrypoint<\/h4>\n<pre><code class=\"python\"># main.py def run():     from myapp.server import app     app.run()  if __name__ == \"__main__\":     run()<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b\u0438\u043a main.py \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0437\u0430 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0442\u044f\u043d\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043a\u0443\u0447\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0441\u0440\u0430\u0437\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0448\u0430\u0433 \u2014 \u043f\u0440\u043e\u0433\u0440\u0435\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435<\/h2>\n<p>\u0423\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u043e\u0440\u043c\u043e\u0437\u0430 \u0443\u0436\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c provisioned concurrency<\/h4>\n<p>\u041d\u0430 AWS Lambda \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0435\u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u041f\u043b\u0430\u0442\u0438\u0448\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0437\u0430\u0442\u043e \u0441\u0442\u0430\u0440\u0442\u0430 0 \u043c\u0441.<\/p>\n<h4>\u0421\u0442\u0440\u043e\u0438\u043c slim-\u043e\u0431\u0440\u0430\u0437\u044b<\/h4>\n<pre><code class=\"bash\">FROM python:3.12-slim-bookworm as builder RUN pip install poetry WORKDIR \/src COPY pyproject.toml poetry.lock .\/ RUN poetry install --no-dev  FROM python:3.12-slim-bookworm COPY --from=builder \/usr\/local \/usr\/local COPY .\/app \/app CMD [\"gunicorn\", \"-k\", \"uvicorn.workers.UvicornWorker\", \"myapp.api:app\"]<\/code><\/pre>\n<p>Slim-\u043e\u0431\u0440\u0430\u0437 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u2248 120 \u041c\u0411 \u043f\u0440\u043e\u0442\u0438\u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 800 \u041c\u0411 \u2014 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0451\u0432 \u0438 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u0435\u0442\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u044b.<\/p>\n<h4>\u0423\u0431\u0438\u0440\u0430\u0435\u043c pip install \u0438\u0437 \u0441\u0442\u0430\u0440\u0442\u0430<\/h4>\n<pre><code class=\"bash\">poetry export -f requirements.txt &gt; requirements.txt pip wheel -r requirements.txt -w vendor pip install --no-index --find-links=vendor -r requirements.txt <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 \u2014 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 fat wheel.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u043a\u043e\u0440\u0438\u043c \u0441\u0430\u043c\u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043a\u043e\u0434\u0435. <\/p>\n<h2>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f hotspot-\u043e\u0432 + \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0421\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0443\u0436\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b, \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0451\u0433\u043a\u043e\u0435 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0442\u044f\u0436\u0451\u043b\u044b\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043a\u044d\u0448\u0430\u043c\u0438.<\/p>\n<h4>\u0412\u044b\u043d\u043e\u0441\u0438\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 Cython<\/h4>\n<pre><code class=\"python\"># fastmath.pyx cimport cython  @cython.cfunc def norm(double[:] v):     cdef double s = 0     for i in range(v.shape[0]):         s += v[i] * v[i]     return s ** 0.5<\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">python setup.py build_ext --inplace<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 <code>.so<\/code> \u043c\u043e\u0434\u0443\u043b\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 &lt; 1 \u043c\u0441.<\/p>\n<h4>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 PEP 684<\/h4>\n<pre><code class=\"python\">import interpreters, asyncio, json, gzip  CACHE = {}  def load_big_cache(path):     with gzip.open(path, \"rb\") as f:         CACHE.update(json.load(f))  async def bootstrap():     interp = interpreters.create()     interpreters.run_async(interp, load_big_cache, \"\/data\/cache.json.gz\")     from myapp import app     return app  app = asyncio.run(bootstrap())<\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043a\u044d\u0448 \u0433\u0440\u0435\u0435\u0442\u0441\u044f \u0432 \u0444\u043e\u043d\u0435, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<h3>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043d\u0444\u0438\u0433<\/p>\n<\/th>\n<th>\n<p align=\"left\">p95 cold, \u043c\u0441<\/p>\n<\/th>\n<th>\n<p align=\"left\">p95 warm, \u043c\u0441<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 + \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\">920<\/p>\n<\/td>\n<td>\n<p align=\"left\">24<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">+ Slim + Lazy imports<\/p>\n<\/td>\n<td>\n<p align=\"left\">620<\/p>\n<\/td>\n<td>\n<p align=\"left\">23<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">+ Fat wheel<\/p>\n<\/td>\n<td>\n<p align=\"left\">410<\/p>\n<\/td>\n<td>\n<p align=\"left\">22<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">+ Cython + PEP 684<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>310<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">22<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c slim-\u043e\u0431\u0440\u0430\u0437\u044b \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0443\u0437\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: cold start \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0432 2\u20133 \u0440\u0430\u0437\u0430 \u0431\u0435\u0437 \u0443\u0449\u0435\u0440\u0431\u0430 \u043a\u043e\u0434\u0443 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438.  <\/p>\n<hr\/>\n<p><em>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u044b \u043a\u0443\u0440\u0441\u0430\u00a0<\/em><a href=\"https:\/\/otus.pw\/JawA\/\"><em>Python Developer. Professional<\/em><\/a><em>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435:<\/em><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/otus.pw\/o3Mx\/\"><strong>Python \u0438 Web Scraping: \u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/strong><\/a><strong> <\/strong><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/otus.pw\/17OJ\/\"><strong>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 Python: \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/strong><\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905650\/\"> https:\/\/habr.com\/ru\/articles\/905650\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-459250","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=459250"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459250\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=459250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=459250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=459250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}