Skip to main content

Notifications

Announcements

Spend less time recompiling Microsoft's X++ code.

TL;DR - The X++ compiler will be able to generate cross reference information without doing assembly and fat PDB file generation.

One of the reasons that we see customers recompiling our source code is to get the latest snapshot of the code recorded in the cross-reference database. As you know, this is the information (stored in the DYNAMICSXREFDB database) that talks about where things are used and defined. This information is what ultimately powers the "Go to definition" and several other bits and pieces of functionality within Visual Studio.

We recognize that the latest cross reference information is indeed desirable to have in your development work, but it does seem wasteful to have to do a full compilation for that. Ideally you would want to keep the assemblies and skinny PDB files shipped by Microsoft unmodified. The point about the PDB files is crucial: We ship portable (i.e., skinny) PDB files that are optimized for size, which improves the debugging experience, since it decreases the memory pressure that VS has to endure. Currently you cannot generate the portable PDB files, although we plan to allow that soon.

To allow you to spend less time recompiling, and to leave the shipped assemblies and optimized PDBs unscathed, we have provided a switch on the compiler to stop the compilation process before the code generation, but after the cross-reference generation. This is what it looks like in Visual Studio:

1263.pastedimage1674160722734v1.png

As you can see, you can also turn off the cross-reference generation, which is useful for those cases where you need the maximum compilation performance, and you know that the cross-reference information does not need to be updated. In fact, half of the compilation time is actually spent updating the cross-reference information.

Please note, that I sometimes cover things in these blogs that may not be available when you read the blog. As you all know, some time passes from a feature leaves the laboratory to it arrives in production on your site. I do these blogs because I want your comments as early as possible, and to allow you to be informed about the work we do.

Comments

*This post is locked for comments

  • Ivan Rudenko Profile Picture Ivan Rudenko
    Posted at
    Hi Peter, We tried to implement this new option into the PU installation scripts. And we found out that just full build for standard models takes 2:45 min, but build with "only cross references" checkbox option takes 2:25 min, very slowly :( Can you confirm or deny that the building time for cross references only is almost the same as for full build operation? Or did your tests show different figures?
  • Build pipeline does not generate cross reference, because a SQL server instance is needed to be running for that. "Build only cross reference data" option generates only the cross-reference information, without building assemblies or any other binary (like pdb (symbols) and md (runtime binary compressed metadata) files).
  • Jupke Profile Picture Jupke 40
    Posted at
    As we build most of the time using only DevOps pipelines I am wondering if we can disabled the "build cross reference" also for the devops build pipeline. I think it is not an option/included in the build.sln file as an option/parameter ?? or maybe cross reference is never build in the pipeline ??
  • DeepakGuptaIrashi Profile Picture DeepakGuptaIrashi
    Posted at
    Hi Peter, The name in the check box is 'Build only cross reference data'. Is that a functionality that the system will not do build but do only cross references? Such functionality is needed. I completely agree that during full build, we don't need to update cross-references. But again, cross references is indeed very useful information specially when most of the customization is through extension which only depends on decorator attributes. May be when system is less occupied, I'll run only cross-refereces.