perf(import_file): use orjson.loads

This commit is contained in:
Sagar Vora 2025-06-26 17:37:24 +05:30
parent 2e5c8bea03
commit 7660f59c31

View file

@ -1,9 +1,10 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import hashlib
import json
import os
import orjson
import frappe
from frappe.model.base_document import get_controller
from frappe.modules import get_module_path, scrub_dt_dn
@ -173,7 +174,7 @@ def read_doc_from_file(path):
if os.path.exists(path):
with open(path) as f:
try:
doc = json.loads(f.read())
doc = orjson.loads(f.read())
except ValueError:
print(f"bad json: {path}")
raise