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 54690 - Patch to be used for measuring classpath scan time
Summary: Patch to be used for measuring classpath scan time
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2005-02-08 15:19 UTC by Marian Mirilovic
Modified: 2007-09-26 09:14 UTC (History)
3 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
here is the patch (1.20 KB, text/plain)
2005-02-11 14:32 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2005-02-08 15:19:49 UTC
We would like to measure time of classpath scan ,
for example if new project is created or if user
open new one . 

For this purposes I'd used your PERF_DEBUG
property, but it's too low, so I created next patch:

I added new property :
PERF_TEST ... perf.refactoring.test

If this property is used we will log name of the
classpath element and time spend by scanning.

Please review the patch, thanks in advance.

-----------------
Index:
src/org/netbeans/modules/javacore/JMManager.java
===================================================================
RCS file:
/cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v
retrieving revision 1.90
diff -r1.90 JMManager.java
73a74
>     public static final boolean PERF_TEST =
Boolean.getBoolean("perf.refactoring.test");
1038c1039
<             if (PERF_DEBUG) {
---
>             if (PERF_DEBUG || PERF_TEST) {
1045c1046
<             if (PERF_DEBUG) {
---
>             if (PERF_DEBUG || PERF_TEST) {
1047a1049,1058
>
>                 if (PERF_TEST) {
>                     try {
>                         Class c =
Class.forName("org.netbeans.performance.test.utilities.LoggingScanClasspath",true,Thread.currentThread().getContextClassLoader());
// NOI18N
>                         java.lang.reflect.Method
m = c.getMethod("reportScanOfFile", new Class[]
{String.class, Long.class}); // NOI18N
>                         Object o =
m.invoke(c.newInstance(), new Object[] {new
String(uri), new Long(endT - startT)});
>                     } catch (Exception e) {
>                        
e.printStackTrace(System.err);
>                     }
>                 }
Comment 1 Marian Mirilovic 2005-02-10 10:12:24 UTC
Pavel, what is the status of this issue ?  
Thanks and sorry ;)
Comment 2 Pavel Flaska 2005-02-10 10:27:09 UTC
From my point of view, I do not have anything against it as it is only
code which runs with private property. I have only one question. Do we
really need to use reflection?
(Sorry for late answer.)
I will add your property to arch-javacore.xml.
Comment 3 Marian Mirilovic 2005-02-10 10:29:07 UTC
> From my point of view, I do not have anything against it as it is only
> code which runs with private property. I have only one question. Do we
> really need to use reflection?

Do you know about any other solution ?

> (Sorry for late answer.)
> I will add your property to arch-javacore.xml.

That's fine , thanks.
Comment 4 Marian Mirilovic 2005-02-11 12:29:46 UTC
Yarda,
a little bird told me that you are the boss responsible for approving
reflection usage in our code base, so please could you look at this ? 

I would like to have this code in trunk before NB4.1 Beta branching,
Thanks in advance.
Comment 5 Marian Mirilovic 2005-02-11 14:31:52 UTC
I was speaking with Yarda and he agreed with this change.

Pavel or Martin, I am not sure what has to be done for Arch, so if I
can help you let me know what, where and ...  

I am applying for fast review, because we would like to measure scan
classpath as soon as possible, at least we need data for Beta , and
Beta is going to be branched on 15th of February ;(




Comment 6 Marian Mirilovic 2005-02-11 14:32:43 UTC
Created attachment 20311 [details]
here is the patch
Comment 7 Jaroslav Tulach 2005-02-14 06:50:35 UTC
Just document in arch.xml that there is such strange contract (api of
property and reflection).
Comment 8 Martin Matula 2005-02-14 09:22:33 UTC
OK, we are going to merge this within the next 24 hours.
Comment 9 Pavel Flaska 2005-02-15 16:43:23 UTC
Checking in arch/arch-javacore.xml;
/cvs/java/javacore/arch/arch-javacore.xml,v  <--  arch-javacore.xml
new revision: 1.17; previous revision: 1.16
done
Processing log script arguments...
More commits to come...
Checking in src/org/netbeans/modules/javacore/JMManager.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v
 <--  JMManager.java
new revision: 1.93; previous revision: 1.92
done
Comment 10 Marian Mirilovic 2005-03-16 12:02:21 UTC
Pavel, thanks a lot - verified.
Comment 11 Quality Engineering 2007-09-20 09:44:17 UTC
Reorganization of java component