Global Directory
Global Directory
EXPLORE OUR SITES
London Stock Exchange Group
LSEG Data & Analytics
MyAccount
LSEG Perspectives
London Stock Exchange
FTSE Russell
LCH
Contact Us
Home
TR Internal
Why do Cobalt Website Module builds take so long?
Josh Harris
***Rant:***
Building Website locally with code analysis on takes 4+ minutes now days. When you finally check in to CI a single Website Platform build (not including products) can take 25+ minutes.
***:End Rant***
I am really just wondering why they have become so bad and if there is anything being done to bring the times down? For both local builds and code check-in builds / deploys.
Thanks,
Josh
Find more posts tagged with
build
refinitiv-internal
Accepted answers
Ron Burke
So I looked into this and as I suspected the bulk of the time is spent compiling views. I think we actually end up compiling the platform views twice. The first time we build them is when we build Cobalt.Website.Platform.Web, about 1.5 minutes of building that project is spent building the views. Then as a post build step of the WestlawNext.Web project I think we again building the views. About 1.8 minutes during the build of that project are spent on an Exec task which I think includes building all the views. A few months ago we added building the views as part of the Debug/Release builds. The reason we added building the views was to find coding issues in the views at build time rather than run time. This is especially helpful when we are making platform changes that could end up affecting views in multiple products. Note that all the tasks are not listed in the tables below, just the last few that take most of the time.
Times from Cobalt.Website.Platform.Web:
Time (ms)
Task
# of Calls
105
Copy
4
209
ResolveAssemblyReference
1
428
RemoveDir
2
3167
Csc
1
3454
StyleCopTask
1
15985
CodeAnalysis
1
90769
AspNetCompiler
1
Times from WestlawNext.Web:
Time (ms)
Task
# of Calls
332
ResolveAssemblyReferences
1
685
CoreCompile
1
850
StyleCop
1
5580
RunCodeAnalysis
1
108824
PostBuildEvent
1
All comments
Kevin Moore
Well... Running the builds with Code Analysis does a lot of things. It runs a full StyleCop analysis as well as a full Microsoft CA on literally thousands of files - and then after all that, we recently added a view verification so view failures won't make it to CI and break the environment. There are probably other things running as well as part of the post-build processes and I won't pretend to know them all.
I'd love it if the builds ran faster as well, but that means we have to remove something. If we remove one of the actual Code Analysis, then we end up with bad standards and inefficient code. If we remove the view verification, then we end up with broken environments when people don't verify their changes locally.
You could always try begging for a faster computer with a SSD, maybe (if you succeed, I may try and follow suit)?
Ryan Morlok
What are the current specs on the build machines?
Josh Harris
You make valid points Kevin its just getting to a point where it takes upwards of half a day to check in. As far as SSDs go, we ran some tests locally with Laptops 8GB RAM with SSDs, Desktops 8GB RAM with SSDs, iMac with 16GB of RAM and Desktops 8GB RAM without SSDs. The iMac seemed to be the only one with noticeably faster Website builds (with CA on).
James Greene
So maybe you need more RAM or to increase the size of your page file (basically virtual memory) on Windows?
Matt Boland
The platform web project is by far the worst project to build taking nearly 3 minutes of the total 5.5 minutes it takes me to build. Something about that code is causing the Code Analysis to take much longer than other projects.
The lines of code and cyclomatic complexity below were gathered by right clicking on the solution and clicking Calculate Code Metrics. The timings were gathered by Tools -> Options -> Projects and Solutions -> Build and Run and changing MSBuild project build output verbosity to Normal. This setting can be upped to Detailed and Diagnostics so perhaps if somebody has time, they can take an even closer look to see what is taking so long.
![Website Build Stats][1]
[1]:
http://techoverflow.int.thomsonreuters.com/upfiles/WebsiteBuildStats.png
James Greene
Nice initial investigation, that does indeed seem strange.
Ron Burke
So I looked into this and as I suspected the bulk of the time is spent compiling views. I think we actually end up compiling the platform views twice. The first time we build them is when we build Cobalt.Website.Platform.Web, about 1.5 minutes of building that project is spent building the views. Then as a post build step of the WestlawNext.Web project I think we again building the views. About 1.8 minutes during the build of that project are spent on an Exec task which I think includes building all the views. A few months ago we added building the views as part of the Debug/Release builds. The reason we added building the views was to find coding issues in the views at build time rather than run time. This is especially helpful when we are making platform changes that could end up affecting views in multiple products. Note that all the tasks are not listed in the tables below, just the last few that take most of the time.
Times from Cobalt.Website.Platform.Web:
Time (ms)
Task
# of Calls
105
Copy
4
209
ResolveAssemblyReference
1
428
RemoveDir
2
3167
Csc
1
3454
StyleCopTask
1
15985
CodeAnalysis
1
90769
AspNetCompiler
1
Times from WestlawNext.Web:
Time (ms)
Task
# of Calls
332
ResolveAssemblyReferences
1
685
CoreCompile
1
850
StyleCop
1
5580
RunCodeAnalysis
1
108824
PostBuildEvent
1
Josh Harris
If we are compiling most of the same views twice is it possible to only compile the views once?
Ron Burke
Yes, we will be checking that change in to 20.7
Ron Burke
Website has now been changed to no longer build the platform views as part of the cobalt.website.platform.web project.
Anthony Foerster
Not an answer, but a workaround: you can always unload unit/integration test projects if you are just testing against the environment.
Quick Links
All Forums
Recent Questions
Terms of use
Privacy & Cookie Statement
Cookies settings
Do not sell my info
Whistleblowing
UK Bribery Act
Modern Slavery Act