perf: faster gzip compression (#33014)
Same as https://github.com/frappe/press/pull/2400
This commit is contained in:
parent
4fbdaf3a9b
commit
02d72d2bbb
2 changed files with 2 additions and 2 deletions
|
|
@ -242,7 +242,7 @@ def create_json_gz_file(data, dt, dn, report_name):
|
|||
frappe.scrub(report_name), frappe.utils.data.format_datetime(frappe.utils.now(), "Y-m-d-H-M")
|
||||
)
|
||||
encoded_content = frappe.safe_encode(frappe.as_json(data, indent=None, separators=(",", ":")))
|
||||
compressed_content = gzip.compress(encoded_content)
|
||||
compressed_content = gzip.compress(encoded_content, compresslevel=5)
|
||||
|
||||
# Call save() file function to upload and attach the file
|
||||
_file = frappe.get_doc(
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ def read_multi_pdf(output) -> bytes:
|
|||
|
||||
|
||||
@deprecated("frappe.gzip_compress", "unknown", "v17", "Use py3 methods directly (this was compat for py2).")
|
||||
def gzip_compress(data, compresslevel=9):
|
||||
def gzip_compress(data, compresslevel=5):
|
||||
"""Compress data in one shot and return the compressed string.
|
||||
Optional argument is the compression level, in range of 0-9.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue