Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a number of large pieces of precomputed data which I am considering putting into individual packages in order to load them (via DeclarePackage) and unload them (via Leonid Shifrin's PackageManipulations package) as needed. For what it's worth, I have some functions which will be defined on some objects using UpValues, and it is the UpValues which will be stored in the packages, one for each object.

I am wondering if performance or other issues occur, either in the kernel or the front end, when any of the following becomes large (hundreds or thousands):

1) $Packages,

2) The number of defined contexts,

3) $ContextPath.

Is it okay to create new contexts more-or-less at one's convenience, or does one need to be conservative, and if so, how?

Some other questions in which this situation might occur are here, here, and here (in Leonid Shifrin's answer.

share|improve this question
3  
I have not tried this with so many contexts, but I had once a discussion about this with one of the kernel developers who knows more about this, and he told me that there might be problems with scaling to a huge number of contexts, since the package system has not been originally designed with millions of simultaneously loaded packages / contexts in mind. Regardless of whether or not there will be problems with so many contexts, I would not keep many contexts on $ContextPath - normally this is never needed, and you can always group them so that at any given time, you only need a few. –  Leonid Shifrin Aug 20 '13 at 16:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.