You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mike Garcia <mi...@yahoo.com> on 2001/05/29 19:17:19 UTC

Using native call to Xalan-C++ from Java

Hello Xalan Developers,

Please reply to my email address.

We have been using Xalan Java for a while on our project but are
noticing that its relatively slow when compared to Xalan C++ (
using the command line for both with samples of our xml/xslt
files).  I'm noticing about .0005 seconds for the C++
transformation and a 2.5 second transformation for java, on
average.  I'd like to be able to make a native call to Xalan C++
to perform the transformation since I think it would greatly
enhance our performance.  What do you think?

Currently I have a simple JNI implementation that takes in two
string args.  One for the xml source and the second for the path
to an xslt file.  Ideally I am attempting to convert these to
streams and use these streams to perform the transformation. 
Using the SimpleTransform code, I compiled it into my source
however, when I try to run it from java, I get the following
error:

# 
# An EXCEPTION_ACCESS_VIOLATION exception has been detected in
native code outside the VM.
# Program counter=0x8fd2b94
#
# 
# An EXCEPTION_ACCESS_VIOLATION exception has been detected in
native code outside the VM.
# Program counter=0x8fd2c63
#
# 
# An EXCEPTION_ACCESS_VIOLATION exception has been detected in
native code outside the VM.
# Program counter=0x245c8a53
#

interestigly enough, just before XSLTEngineImpl::process method.
 I threw in lots of couts and the last one that prints is just
before process then the above messages appear.  The first thing
I was hoping to accomplish was to be able to run SimpleTransform
from a java call just to get it working.

I have a suspicious feeling that this error might be a VM bug.  

My questions are has anyone successfully done this?  Is it
feasible for performance gains?  Your advice is much
appreciated.  

Respectfully,
Mike G.
BusinessEdge Solutions

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Re: Using native call to Xalan-C++ from Java

Posted by Mike Garcia <mi...@yahoo.com>.
Got it to work.  We are now able to make native calls to
Xalan-C++ from Java with an over 850% performance improvement
with our xml/xslt files.  The xml test file size I'm using is
18.6KB and the xslt file size is 12.2KB.  We expect these to
grow substantially in production.  

Our current usage is to give two strings to the java method, 1)
pathToXml file, 2) pathToXsl file which returns the transformed
string.  

I noted a 4.00 second transformation time with the Java
implementation and a 0.47 second t-time with the C++ imp.  These
times are averages for 10 runs for each implementation.  

Environment: Win2000, P3-600MHz, JDK1.3, Xalan-C++ 1.1

Many thanks to the Xalan-C++ developers.  Your app rocks!!  We
will no doubt be using it in our production system once
management sees these numbers.  

respectfully,
mike g.
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII


