Skip to content

Commit

Permalink
performance: try to use numba jit
Browse files Browse the repository at this point in the history
Maybe this the only place that do pure for loop calculation so that it can be optimize by numba
  • Loading branch information
LaoshuBaby committed Mar 9, 2024
1 parent 57d61d7 commit 872fa6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/yuheng/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def __set_attrib(attrib: Dict[str, str], key: str, value):
if value is not None:
attrib[key] = str(value)

@staticmethod
# @staticmethod

import numba

@numba.jit(force_obj=False, loof_left=False, nopython=False)
def insert_to_dict(spec_dict, element_list):
for i in element_list:
spec_dict[int(i.id)] = i
Expand Down

0 comments on commit 872fa6a

Please sign in to comment.