harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "weldon washburn (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4036) [drlvm][thread] significant performance degradation (scalability problem), in particular on DaCapo:xalan (2x)
Date Wed, 06 Jun 2007 17:51:26 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502006
] 

weldon washburn commented on HARMONY-4036:
------------------------------------------

I found the following diagnostic hack highlights hot spots in the code.  This is not a patch
but may be useful in figuring out what is causing the performance slowdown:


D:\users\weldon\trunk\working_vm>svn diff
Index: vm/thread/src/thread_native_thin_monitor.c
===================================================================
--- vm/thread/src/thread_native_thin_monitor.c  (revision 544329)
+++ vm/thread/src/thread_native_thin_monitor.c  (working copy)
@@ -260,7 +260,9 @@
     IDATA lock_id;
     IDATA status;
     hythread_monitor_t fat_monitor;
+#ifdef SPIN_COUNT
     int UNUSED i;
+#endif
     assert(!hythread_is_suspend_enabled());
     assert((UDATA)lockword_ptr > 4);
     assert(tm_self_tls);
@@ -660,9 +662,10 @@
     TRACE(("LOCK ID in table %x\n", lock_id));

     assert(lock_id >=0 && (U_32)lock_id < lock_table->size);
-    hymutex_lock(&lock_table->mutex);
+
+//    hymutex_lock(&lock_table->mutex);
     fat_monitor = lock_table->table[lock_id];
-    hymutex_unlock(&lock_table->mutex);
+//    hymutex_unlock(&lock_table->mutex);
     return fat_monitor;
 }

Index: vm/thread/src/thread_private.h
===================================================================
--- vm/thread/src/thread_private.h      (revision 544329)
+++ vm/thread/src/thread_private.h      (working copy)
@@ -59,7 +59,7 @@
 //use lock reservation
 #define LOCK_RESERVATION
 // spin with try_lock SPIN_COUNT times
-#define SPIN_COUNT 5
+#define SPIN_COUNT 50

 #endif // !defined (_IPF_)

D:\users\weldon\trunk\working_vm>D:\users\weldon\trunk

> [drlvm][thread] significant performance degradation (scalability problem), in particular
on DaCapo:xalan (2x)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4036
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4036
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Evgeniya Maenkova
>            Priority: Critical
>         Attachments: ThreadTest.java
>
>
> Significant performance degradation has been discovered. This happened between r541650-r541654.
More likely, this is r541653 (H-2742).
> 2x times degradation on Dacapo::xalan.
> I wrote the simple reproducer (see please below and to be attached) and got the following
data on a machine with 4 logical processors:
>                        1 thread     4 thread   4thr/1thr  
> 24-May          2828           9594         3.392504  (r541650)
> 31-May          2891           271394     93.87548 (r541654).
>  
> On r541654 version the system time increases significantly, cpu utilization is about
28% only. Unlike r541654 version, where things are going well (cpu utilization ~80%).
> Scale factor changed from 3.39 to 93.88.
> The test is:
> import java.io.IOException;
> public class ThreadTest extends Thread {
> 	static private void doComputing(long n)
> 			throws IOException {
> 		int res = 1;
> 		for (int i = 1; i < 1000; i ++) {
> 			res *=i;
> 		}
> 	}
> 	public void doIt() throws Exception {
> 		for (int j = 0; j < 500000; j ++) {			
> 		    doComputing(getBD());			  
> 		}
> 	}
> 	
> 	static long bd = 0;
> 	
> 	static synchronized long getBD() {
> 		bd ++;		
> 		if (bd == Long.MAX_VALUE) {
> 			bd = 1;
> 		}
> 		return bd;
> 	}
> 	
> 	public void run() {
> 		for (int i = 0; i < loops; i ++) {
> 			System.out.println(i);
> 			try {
> 			   doIt();
> 			} catch (Exception e) {
> 				e.printStackTrace();
> 			}					
> 		}
> 	}
> 	public static int loops;
> 	public static void main(String[] args) throws Exception{
> 		loops = Integer.parseInt(args[0]);		
> 		int thrNum = Integer.parseInt(args[1]);
> 		long start = System.currentTimeMillis();
> 		Thread[] threads = new Thread[thrNum];
> 		for (int i = 0;  i < thrNum; i ++) {
> 		    threads[i] = new ThreadTest();
> 		    threads[i].start();
> 		}
> 		
>         for (int i = 0;  i < thrNum; i ++) {
> 			threads[i].join();
> 		}
> 		System.out.println("result: " + (System.currentTimeMillis() - start));
> 	}
> }
> To run it: java ThreadTest <loops>  <threads number>
> (For instance, "java  -Xem:server -XX:vm.dlls=gc_cc.dll -Xmx900m -Xms900m ThreadTest
5 4" or "java -Xem:server -XX:vm.dlls=gc_cc.dll -Xmx900m -Xms900mThreadTest 5 1". These ones
are used by me to create the table mentioned above).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message