Choel,

There are two types of locks in XMLBeans: 
 - a global lock that is used only on operations involving two documents in 
different locales are used
 - a local lock, per locale, by default each new doc gets its locale, using 
options same locale can be used for more docs)

Even for read operations because it involves state, there is a need for a lock 
to be used.

But for your case, which seems so performance oriented, if you know what you 
do, you can try using unsynchronized documents (use option when creating your 
doc), but you need to handle the synchronization separately.

Cezar

-----Original Message-----
From: choel [mailto:ch...@gmx.de] 
Sent: Wednesday, May 26, 2010 12:29 PM
To: user@xmlbeans.apache.org
Subject: Bad performance using multiple threads


Hi,

to improve the performance I started parallelizing (simple fork and join)
some tasks.
After testing the correctness of the output I found the performance on the
parallel tasks extremely bad.
In my testcase it is actually 4 times slower as normal single threaded
usage. I am using a standard dual core cpu running two threads parallel.
Is there anything known on bad multithreading performance using xmlbeans? In
my case there is a lot parallel reading on the same data. Readlocks are for
my usage not neccessary.
Thanks in advance for some help.

Here is some performance data:
1 Thread on dual core:
Creating graph with 2407 nodes, took: 375 ms
Routing 3170 connections, took: 31610 ms

4 Threads on dual core:
Creating graph with 601 nodes, took: 250 ms
Creating graph with 601 nodes, took: 266 ms
Creating graph with 604 nodes, took: 282 ms
Creating graph with 601 nodes, took: 282 ms
Routing 794 connections, took: 57172 ms
Routing 792 connections, took: 59625 ms
Routing 792 connections, took: 60469 ms
Routing 792 connections, took: 60485 ms

Bye Claus

-- 
View this message in context: 
http://old.nabble.com/Bad-performance-using-multiple-threads-tp28683839p28683839.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org

Reply via email to