Sublime Forum

Sublime Text 3 ujson dependency

#1

Hi guys,

I’ve made an experiment which compares the performance of json/ujson/copy.deepcopy when it comes to clone dictionaries. It seems deepcopy is quite slow when dealing with small dictionaries and ujson will give you much better results, not so much when you’re dealing with large dictionaries, in that case deepcopy performs quite alright.

Today I’ve tried building that ujson library with python3.3.5 on windows and after fixing some little issues it seems the wheel can be create ok on python3.3.5 (ABI compatible with ST3 py3.3.6), haven’t tried to build it on unix though.

It’d be great if this ujson library was added as a SublimeText dependency, that way the whole ecosystem of ST plugins relying on deepcopy/json could decide to use ujson instead and that way receiving a little performance boost just for free.

0 Likes

#3

so add it then :slight_smile:
https://packagecontrol.io/docs/dependencies

1 Like

#4

Well :slight_smile: …this was more like an “Ideas and Feature request” thread rather than a “I’m providing feature X by myself” thread.

Anyway, If someone already with experience adding ST deps who finds the idea interesting and is willing to create the repo somewhere but for some reason won’t be able to provide the windows binaries (ie: not having access to windows with the proper toolchain), just le me know… I won’t mind to spend some time creating the wheels or just the last ujson x64/x86 shared libraries and then making the PR. If I’m not mistaken, it seems to use this library you just need a single shared library.

In the meantime I’ll just continue using it as an alternative to deepcopy/json, it’s a wonderful library when it comes to clone several thousands of small json-serializable python datatypes (~<80kb on my pc) per second, in that case you’ll get a performance boost which can make the difference. If you intend to clone big json-serializable objects though, deepcopy is not as slow as some misleading internet threads out there claim it to be.

0 Likes