Skip to content

Commit

Permalink
logstats: reuse the json decoder to speed things up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Aug 15, 2024
1 parent 5fed4e2 commit e7eb1ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion msys2-logstats
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ def main(argv):
ci_networks = get_ci_networks()

entries: List[LogEntry] = []
decoder = json.JSONDecoder()
with args.infile as h:
for line in h:
if not line.startswith("{"):
continue
decoded = json.loads(line)
decoded = decoder.decode(line)
if "RequestHost" not in decoded or "request_User-Agent" not in decoded:
continue
entry = LogEntry(
Expand Down

0 comments on commit e7eb1ec

Please sign in to comment.