-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Caching project settings variables #304
Comments
Don't assume, do research or ask questions. For the former, peruse the relevant documentation and Godot source code, for the latter, use the Discord or the discussions tab here on Github. Also, if you don't go through the effort of validating your assumptions about Godot, why should any contributor - including myself - go through the trouble of validating it for you?
This is misdirected in a few ways. First off, you seem to be assuming that the current implementation is not fast enough. Second, I have to reiterate, how do you expect any contributor to put in the effort to research anything, if you can't do the same about the issue you're trying to raise. Third, if you're not sure about something needing to be done, then there's no point in opening an issue. I can't fix something that is maybe broken or maybe not. Especially in this case, where nothing is broken ( hence the removed bug label ). I'm closing this issue, as - at the time of writing - there's nothing to fix. Feel free to raise this issue again, if you have factual evidence that the |
Measurably as in benchmark? If yes, do re-open and I will try a benchmark when I find time. This is not a non-issue. This is a hotpath, and not caching variables which are invoked every tick, at so many nodes surely costs performance, GDScript isn't free.
GDScript is very slow, and this is a hotpath. If I run 200 nodes/rollback synchronizers, this will certainly drop FPS for no good reason. It's not like the solution to this issue would bloat the code, its just a few variable declarations.
Putting effort to research something, might as well make a PR for this. I am only reporting the problem. If it is deemed to be a false flag, you have the power to shut it down. I am doing my duty pointing out what I see is a flaw. Using a
I am sure something needs to be done, hence the code above which is essentially the PR template. The only uncertainty is whether godotengine itself plans to implement ProjectSettings caching and that would require me search some minutes through all godot proposals and godot PRs, to ensure it isn't already a thing. |
🐛 Description
According to the above, all invocations of
ProjectSettings.get()
callNode.get()
which I assume is a property getter (via string!)ProjectSettings.get_setting
is invoked at least 5 times per tick inRollbackSynchronizer
so as the quote says, all of these project settings which are read-only should be cached.Example code below for reference of current project settings implementation
and from what I understand should be done (correct me if I'm wrong)
So probably a function at
_ready()
is required to be added, which sets all starting values for the project setting variables.Btw, I suggest first doing a search in godotengine if it plans to cache the project settings variables, so we don't implement it here and have it be needless by godot in the future.
The text was updated successfully, but these errors were encountered: