dataContexts can be thought of as global variables. The benefits of SSJS features are:
1) DataContext launches SSJS / Java / regardless of what the value returns. References to dataContext use EL (for example, # {myVar}), the same as data sources. Therefore, I understand that EL gets the value, and does not run SSJS / Java code every time. Thus, there is a performance advantage.
2) The value of dataContext can be calculated dynamically or on page load. That way you can use $ {javascript: @Today ()} and run it once, rather than run the function every time.
I suspect there is also a performance advantage because links to dataContexts use EL. Therefore, in no links you start SSJS, therefore it does not need to go through the SSJS parser.
An additional advantage of dataContexts is that they can be tied to any level available to data sources - thus XPage, Custom Control or Panel. This gives them an edge over viewScope. Therefore, youo can also set the dataContext in the panel in re-control mode to avoid multiple references to the NotesDocument field or field concatenation.
I tried to avoid storing Domino objects in dataContexts, mainly because of the inherent risks of recycling. I do not know if there is a problem, I
source share