Field

Ticket #52 (assigned)

Opened 5 months ago

Last modified 1 month ago

Performance issues with Scala (and multiple sheets)

Reported by: marc Assigned to: (accepted)
Priority: Milestone:
Component: Version:
Keywords: Cc:

Description

Having multiple sheets open with the ScalaPlugin? and ProcessingPlugin together seems to cause huge slowdowns. Perhaps related to our namespace sharing? (setting variables in ScalaInterface? is very slow). For now, if you are into multiple sheets, you should make sure that the ScalaPlugin? and the ProcessingPlugin are disabled.

Change History

07/26/2008 01:35:48 PM changed by marc

The issue is the call:

PythonInterface.getPythonInterface().setVariable("p", applet);

inside the applet .draw() method. This is executed once per update per open sheet with the Processing-plugin activated. Since setVariable (with a "new" value) is expensive (and leaky) in the ScalaInterface? this ultimately scambles Scala.

We have two options. Either rename "p" to "_p" (and thus remove it completely from the ScalaInterface?) breaking peoples' Processing code, or special case "p" (or all one letter variable names). In either case you can get to "p" through something like _self.processing.applet

07/28/2008 04:25:16 AM changed by marc

  • status changed from new to assigned.

No principled fix yet, but some additions to the ScalaPlugin? are in changeset:110

07/28/2008 10:14:03 AM changed by marc

  • summary changed from Performance issues with Scala and multiple sheets to Performance issues with Scala (and multiple sheets).

Performance issues remain now that global variables from Python are "correctly" exposed to scala. This makes many, many things slow even in the absence of multiple sheets.

11/29/2008 10:34:33 PM changed by marc

  • severity changed.

One thing that's very reproducible — importing a large-ish python package causes a significant pause if scala is enabled (and some errors usually). Clearly a great many things are still being passed to Scala that really shouldn't be.