Skip to content

Commit

Permalink
perf(*): speed up entry hashing with isal
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Dec 2, 2023
1 parent b31c805 commit 1b9e3e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ cachetools==5.3.2
CJKwrap==2.2
typing-extensions==4.8.0
uvloop==0.19.0; sys_platform!='win32' and sys_platform!='cygwin' and sys_platform!='cli'
isal==1.5.3; platform_machine=='x86_64' or platform_machine=='AMD64' or platform_machine=='aarch64'
6 changes: 5 additions & 1 deletion src/command/inner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
from itertools import chain, repeat
from datetime import datetime
from email.utils import parsedate_to_datetime
from zlib import crc32
from telethon import Button
from telethon.tl.types import KeyboardButtonCallback

try:
from isal.isal_zlib import crc32
except ImportError:
from zlib import crc32

from ... import db, log, env
from ...i18n import i18n

Expand Down

0 comments on commit 1b9e3e4

Please sign in to comment.