Skip to main content
added 79 characters in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

Bug introduced in 10.0.2 or earlier and fixed in 10.1.0


Whenever I plot something 3 temporary variables get added to my current context.

Example (fresh Kernel):

Plot[x, {x, -1, 1}]; Names["Global`*"] 

Output:

{"x", "$3", "$4", "$5"} 

When I do the same thing 100 times it adds 300 temporary vars in total.

Do[Plot[x, {x, -1, 1}], {100}]; Names["Global`*"] // Length 

Output:

301 

This is probably not a big issue for plots inside a notebook. However, if a function relies on plot (like FindAllCrossings) wouldn't the function pollute it's context if it is called repeatedly?

I wondered if this would slow down calls to other objects in that context (if for example 10000 temporary variables had been added).

So I'd just like to know whether my observations are correct or whether I'm totally on the wrong track here.

Whenever I plot something 3 temporary variables get added to my current context.

Example (fresh Kernel):

Plot[x, {x, -1, 1}]; Names["Global`*"] 

Output:

{"x", "$3", "$4", "$5"} 

When I do the same thing 100 times it adds 300 temporary vars in total.

Do[Plot[x, {x, -1, 1}], {100}]; Names["Global`*"] // Length 

Output:

301 

This is probably not a big issue for plots inside a notebook. However, if a function relies on plot (like FindAllCrossings) wouldn't the function pollute it's context if it is called repeatedly?

I wondered if this would slow down calls to other objects in that context (if for example 10000 temporary variables had been added).

So I'd just like to know whether my observations are correct or whether I'm totally on the wrong track here.

Bug introduced in 10.0.2 or earlier and fixed in 10.1.0


Whenever I plot something 3 temporary variables get added to my current context.

Example (fresh Kernel):

Plot[x, {x, -1, 1}]; Names["Global`*"] 

Output:

{"x", "$3", "$4", "$5"} 

When I do the same thing 100 times it adds 300 temporary vars in total.

Do[Plot[x, {x, -1, 1}], {100}]; Names["Global`*"] // Length 

Output:

301 

This is probably not a big issue for plots inside a notebook. However, if a function relies on plot (like FindAllCrossings) wouldn't the function pollute it's context if it is called repeatedly?

I wondered if this would slow down calls to other objects in that context (if for example 10000 temporary variables had been added).

So I'd just like to know whether my observations are correct or whether I'm totally on the wrong track here.

edited tags
Link
Tweeted twitter.com/#!/StackMma/status/536002246467928064
Source Link
Max1
  • 1.1k
  • 5
  • 10

Is plot polluting my context?

Whenever I plot something 3 temporary variables get added to my current context.

Example (fresh Kernel):

Plot[x, {x, -1, 1}]; Names["Global`*"] 

Output:

{"x", "$3", "$4", "$5"} 

When I do the same thing 100 times it adds 300 temporary vars in total.

Do[Plot[x, {x, -1, 1}], {100}]; Names["Global`*"] // Length 

Output:

301 

This is probably not a big issue for plots inside a notebook. However, if a function relies on plot (like FindAllCrossings) wouldn't the function pollute it's context if it is called repeatedly?

I wondered if this would slow down calls to other objects in that context (if for example 10000 temporary variables had been added).

So I'd just like to know whether my observations are correct or whether I'm totally on the wrong track here.