1

I'm trying to use Eclipse + PyDev for studying OpenGL programming but when I type

from OpenGL.GL import *
from OpenGL.GLUT import *

IDE becomes extremely slow!

Ok. It isn't a smart idea import to much useless things but it's so useful for learning a new library!

Any help?

PS: I use Ubuntu with Eclipse Galileo.

Davide Aversa
  • 5,628
  • 6
  • 28
  • 40
  • Could it be that PyDev tries to look up all available methods for code completion? – phimuemue May 14 '10 at 17:46
  • 1
    You may disable auto build. I think it's related to code completion, too. Anyway, it's not a good idea to do import * unless you know what are imported. – Dingle May 14 '10 at 18:45
  • What's your computer spec? I even have `from OpenGL.GLU import *` and it's not being slow for me. – Xavier Ho May 15 '10 at 04:10
  • @Dingle: The problem with PyOpenGL is that OpenGL itself has way too many API functions you **need**. Listing every single one of them that you use is just too labourous, and difficult to maintain. I haven't actually found a better way than `import *`. – Xavier Ho May 15 '10 at 04:13
  • For me this it's actually the hinter that's causing the problem when a lot of libraries are present with the defined interpreter. Adds a noticeable amount of lag to typing. – Kevin Parker Dec 07 '20 at 23:15

2 Answers2

2

You may want to disable Project -> Build Automatically on the menu. It makes no sense to continue building files with Python, and you've got an interactive console to test your code. This will not affect code-completion at all.

Xavier Ho
  • 17,011
  • 9
  • 48
  • 52
  • Actually, I'd recommend against disabling the automatic build... some basic functionality (as Ctrl+Shift+T to browse over all the classes/methods/fields) won't be available in that case. – Fabio Zadrozny Sep 15 '11 at 10:52
2

I'm trying to reproduce your issue and I'm unable to do it here -- even with those constructs, it doesn't get slower, so, I think your real issue is some other issue -- the most likely is that the JVM is not getting enough memory.

So, please try doing the following: turn the build automatically on again (if you disabled it -- as it's not generally recommend) and check:

  1. If you have the latest PyDev installed

  2. Is "OpenGL" in the forced builtins (it should be -- that should be done automatically, so, just double-check).

  3. Read What are the best JVM settings for Eclipse? and use those settings (if it's really a memory issue, the "-Xmx" flag is the one you need to raise).

If nothing solves that and you really feel disabling the automatic build is needed, don't forget to run the build manually whenever you use some function that needs that info -- i.e.: search globals: Ctrl+Shift+T, find references: Ctrl+Shift+G in selected token -- and probably a bunch of others I'm forgetting :)

Community
  • 1
  • 1
Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78