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

JSON object scripting interface, getting data copy is bottleneck with large JSONs #361

Open
2 tasks done
F3der1co opened this issue Sep 15, 2024 · 1 comment
Open
2 tasks done

Comments

@F3der1co
Copy link

F3der1co commented Sep 15, 2024

Reviewed guidelines

  • I have read and understand the suggestion guidelines

Checked for duplicate suggestions

  • I checked for existing similar suggestions

Summary

the JSON objects scripting interface doesn't allow us any direct access to the json data it holds, we have to get a copy of the data to access it. With large JSON files this creates a large performance bottleneck

Possible workarounds or alternatives

handle the JSON in scripting and expose getters and setter via event sheet return functions. (i.e. don't use the JSON objectType but recreate it)

Proposed solution

A way to directly access it (the Dictionaries scripting interface seems to allow that).
As a worse alternative: getter and setter scripting interface where you can pass in a path.

Why is this idea important?

For projects that use events and scripting together the JSON object is a great way to pass data between the two paradigms.

Additional remarks

It's super weird how the JSON, Dictionary and Array scripting interface follow completely different patterns.

@F3der1co
Copy link
Author

As a proof of the issue here is a Construct project with a 250kb json file, see CPU performance.
jsonBottle.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant