Skip to content

Commit 7387bc7

Browse files
authored
docs: add performance check for search (#30)
1 parent 13f76a3 commit 7387bc7

File tree

3 files changed

+83
-14
lines changed

3 files changed

+83
-14
lines changed

docs/example.ipynb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,49 @@
144144
" format=\"parquet[snappy]\",\n",
145145
")"
146146
]
147+
},
148+
{
149+
"cell_type": "markdown",
150+
"metadata": {},
151+
"source": [
152+
"## Search performance\n",
153+
"\n",
154+
"Here's a performance comparison when searching with **stacrs** versus [pystac-client](https://pystac-client.readthedocs.io/)."
155+
]
156+
},
157+
{
158+
"cell_type": "code",
159+
"execution_count": 3,
160+
"metadata": {},
161+
"outputs": [
162+
{
163+
"name": "stdout",
164+
"output_type": "stream",
165+
"text": [
166+
"pystac-client: 7.5231709480285645s (467 items)\n",
167+
"stacrs: 7.2893760204315186s (467 items)\n"
168+
]
169+
}
170+
],
171+
"source": [
172+
"import time\n",
173+
"from pystac_client import Client\n",
174+
"import stacrs\n",
175+
"\n",
176+
"client = Client.open(\"https://stac.eoapi.dev\")\n",
177+
"start = time.time()\n",
178+
"item_search = client.search(collections=[\"WildFires-LosAngeles-Jan-2025\"])\n",
179+
"items = list(item_search.items_as_dicts())\n",
180+
"end = time.time()\n",
181+
"print(f\"pystac-client: {end - start}s ({len(items)} items)\")\n",
182+
"\n",
183+
"start = time.time()\n",
184+
"items = await stacrs.search(\n",
185+
" \"https://stac.eoapi.dev\", collections=[\"WildFires-LosAngeles-Jan-2025\"]\n",
186+
")\n",
187+
"end = time.time()\n",
188+
"print(f\"stacrs: {end - start}s ({len(items)} items)\")"
189+
]
147190
}
148191
],
149192
"metadata": {

pyproject.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ ignore_missing_imports = true
3737
asyncio_mode = "auto"
3838
asyncio_default_fixture_loop_scope = "function"
3939

40-
[tool.uv]
41-
dev-dependencies = [
40+
[dependency-groups]
41+
dev = [
4242
"maturin>=1.7.4",
43-
"mike>=2.1.3",
44-
"mkdocs-jupyter>=0.25.1",
45-
"mkdocs-material[imaging]>=9.5.45",
46-
"mkdocstrings[python]>=0.27.0",
4743
"mypy>=1.11.2",
4844
"pyarrow>=18.0.0",
4945
"pystac[validation]>=1.11.0",
@@ -52,6 +48,16 @@ dev-dependencies = [
5248
"ruff>=0.6.9",
5349
"stac-geoparquet>=0.6.0",
5450
]
51+
docs = [
52+
"mike>=2.1.3",
53+
"mkdocs-jupyter>=0.25.1",
54+
"mkdocs-material[imaging]>=9.5.45",
55+
"mkdocstrings[python]>=0.27.0",
56+
"pystac-client>=0.8.5",
57+
]
58+
59+
[tool.uv]
60+
default-groups = ["dev", "docs"]
5561

5662
[build-system]
5763
requires = ["maturin>=1.7,<2.0"]

uv.lock

Lines changed: 28 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)