--- Paul Winder <pw...@arbortext.com> wrote:
> We just tested 1.3.1 for Solaris in our environment and the
> crash is gone.
> 
> Evidently there is a bug in 1.3.02 on Solaris; perhaps on HP
> too...?
> 
> Paul
> 
> At 07:36 AM 6/4/01 -0700, Mike Garcia wrote:
> >Hey Paul,
> >Glad to hear someone else is working on this too.  We are
> using
> >Java1.3 on HP but I develop on NT.  Right now we use Xalan
> Java
> >for our transformer but after messing around with Xalan C++
> it
> >would be great to be able to make a native call since the
> >performance increase would be substantial.
> >
> >I can get the app to work solo but, when I try to pass in the
> >data to my JNI implementation it crashes.  I'm stuck at this
> >point trying to figure it out.
> >
> >Mike
> >
> >This seems like some
> >--- Paul Winder <pw...@arbortext.com> wrote:
> > > Hi Mike,
> > >
> > > Just out of curiosity, what JVM are you using?
> > >
> > > We're running XalanJ under JNI, and we've found that it
> > > crashes with the
> > > 1.3.02 Solaris JVM from Sun.
> > > We had to revert to 1.2.2.
> > >
> > > I'd be interested to hear how your adaptation goes, since
> one
> > > of the
> > > reasons we decided to use Xalan was the availability of
> the
> > > C++ implementation.
> > >
> > > Paul Winder
> > > Arbortext
> > >
> > > At 10:17 AM 5/29/01 -0700, you wrote:
> > > >Hello Xalan Developers,
> > > >
> > > >Please reply to my email address.
> > > >
> > > >We have been using Xalan Java for a while on our project
> but
> > > are
> > > >noticing that its relatively slow when compared to Xalan
> C++
> > > (
> > > >using the command line for both with samples of our
> xml/xslt
> > > >files).  I'm noticing about .0005 seconds for the C++
> > > >transformation and a 2.5 second transformation for java,
> on
> > > >average.  I'd like to be able to make a native call to
> Xalan
> > > C++
> > > >to perform the transformation since I think it would
> greatly
> > > >enhance our performance.  What do you think?
> > > >
> > > >Currently I have a simple JNI implementation that takes
> in
> > > two
> > > >string args.  One for the xml source and the second for
> the
> > > path
> > > >to an xslt file.  Ideally I am attempting to convert
> these to
> > > >streams and use these streams to perform the
> transformation.
> > > >Using the SimpleTransform code, I compiled it into my
> source
> > > >however, when I try to run it from java, I get the
> following
> > > >error:
> > > >
> > > >#
> > > ># An EXCEPTION_ACCESS_VIOLATION exception has been
> detected
> > > in
> > > >native code outside the VM.
> > > ># Program counter=0x8fd2b94
> > > >#
> > > >#
> > > ># An EXCEPTION_ACCESS_VIOLATION exception has been
> detected
> > > in
> > > >native code outside the VM.
> > > ># Program counter=0x8fd2c63
> > > >#
> > > >#
> > > ># An EXCEPTION_ACCESS_VIOLATION exception has been
> detected
> > > in
> > > >native code outside the VM.
> > > ># Program counter=0x245c8a53
> > > >#
> > > >
> > > >interestigly enough, just before XSLTEngineImpl::process
> > > method.
> > > >  I threw in lots of couts and the last one that prints
> is
> > > just
> > > >before process then the above messages appear.  The first
> > > thing
> > > >I was hoping to accomplish was to be able to run
> > > SimpleTransform
> > > >from a java call just to get it working.
> > > >
> > > >I have a suspicious feeling that this error might be a VM
> > > bug.
> > > >
> > > >My questions are has anyone successfully done this?  Is
> it
> > > >feasible for performance gains?  Your advice is much
> > > >appreciated.
> > > >
> > > >Respectfully,
> > > >Mike G.
> > > >BusinessEdge Solutions
> > > >
> > > >__________________________________________________
> > > >Do You Yahoo!?
> > > >Yahoo! Auctions - buy the things you want at great prices
> > > >http://auctions.yahoo.com/
> > >
> > >
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Get personalized email addresses from Yahoo! Mail - only $35
> >a year!  http://personal.mail.yahoo.com/
> 
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Re: Using native call to Xalan-C++ from Java

Posted by Paul Winder <pw...@arbortext.com>.
We just tested 1.3.1 for Solaris in our environment and the crash is gone.

Evidently there is a bug in 1.3.02 on Solaris; perhaps on HP too...?

Paul

At 07:36 AM 6/4/01 -0700, Mike Garcia wrote:
>Hey Paul,
>Glad to hear someone else is working on this too.  We are using
>Java1.3 on HP but I develop on NT.  Right now we use Xalan Java
>for our transformer but after messing around with Xalan C++ it
>would be great to be able to make a native call since the
>performance increase would be substantial.
>
>I can get the app to work solo but, when I try to pass in the
>data to my JNI implementation it crashes.  I'm stuck at this
>point trying to figure it out.
>
>Mike
>
>This seems like some
>--- Paul Winder <pw...@arbortext.com> wrote:
> > Hi Mike,
> >
> > Just out of curiosity, what JVM are you using?
> >
> > We're running XalanJ under JNI, and we've found that it
> > crashes with the
> > 1.3.02 Solaris JVM from Sun.
> > We had to revert to 1.2.2.
> >
> > I'd be interested to hear how your adaptation goes, since one
> > of the
> > reasons we decided to use Xalan was the availability of the
> > C++ implementation.
> >
> > Paul Winder
> > Arbortext
> >
> > At 10:17 AM 5/29/01 -0700, you wrote:
> > >Hello Xalan Developers,
> > >
> > >Please reply to my email address.
> > >
> > >We have been using Xalan Java for a while on our project but
> > are
> > >noticing that its relatively slow when compared to Xalan C++
> > (
> > >using the command line for both with samples of our xml/xslt
> > >files).  I'm noticing about .0005 seconds for the C++
> > >transformation and a 2.5 second transformation for java, on
> > >average.  I'd like to be able to make a native call to Xalan
> > C++
> > >to perform the transformation since I think it would greatly
> > >enhance our performance.  What do you think?
> > >
> > >Currently I have a simple JNI implementation that takes in
> > two
> > >string args.  One for the xml source and the second for the
> > path
> > >to an xslt file.  Ideally I am attempting to convert these to
> > >streams and use these streams to perform the transformation.
> > >Using the SimpleTransform code, I compiled it into my source
> > >however, when I try to run it from java, I get the following
> > >error:
> > >
> > >#
> > ># An EXCEPTION_ACCESS_VIOLATION exception has been detected
> > in
> > >native code outside the VM.
> > ># Program counter=0x8fd2b94
> > >#
> > >#
> > ># An EXCEPTION_ACCESS_VIOLATION exception has been detected
> > in
> > >native code outside the VM.
> > ># Program counter=0x8fd2c63
> > >#
> > >#
> > ># An EXCEPTION_ACCESS_VIOLATION exception has been detected
> > in
> > >native code outside the VM.
> > ># Program counter=0x245c8a53
> > >#
> > >
> > >interestigly enough, just before XSLTEngineImpl::process
> > method.
> > >  I threw in lots of couts and the last one that prints is
> > just
> > >before process then the above messages appear.  The first
> > thing
> > >I was hoping to accomplish was to be able to run
> > SimpleTransform
> > >from a java call just to get it working.
> > >
> > >I have a suspicious feeling that this error might be a VM
> > bug.
> > >
> > >My questions are has anyone successfully done this?  Is it
> > >feasible for performance gains?  Your advice is much
> > >appreciated.
> > >
> > >Respectfully,
> > >Mike G.
> > >BusinessEdge Solutions
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Yahoo! Auctions - buy the things you want at great prices
> > >http://auctions.yahoo.com/
> >
> >
>
>
>__________________________________________________
>Do You Yahoo!?
>Get personalized email addresses from Yahoo! Mail - only $35
>a year!  http://personal.mail.yahoo.com/



Re: Using native call to Xalan-C++ from Java

Posted by Mike Garcia <mi...@yahoo.com>.
Hey Paul,
Glad to hear someone else is working on this too.  We are using
Java1.3 on HP but I develop on NT.  Right now we use Xalan Java
for our transformer but after messing around with Xalan C++ it
would be great to be able to make a native call since the
performance increase would be substantial.  

I can get the app to work solo but, when I try to pass in the
data to my JNI implementation it crashes.  I'm stuck at this
point trying to figure it out.  

Mike

