shader compilation speedup - #9497
Conversation
kkaefer
left a comment
There was a problem hiding this comment.
This looks good overall!
The approach of using regular expressions for parsing attribute/uniform information is somewhat brittle. We should consider using an approach where we parse the shaders at build time and stores the metadata as constant data in the JS bundle. We could e.g. parse the shaders in our build script with headless-gl, then use our current code to extract the names. Alternatively, a native shader compiler could work as well for extracting metadata.
What does the setFeatureState-error branch in your graphs represent? Is that this PR?
arindam1993
left a comment
There was a problem hiding this comment.
Looks good @sgolbabaei , we just need to address the problem with using Set
|
@arindam1993 hmm.. It seems like some specific functionalities of Sets are not supported in IE11: Since I am just using the constructor and that is supported, we should be OK. Right? |
|
What's the problem with |
getting Attribute info some clean-up Code clean-up Addressing PR comments move Regex into the parameter list Remove using Set since some the functionalities of Set is not supported in IE11.
ee063e4 to
c325dcd
Compare
|
@arindam1993 @kkaefer Do you think it is possible with these changes to link an unused attribute to position 0? |
|
Capturing slack convo: Should be fine since |
|
I think we should be good with this changes. We don't need to bring back the layoutAttributes, since they are basically the equivalent of the static attributes in this case. For instance, in case of fill_extrusion_attributes (src/data/bucket/fill_extrusion_attributes.js) is basically manually created instances of the static attributes. Since in the code base we do |
After some investigation, we realized that some of the calls to
getActiveAttrib,getActiveUniform,getProgramParameterandgetAttribLocationsince these are the information we can get from our styling pipeline and program configuration.The changes that is being introduced with this change:
Removed the layout Attributes from program configuration since it is no longer being used in program class. With the new changes, we are now getting the run time attributes and uniforms information from binders. The only dependency to
glwe have is forgetUniformLocation.These are some of the benchmark results which compares this local branch to master:

Layer Line:
Layer Circle:

Layer Fill:

Paint:

Also, this is a screen shot of the performance with recent changes. You can see that the main time consuming operation is regarding getUniformLocation: