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

ReadOnly very high editor CPU impact #170

Closed
tabuto74 opened this issue Aug 12, 2020 · 3 comments
Closed

ReadOnly very high editor CPU impact #170

tabuto74 opened this issue Aug 12, 2020 · 3 comments

Comments

@tabuto74
Copy link

With only 5 ReadOnly attributes the editor eat too much cpu and starts to be less responsive. Is there something we can do or it just can't be optimized?

@dbrizov
Copy link
Owner

dbrizov commented Aug 12, 2020

The ReadOnly attribute doesn't do anything, I just put an EditorDisabledScopre there. It's basically 1 call to EditorGUI.PropertyField. That's pretty strange mate. Are you sure it's not something else?

I have reported issues about performance problems, but they are not connected to the ReadOnly attribute. I am currently working on a new release. Will probably release it at the end of the week. Then I will make a second release for the performance issues. I will check the ReadOnly attribute, but it's probably something else.

Of course it can be optimized. I am just not caching anything. Cache invalidation is probably the hardest thing in programming, after naming variables :D, so I've been saving it for later, because I don't wanna break something. But that time finally came :D

@tabuto74
Copy link
Author

I was struggling with my classes trying to figure out what was causing the editor lag issue, and after a couple of tries I removed the ReadOnly attributes that fixed the issue.
I'm not sure if it's related to ReadOnly or maybe NaughtAttributes in general. You can just create an empty class and start filling it with variables, then add a few Attrbitues and u'll notice the slowness by urself.

@dbrizov
Copy link
Owner

dbrizov commented Aug 12, 2020

Duplicate of #133

@dbrizov dbrizov marked this as a duplicate of #133 Aug 12, 2020
@dbrizov dbrizov closed this as completed Aug 12, 2020
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

2 participants