Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
significant efficiency problem with draw-pattern* #637
There has been a 100-fold decrease in the performance
The problem is obvious if you run the following code, which repeatedly draws a 2x2 pattern to an application pane:
Here's a summary of the timing results:
i.e. the runtime has increased from less than 0.1 second to more than 10 seconds. In my application, this slow-down significantly degrades user experience.
I don't know what could have caused this. Changes in McCLIM or in CLX? The definition of
Hey John. I'm trying to reproduce a problem with no success (I have newest McCLIM and CLX). Do you have the same problem if you pull newest versions from repositories?
Recent changes to patterns improved correctness in light of spec (i.e you can transform ink, and if you draw pattern with
I suspect that the performance drop you have witnessed could be due to a switch from structures to classes in CLX. That change was recently retracted (due to multiple regressions, we were not aware of performance degradation). Could you confirm whenever you witness the problem with the newest code and let us know here?
Thanks for checking up on this. I've just re-built SBCL from the latest sources (1.4.14) and switched to the newest code - and unfortunately I still see the same problem.
To try to narrow it down I profiled the run, and I append interesting parts of the output. It seems that almost all of the time is disappearing in Unix locks. This is in macOS (10.12.6). Maybe that's all more efficient in Linux. Unfortunately I haven't got access to my Linux testbed at the moment so I can't check.
Here's my current list of versions:
And here are excerpts from the profiling output (based on elapsed time rather than cpu time):
could you provide results visualised with clim.flamegraph (branch
The gist of how to use it:
Please run it against fast version and a version with the performance regression.
Yes, no problem - the flamegraphs are below. (I had to make a couple of minor edits to the source of clim.flamegraph to get it to work with the older version of McCLIM).
Both sets of results are with SBCL 1.4.14, macOS 10.12.6. The list of new versions is as above. The list of old versions is:
Below is the flamegraph for the old, fast version (repeated 150 times to give a similar overall run time and to collect enough profile samples). There are two threads visible, but the CLX one on the right is very thin).
Below is the flamegraph for the new, slow version:
I've replicated the difference in Clozure CL 1.11, so the Lisp implementation does not seem to be a factor.