Bug 84053

Summary: Large shaders using UBOs take a long time to compile
Product: Mesa Reporter: Ian Romanick <idr>
Component: Drivers/DRI/i965Assignee: Intel 3D Bugs Mailing List <intel-3d-bugs>
Status: RESOLVED MOVED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: minor    
Priority: medium CC: jasuarez
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Sample shader
Faster version of the same test

Description Ian Romanick 2014-09-18 15:26:14 UTC
Created attachment 106510 [details]
Sample shader

For example, the attached shader-runner test took 25 minutes on my IVB laptop.  On a debug build of Mesa (with -O1), Sysprof says that ~90% of the time is spent in brw::vec4_live_variables::compute_live_variables().

Changing the test to do

    pass = !(condition) && pass;

instead of

    if (condition)
        pass = false;

appears to end the slaughter.
Comment 1 Ian Romanick 2014-09-18 16:18:19 UTC
Created attachment 106512 [details]
Faster version of the same test

This version only takes ~30 seconds on the same system.  Looking at sysprof data, it appears that ~80% of that is spent in shader_runner parsing the test file. :)
Comment 2 Juan A. Suarez 2016-11-03 15:55:32 UTC
Interesting.

I've tried again with a more recent version (13.1.0-devel (git-9f150ff)), in a IVB desktop.


Seems now it is quite better: shader-runner now takes ~40 seconds.

perf is reporting 45.96% of the time is spent in _mesa_program_resource_find_index.


Giving the improvement, dunno if this should be considered as RESOLVED.
Comment 3 Juan A. Suarez 2016-11-03 15:58:25 UTC
(In reply to Juan A. Suarez from comment #2)
> Interesting.
> 
> I've tried again with a more recent version (13.1.0-devel (git-9f150ff)), in
> a IVB desktop.
>

I've tested with the first shader, not with the faster one.
Comment 4 GitLab Migration User 2019-09-25 18:52:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1454.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.