Skip to content

Commit

Permalink
perf: pass directly the binary into json (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesL2 authored Nov 8, 2024
1 parent eb1973a commit 5996066
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pretty_gpx/common/data/overpass_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,7 @@ def launch_queries(self) -> None:
with Profiling.Scope("Loading data into JSON"):
content_bytes = response.read()
logger.info(f"Downloaded {convert_bytes(len(content_bytes))}")
encoding = response.info().get_content_charset('utf-8')
content_str = content_bytes.decode(encoding)

logger.info("Loading data")
with Profiling.Scope("Loading response"):
data = ujson.loads(content_str)
data = ujson.loads(content_bytes)

logger.info("Loading overpass data into overpy")
with Profiling.Scope("Loading overpass data into overpy"):
Expand Down

0 comments on commit 5996066

Please sign in to comment.