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

Refactor GLProfiler #22

Closed
dany-on-demand opened this issue Aug 29, 2013 · 3 comments
Closed

Refactor GLProfiler #22

dany-on-demand opened this issue Aug 29, 2013 · 3 comments

Comments

@dany-on-demand
Copy link
Contributor

Right, now, OS is creating a new GLProfiler object each step of the frame. Even if debugging is turned off.

@yvt
Copy link
Owner

yvt commented Aug 29, 2013

Creation cost of GLProfile automatic variable every frame shouldn't be high because:

  • Because GLProfile is always allocated with automatic variable, memory allocation for GLProfile is done by shifting stack pointer register, not by dynamic allocation.
  • Only a few dozens of GLProfile is created every frame. Calling constructors 100 times per frame shouldn't costly.

@Ericson2314
Copy link
Contributor

FYI automatic variable != stack variable in C++ due to RAII. But if GLProfile's constructor does indeed allocate on the stack yeah, shouldn't be a problem @dany0.

@dany-on-demand
Copy link
Contributor Author

Guess you can close the issue then.

@yvt yvt closed this as completed Aug 30, 2013
VierEck pushed a commit to VierEck/openspades that referenced this issue Jun 7, 2023
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