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

ConditionalField performance issue #43

Closed
CarlosPerson opened this issue Oct 31, 2019 · 7 comments
Closed

ConditionalField performance issue #43

CarlosPerson opened this issue Oct 31, 2019 · 7 comments

Comments

@CarlosPerson
Copy link

Super useful repo! Thank you for sharing it 👍

I have been using the ConditionalField attribute and, while very powerful, it is giving me performance issues. Even with the basic "bool" condition mode, if causes significant hiccups on the editor. This happens when when enabling/disabling the target bool OR whenever I interact in any other way with the script.

Is there anything that could be done to fix it, or at least to limit the lag/hiccup to happen only whenever we enable/disable the bool ?

Thanks!

@Deadcows
Copy link
Owner

Deadcows commented Nov 1, 2019

I glad you liked it :)
I didn't spend much time optimizing it, actually. Conditional Field is bulky and slow indeed, I'll see what I can do

@CarlosPerson
Copy link
Author

Awesome! Looking forward for it!

@android272
Copy link

I was just about to open an issue about this. When I add just a few ConditinoalFields Unity drags to a halt. I can bearly work on my project. I thought it had to do with the new Reorderable collections. But I just stripped out the reorderable collections and kept the ConditinoalFields and vice-versa and it is definitely the ConditionalFields the is the problem.

@Deadcows
Copy link
Owner

Deadcows commented Nov 9, 2019

Sorry for this delay guys, I've got too much work on my project recently. Hopefully I'll be able to check this issue next week

@Deadcows
Copy link
Owner

I made a few optimizations in the latest commit

Unfortunately I was unable to reproduce this performance issues so I acted blindly but I changed a lot of stuff to one-time caching so it should help.

Can you please check this out and inform me if it helped or not?

Please update manually

@CarlosPerson
Copy link
Author

It works like a charm! Funny how it was just in time for me, as I was literally creating the PR on my project with the ConditionalFields disabled, as they were unusable.

Thank you!

@android272
Copy link

Yes, that worked for me as well. Thanks!

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

3 participants