Long compute shader compile/link time with large SSBO size

Hey all, I’ve been working on a compute shader that uses a large SSBO and found that as the size of the buffer increases the compile/link time (specifically for the glLinkProgram call to return) for the shader increases dramatically on my Nvidia Quadro M1000M GPU.

For allocations of ~50 MB it takes over 10 minutes and only gets worse from there. Ideally I’d like to use as much memory as I can, the driver says up to 2 GB are available for SSBOs, so I’m currently well below that. For reference on the Intel integrated GPU on the same computer it takes ~10 sec for the same shader.

After a first compilation/linking of the shader it seems to be cached and the process only takes ~30 ms, however in developing I’m changing the code frequently and each change requires a new compilation/linking, and regardless the prospect of a potentially hours long wait even when it’s relatively stable is daunting.

The problem shows itself even for extremely simple shaders like the one below:

#version 430 core
#define N 10000000

layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(std430, binding = 0) buffer data
{
    float   values[N];
};

void main()
{
    values[gl_GlobalInvocationID.x] = gl_GlobalInvocationID.x;
}

Any help on what is causing this, or if this is a bug, or what I could do to reduce the time would be greatly appriciated.