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

ImPlot Performance Improvement #115

Merged
merged 5 commits into from
Mar 1, 2022

Conversation

calvertdw
Copy link
Contributor

I would like to make the methods public to enable use of primitive arrays. Otherwise, to use the boxed types, we are creating whole new arrays every frame, which is terrible performance wise as it contributes to frequent garbage collection and incurs extra data copying, using up CPU.

@perrymacmurray Was there a reason they are private or why we should not pass primitive arrays directly?

@perrymacmurray
Copy link
Contributor

I don't think there's a particular reason (or at least, a good reason) for nPlotLine method being private, I just looked at the method again and I think it was only to match the other native methods. I would consider changing the name of nPlotLine to an overload of plotLine, though, just to match the original C++ ImPlot API, though.

@calvertdw
Copy link
Contributor Author

I made some separate ones that are public and dropped the n* prefix. I also removed the warning about information loss because that shouldn't be an issue for these. I went ahead and just made the API passthrough instead of trying to be smart about the size, just for performance possibilities.

@calvertdw
Copy link
Contributor Author

Okay if it passes I think I'm all done.

@SpaiR SpaiR added the api Connected with imgui-java API label Mar 1, 2022
@SpaiR SpaiR merged commit bfbe56c into SpaiR:main Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Connected with imgui-java API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants