LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Thaun on September 29, 2018, 22:14:13

Title: 40 Seconds to run glfwInit
Post by: Thaun on September 29, 2018, 22:14:13
Hello, and i have been having a problem with my LWJGL Application.

It takes 40 seconds minimum to launch my application, and 0.74 seconds to load the jars. I have tried different types of JDK and all of them has the same result.
I have been looking trough the internet and trying to see if any of the issues have the same relation, but it seems it does not.

Looked it up, and it seems like glfwInit is taking up 40 seconds.

package com.thaun.game;

import static org.lwjgl.glfw.GLFW.*;

public class Main {

    public Main(){
        if(!glfwInit()){
            System.err.println("GLFW Failed to initialize");
        }
        System.out.println("GLFW Initialized");

        long window = glfwCreateWindow(640, 480, "Window", 0,0);
        System.out.println("Window Initialized");

        while(!glfwWindowShouldClose(window)){
            glfwPollEvents();
        }

        glfwTerminate();
        System.out.println("GLFW Terminated");
    }

    public static void main(String[] args){
        new Main();
    }
}


And the logs: https://gist.github.com/ThomasAunvik/a27f0a98a827497ec09713c98c3f88fa
Title: Re: 40 Seconds to run glfwInit
Post by: Thaun on September 29, 2018, 22:56:24
Well, after i tried rebooting my computer, it all worked again.

What a suprise...

EDIT: Aaand, a few minutes later it came back up to 40 seconds.
Title: Re: 40 Seconds to run glfwInit
Post by: spasi on September 30, 2018, 07:01:45
Hey Thaun,

Sounds like this issue (https://github.com/glfw/glfw/issues/1049) might be relevant.
Title: Re: 40 Seconds to run glfwInit
Post by: Thaun on September 30, 2018, 18:06:21
Problem is that there isnt a good solution.