This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166064 - Excessive searching by ruby platform
Summary: Excessive searching by ruby platform
Status: RESOLVED INCOMPLETE
Alias: None
Product: ruby
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-05-26 21:22 UTC by _ pcw
Modified: 2009-09-09 12:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log for NB 6.7 RC1 (353.78 KB, text/plain)
2009-05-26 21:25 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2009-05-26 21:22:46 UTC
See attached messages.log from starting up NetBeans 6.7 --  This has logging for Ruby platform enabled and shows 175
occurrences of 

    FINER [org.netbeans.api.ruby.platform.RubyPlatform]: Looking for 'gem' executable; used intepreter:
'/usr/local/bin/ruby'
    FINER [org.netbeans.api.ruby.platform.RubyPlatform]: '/usr/local/bin/gem' is not a file.

just for starting up the IDE, followed by large number of this message:

    FINE [org.netbeans.api.ruby.platform.RubyPlatform]: Could not resolve a platform for
FreeformProject[/space/peterw/nb67/web-main/nbbuild]. Platform provider: null

I'm not sure if the searching is causing a slowdown or maybe printing the log messages (which I needed for other
reasons) caused the slowdown, but I see hundreds of these messages while running the IDE and when they are being
printed, the IDE is sluggish.
Comment 1 _ pcw 2009-05-26 21:25:17 UTC
Created attachment 82825 [details]
messages.log for NB 6.7 RC1
Comment 2 Erno Mononen 2009-05-27 15:19:47 UTC
I can't reproduce this, tried opening the nbbuild module and having it open when starting up the IDE - what exactly did 
you do? Could you get a call stack for one of those invocations? Thanks.
Comment 3 _ pcw 2009-05-27 23:43:24 UTC
java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1206)
        at org.netbeans.api.ruby.platform.RubyPlatform.findExecutable(RubyPlatform.java:634)
        at org.netbeans.api.ruby.platform.RubyPlatform.findExecutable(RubyPlatform.java:675)
        at org.netbeans.api.ruby.platform.RubyPlatform.getGemTool(RubyPlatform.java:704)
        at org.netbeans.api.ruby.platform.RubyPlatformValidator.getRubyGemsProblems(RubyPlatformValidator.java:74)
        at org.netbeans.api.ruby.platform.RubyPlatformValidator.hasRubyGemsInstalled(RubyPlatformValidator.java:61)
        at org.netbeans.api.ruby.platform.RubyPlatform.hasRubyGemsInstalled(RubyPlatform.java:972)
        at org.netbeans.api.ruby.platform.RubyPlatform.hasValidRake(RubyPlatform.java:176)
        at org.netbeans.modules.ruby.rubyproject.RubyBaseProject.updateRakeTasks(RubyBaseProject.java:295)
        at org.netbeans.modules.ruby.rubyproject.RubyBaseProject.open(RubyBaseProject.java:289)
        at org.netbeans.modules.ruby.railsprojects.RailsProject.open(RailsProject.java:155)
        at
org.netbeans.modules.ruby.rubyproject.RubyBaseProject$ProjectOpenedHookImpl.projectOpened(RubyBaseProject.java:388)
        at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:81)
        at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:1059)
        at org.netbeans.modules.project.ui.OpenProjectList.access$800(OpenProjectList.java:122)
        at org.netbeans.modules.project.ui.OpenProjectList$LoadOpenProjects.loadOnBackground(OpenProjectList.java:401)
        at org.netbeans.modules.project.ui.OpenProjectList$LoadOpenProjects.run(OpenProjectList.java:309)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
Comment 4 _ pcw 2009-05-27 23:43:38 UTC
java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1206)
        at org.netbeans.api.ruby.platform.RubyPlatform.findExecutable(RubyPlatform.java:634)
        at org.netbeans.api.ruby.platform.RubyPlatform.findExecutable(RubyPlatform.java:615)
        at org.netbeans.api.ruby.platform.RubyPlatform.getRake(RubyPlatform.java:244)
        at org.netbeans.api.ruby.platform.RubyPlatform.hasValidRake(RubyPlatform.java:177)
        at org.netbeans.modules.ruby.rubyproject.RubyBaseProject.updateRakeTasks(RubyBaseProject.java:295)
        at org.netbeans.modules.ruby.rubyproject.RubyBaseProject.open(RubyBaseProject.java:289)
        at org.netbeans.modules.ruby.railsprojects.RailsProject.open(RailsProject.java:155)
        at
org.netbeans.modules.ruby.rubyproject.RubyBaseProject$ProjectOpenedHookImpl.projectOpened(RubyBaseProject.java:388)
        at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:81)
        at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:1059)
        at org.netbeans.modules.project.ui.OpenProjectList.access$800(OpenProjectList.java:122)
        at org.netbeans.modules.project.ui.OpenProjectList$LoadOpenProjects.loadOnBackground(OpenProjectList.java:401)
        at org.netbeans.modules.project.ui.OpenProjectList$LoadOpenProjects.run(OpenProjectList.java:309)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
Comment 5 _ pcw 2009-05-27 23:46:05 UTC
I'll see if I can get you the traces you really need -- those may be from an actual ruby project (still a bit aggressive
though -- while I have the MRI installed, NetBeans is not configured to use it and doesn't seem to be smart enough to
turn off checking for it after it fails "validation" a few times).
Comment 6 Erno Mononen 2009-05-28 07:33:24 UTC
Thanks. A stack trace for "Could not resolve a platform for FreeformProject[/space/peterw/nb67/web-main/nbbuild]. 
Platform provider: null" would also be useful, to see what ends up invoking RubyPlatform#platformFor for a free form 
project.

I'll see if can make the validation a bit smarter so that it doesn't check invalid entries again and again.
Comment 7 Erno Mononen 2009-09-09 12:03:31 UTC
I've being trying to reproduce, but no dice so far -- would you be able to provide a stack trace for a non-ruby 
project. I looked into caching checks, but I decided not to do it before we know the root cause for this - if we can 
fix the root cause, caching shouldn't be needed (and it might just introduce new bugs).