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

[FEATURE] Speeding up JSON and pickle: to_dict() method #76

Open
Marco-Sulla opened this issue Feb 25, 2023 · 0 comments
Open

[FEATURE] Speeding up JSON and pickle: to_dict() method #76

Marco-Sulla opened this issue Feb 25, 2023 · 0 comments
Labels
Effort: Medium How to waste a beautiful weekend Needs: Doc Improvements or additions to documentation Needs: Test Hey, it compiles! Ship it! Priority: High A blocking bug or an important feature Type: Enhancement New feature or request

Comments

@Marco-Sulla
Copy link
Owner

Marco-Sulla commented Feb 25, 2023

Currently, if you want to serialize a frozendict to JSON, you have to convert it to dict, even if frozendict is a Mapping. This is a limitation of json builtin and third party modules.

To mitigate speed problems, a to_dict() method can be added. It will return a memcopy of frozendict into a new dict object. It should be much faster than dict(a_frozendict).

This new method should also speed up pickle.dumps(). Since frozendict can be really useful in multiprocessing, this could be a nice bonus.

@Marco-Sulla Marco-Sulla added Needs: Doc Improvements or additions to documentation Type: Enhancement New feature or request Priority: High A blocking bug or an important feature Effort: Medium How to waste a beautiful weekend Needs: Test Hey, it compiles! Ship it! labels Feb 25, 2023
@Marco-Sulla Marco-Sulla changed the title [FEATURE] Speeding up JSON: to_dict() method [FEATURE] Speeding up JSON and pickle: to_dict() method Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort: Medium How to waste a beautiful weekend Needs: Doc Improvements or additions to documentation Needs: Test Hey, it compiles! Ship it! Priority: High A blocking bug or an important feature Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant