[xep-support] multi threaded access issue ?

Rob Stote RStote at whitehilltech.com
Mon Feb 6 07:14:14 PST 2006


Hello all:	

I am doing some performance tests with XEP 4.4. I am testing in in two
environments. The first is a hyper-threaded machine, the second on a dual
processor Xeon. Our code (see snippet below) is using the java API to access
XEP. We are producing PDF. My issue is the following: we have notice a
considerable slow down when using multi-threaded access in conjunction with
a Hyper Threaded, or Multiple CPU box. The slow down seems to disappear when
we disable Hyper-Threading. Once disabled we are able to use "multithreaded"
access and get faster throughput on the HT machine. However, on the 2CPU box
we have to set out thread count to 1 in order to not experience a slowdown
in production of the PDF. Any ideas as to why this is happening ?

Thanks in advance

Rob


+++++++ Test One +++++++++

Running 1000 documents through on the P4 3.2HT machine. The input is a .fo
document.

Hyperthreaded, 2 threads - 4.2 minutes
Hyperthreaded, 1 thread - 2.9 minutes

Non-hyperthreaded, 1 thread - 2.3 minutes
Non-hyperthreaded, 2 threads - 2.3minutes

Environment
WinXP
P4HT 3.2 GHz HT
1Gig RAM
XEP 4.4
Java 4.1.2_8

Notice the drastic increase in time with multithreaded access on a
hyper-threaded machine......


+++++++ Test Two +++++++++

Running 1000 documents through on the 2CPU XEON 3.4 machine. The input is a
.fo document.

2CPU, 4 threads - 9.1 minutes
2CPU, 1 thread - 2.4 minutes

Environment
WinXP
2CPU Xeon 3.2Ghz
2Gig RAM
XEP 4.4
Java 4.1.2_8


CODE Snippet:

    private ThreadLocal localFormatter = new ThreadLocal() {
        protected Object initialValue()
        {
            Properties options = new Properties();
            options.setProperty("CONFIG", xepRoot + "/xep.xml");
            options.setProperty("VALIDATE", "false");
            
            try {
                return new FormatterImpl(options, new
XepLoggerAdapter(log));
            }
            catch (ConfigurationException e) {
                log.error(e.getMessage(), e);
                throw new RuntimeException(e);
            }
        }
    };
    
    public void render(...)
    {
        Formatter formatter = (Formatter) localFormatter.get();
        
        String documentURI = baseDir + "/document";
        
            FOTarget target = new FOTarget(out, "PDF");
            
            try
            {
                    Result result = new SAXResult(
                        formatter.createContentHandler(documentURI,
target));
                    transformer.transform(saxSource, result);
            }
            finally
            {
                out.flush();
                out.close();
            }
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20060206/0d62e2cb/attachment.html>


More information about the Xep-support mailing list