Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add orjson #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions electrumx/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@
import rapidjson as json
except ImportError:
try:
import ujson as json
import orjson as json
except ImportError:
import json
try:
import ujson as json
except ImportError:
import json

print("using", json.__name__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this print statement for now? It should eventually be a logger.debug from one of the modules responsible for environment on startup.


json_deserialize = json.loads
json_serialize = json.dumps
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'rapidjson': ['python-rapidjson>=0.4.1,<1.0.0'],
'rocksdb': ['python-rocksdb>=0.6.9'],
'ujson': ['ujson>=2.0.0,<4.0.0'],
'orjson': ['orjson>=3.2.2'],
'uvloop': ['uvloop>=0.14'],
# For various coins
'blake256': ['blake256>=0.1.1'],
Expand Down