This seems like some 
--- Paul Winder <pw...@arbortext.com> wrote:
> Hi Mike,
> 
> Just out of curiosity, what JVM are you using?
> 
> We're running XalanJ under JNI, and we've found that it
> crashes with the 
> 1.3.02 Solaris JVM from Sun.
> We had to revert to 1.2.2.
> 
> I'd be interested to hear how your adaptation goes, since one
> of the 
> reasons we decided to use Xalan was the availability of the
> C++ implementation.
> 
> Paul Winder
> Arbortext
> 
> At 10:17 AM 5/29/01 -0700, you wrote:
> >Hello Xalan Developers,
> >
> >Please reply to my email address.
> >
> >We have been using Xalan Java for a while on our project but
> are
> >noticing that its relatively slow when compared to Xalan C++
> (
> >using the command line for both with samples of our xml/xslt
> >files).  I'm noticing about .0005 seconds for the C++
> >transformation and a 2.5 second transformation for java, on
> >average.  I'd like to be able to make a native call to Xalan
> C++
> >to perform the transformation since I think it would greatly
> >enhance our performance.  What do you think?
> >
> >Currently I have a simple JNI implementation that takes in
> two
> >string args.  One for the xml source and the second for the
> path
> >to an xslt file.  Ideally I am attempting to convert these to
> >streams and use these streams to perform the transformation.
> >Using the SimpleTransform code, I compiled it into my source
> >however, when I try to run it from java, I get the following
> >error:
> >
> >#
> ># An EXCEPTION_ACCESS_VIOLATION exception has been detected
> in
> >native code outside the VM.
> ># Program counter=0x8fd2b94
> >#
> >#
> ># An EXCEPTION_ACCESS_VIOLATION exception has been detected
> in
> >native code outside the VM.
> ># Program counter=0x8fd2c63
> >#
> >#
> ># An EXCEPTION_ACCESS_VIOLATION exception has been detected
> in
> >native code outside the VM.
> ># Program counter=0x245c8a53
> >#
> >
> >interestigly enough, just before XSLTEngineImpl::process
> method.
> >  I threw in lots of couts and the last one that prints is
> just
> >before process then the above messages appear.  The first
> thing
> >I was hoping to accomplish was to be able to run
> SimpleTransform
> >from a java call just to get it working.
> >
> >I have a suspicious feeling that this error might be a VM
> bug.
> >
> >My questions are has anyone successfully done this?  Is it
> >feasible for performance gains?  Your advice is much
> >appreciated.
> >
> >Respectfully,
> >Mike G.
> >BusinessEdge Solutions
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Auctions - buy the things you want at great prices
> >http://auctions.yahoo.com/
> 
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Re: Using native call to Xalan-C++ from Java

Posted by Paul Winder <pw...@arbortext.com>.
Hi Mike,

Just out of curiosity, what JVM are you using?

We're running XalanJ under JNI, and we've found that it crashes with the 
1.3.02 Solaris JVM from Sun.
We had to revert to 1.2.2.

I'd be interested to hear how your adaptation goes, since one of the 
reasons we decided to use Xalan was the availability of the C++ implementation.

Paul Winder
Arbortext

At 10:17 AM 5/29/01 -0700, you wrote:
>Hello Xalan Developers,
>
>Please reply to my email address.
>
>We have been using Xalan Java for a while on our project but are
>noticing that its relatively slow when compared to Xalan C++ (
>using the command line for both with samples of our xml/xslt
>files).  I'm noticing about .0005 seconds for the C++
>transformation and a 2.5 second transformation for java, on
>average.  I'd like to be able to make a native call to Xalan C++
>to perform the transformation since I think it would greatly
>enhance our performance.  What do you think?
>
>Currently I have a simple JNI implementation that takes in two
>string args.  One for the xml source and the second for the path
>to an xslt file.  Ideally I am attempting to convert these to
>streams and use these streams to perform the transformation.
>Using the SimpleTransform code, I compiled it into my source
>however, when I try to run it from java, I get the following
>error:
>
>#
># An EXCEPTION_ACCESS_VIOLATION exception has been detected in
>native code outside the VM.
># Program counter=0x8fd2b94
>#
>#
># An EXCEPTION_ACCESS_VIOLATION exception has been detected in
>native code outside the VM.
># Program counter=0x8fd2c63
>#
>#
># An EXCEPTION_ACCESS_VIOLATION exception has been detected in
>native code outside the VM.
># Program counter=0x245c8a53
>#
>
>interestigly enough, just before XSLTEngineImpl::process method.
>  I threw in lots of couts and the last one that prints is just
>before process then the above messages appear.  The first thing
>I was hoping to accomplish was to be able to run SimpleTransform
>from a java call just to get it working.
>
>I have a suspicious feeling that this error might be a VM bug.
>
>My questions are has anyone successfully done this?  Is it
>feasible for performance gains?  Your advice is much
>appreciated.
>
>Respectfully,
>Mike G.
>BusinessEdge Solutions
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Auctions - buy the things you want at great prices
>http://auctions.yahoo.com/