6
$\begingroup$

Backslide introduced after 9.0.1, persisting through 11.3, fixed in 12.0.


r := .5 - Random[];
p = Array[{8^9 {r, r}, r + .5} &, 99];
Dynamic@Graphics[
  Disk @@@ (p = {#2 #1 + {r, r} + (1 - #2) MousePosition["Graphics", #1], #2} & @@@ p),
  PlotRange -> 44
  ]

This code from "One-Liner Competition 2012". I used version 10.3.1 and 9.0.1.

$\endgroup$
10
  • $\begingroup$ Would you care to tell us more about your problem? What does the code do? Do you have a speed comparison? $\endgroup$
    – MarcoB
    Commented Feb 3, 2016 at 5:24
  • $\begingroup$ Which version of 10 specifically? Many have noted slowdowns for a variety of functions in versions of 10, while the revision history for 10.3 claims to have resolved a number of performance "regressions." $\endgroup$
    – IPoiler
    Commented Feb 3, 2016 at 5:25
  • 2
    $\begingroup$ I find this code to have significant lag in both version 7.0 and 10.1 under Windows 7. Would you describe this as actually smooth in 9.0.1? Edit: This code actually seems to hang my Front End when I try to close the Notebook, but weirdly the "frozen" Notebook displays this Dynamic object much more smoothly! This deserves further attention. $\endgroup$
    – Mr.Wizard
    Commented Jul 17, 2016 at 18:05
  • 3
    $\begingroup$ @Mr.Wizard Very slow, updating in bursts in Mathematica 11.3, Intel i7 4770 3.4GHz 16Gb RAM, Windows 7 Professional SP1 64 bits. $\endgroup$
    – rhermans
    Commented Oct 25, 2018 at 11:14
  • 2
    $\begingroup$ @rhermans Thanks. Please consider filing a report with WRI. $\endgroup$
    – Mr.Wizard
    Commented Oct 25, 2018 at 11:16

1 Answer 1

6
$\begingroup$

This is an extended comment that constrains the problem a bit.
I reported the problem [CASE:4174000] with the following simplified example.

Reproducing the problem

p = Array[{{1, 1}, #/11} &, 10];
ump[coords_, weight_] := {
     weight coords + (1 - weight) MousePosition["Graphics", coords],
     weight
    }

Labeled[
    Graphics[
      Disk @@@ p
    , PlotRange -> 9
   ]
  , "Hovering here is smooth"]

Dynamic[
  Labeled[
    Graphics[
     Disk @@@ (ump @@@ p)
   , PlotRange -> 9
  ]
 , "Hovering here is NOT smooth"], 
UpdateInterval -> 0.5]

enter image description here

Code and graphics done in Mathemathica 11.3.0 on Win7 64

Analysis

Each new execution modifies the coordinates in p using the function ump that uses MousePosition

If one hovers the mouse pointer over the first Graphics , the update of the plot is smooth (in the second), but if we hover the mouse over the second Graphics it updates irregularly.

This may suggest that only when the Graphics that is updated is the same as the Graphics over which MousePosition["Graphics"] gathers the data you have some conflict.

Wolfram Support

The answer from Wolfram Support was:

Yes, it seems that MousePosition is not behaving as expected in this scenario. Furthermore, I have only been able to reproduce this in Mathematica 11.3 onwards and on Windows. Other operating systems seem to respond better.

Based on this information, I have made the relevant report to the proper development team and I have also added the information you provided to it. Unfortunately, I have not been able to find a relevant workaround for your specific example.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.