> I was pretty sure that the STORAGE macros are "better" than GETMAIN/FREEMAIN, > both in terms of functionality and performance. To back that up, I searched > for documentation. > > What I found so far is a fairly recent presentation from SHARE: > http://ew.share.org/client_files/callpapers/attach/SHARE_in_Denver/S1237DB120530.pdf > which says (on page 34) that GETMAIN/FREEMAIN is taking a lot less cycles > than STORAGE OBTAIN/RELEASE (17,000 vs. 20,000). I haven't found any IBM > document saying anything about performance, all I got was that STORAGE is > recommended for some environments (e.g. for AR mode). And then I found a > thread on IBM-MAIN where Peter Relson talked about the relationship between > the two: http://www.mail-archive.com/[email protected]/msg122945.html but > unfortunately not much about the default LINKAGE=SYSTEM of STORAGE. > > I always thought that an SVC interrupt (GETMAIN) "costs" more than a PC > (STORAGE with LINKAGE=SYSTEM) - am I wrong? > > Anyway: In a "normal" environment (primary mode, key 8), what would you > recommend to use and why? And if you want to "modernize" a module, would you > change from one to the other?
It is true that SVC FLIH and SLIH processing is much more expensive than a single stacking PC instruction, however both are small relative to the overall internal pathlength of the GETMAIN/STORAGE function. It turns out that the STORAGE interface has to do a lot more validation processing because it is a lot more flexible than GETMAIN and it also has to set up for entry to the VSM internal logic the same way the SVC would have and then "undo" it on the way back before the PR instruction returns from the macro call. So the net is that both end up going to the same place, but STORAGE is a bit longer pathlength overall than GETMAIN. If you're writing garden variety code there's still a few differences between the two that you might prefer STORAGE over GETMAIN if you're writing new code. If you're renovating old code it probably isn't worth changing the macro interfaces you use unless you're actually changing their usage at the same time. CC
