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

Windows OpenGL startup time optimization #886

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Windows OpenGL startup time optimization #886

merged 1 commit into from
Oct 3, 2023

Conversation

dtrebilco
Copy link
Contributor

By doing all attribute queries at once it decreases startup time by ~65ms and also makes my binary 1.5kb smaller.
Win10, Nvidia 3070

Tested with code similar to

static void init_userdata_cb(void* in_app) {
  printf("Startup time %f\n", stm_ms(stm_diff(stm_now(), start_ticks)));
}

sapp_desc sokol_main(int argc, char* argv[]) {
  stm_setup();
  start_ticks = stm_now();

  return sapp_desc{
      .init_userdata_cb = init_userdata_cb,
  }
}

@floooh
Copy link
Owner

floooh commented Sep 14, 2023

Looks like a good change, thanks!

I'll try to give it a whirl on the weekend and then merge.

@floooh floooh self-assigned this Sep 14, 2023
@floooh
Copy link
Owner

floooh commented Sep 23, 2023

Just a quick headsup, I'll be without access to a Windows PC for the next week, but will try to take care of the PR in the week after.

@floooh
Copy link
Owner

floooh commented Oct 3, 2023

Starting to look into this PR now...

floooh added a commit that referenced this pull request Oct 3, 2023
@floooh floooh merged commit 09111fd into floooh:master Oct 3, 2023
23 checks passed
@floooh
Copy link
Owner

floooh commented Oct 3, 2023

Ok merged! I did a couple of small coding style fixes (replaces the hardwired 12 with a define, and changed the consts to lower case. Thanks for the PR!

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

Successfully merging this pull request may close these issues.

2 participants