Hi, Adi!
> performance. (I added
> array support to it and tested an array of 200 values, which took
> ~1 sec to serialize under mod_perl).
I see I wasn't the only person who starts with adding Array support
to it and I even made my copy of it SOAP1.1 compliant, but then Keith
came with his compliant version.
As for performance, I tried and got similar results on my machine. I
don't know your environment, so I included all my scripts, so you may
try them on your machine and let us know.
Anyway, here is my results (win98):
Benchmark: timing 10 iterations of 100x100, 1x100...
100x100: 10 wallclock secs ( 9.72 usr + 0.00 sys = 9.72 CPU) @
1.03/s (n=10)
1x100: 9 wallclock secs ( 9.17 usr + 0.00 sys = 9.17 CPU) @
1.09/s (n=10)
So, time is about 1 sec for roundtrip to mod_perl (serialization -
deserialization - invocation - serialization - deserialization)
Time for serialization only is different:
Benchmark: timing 100 iterations of (1)x200, (1x100)x200...
(1)x200: 23 wallclock secs (23.34 usr + 0.00 sys = 23.34 CPU) @
4.28/s (n=100)
(1x100)x200: 25 wallclock secs (24.99 usr + 0.00 sys = 24.99 CPU) @
4.00/s (n=100)
So, about 4 times bette. Same script on Linux (serialization only):
Benchmark: timing 100 iterations of (1)x200, (1x100)x200...
(1)x200: 5 wallclock secs ( 5.53 usr + 0.01 sys = 5.54 CPU)
(1x100)x200: 6 wallclock secs ( 5.79 usr + 0.02 sys = 5.81 CPU)
About 18 times a second.
Try these scripts in your environment for better results.
# Serialization ================================================
use SOAP::Lite;
use Benchmark;
$s = SOAP::Serializer->new;
$array1 = [(1) x 200];
$array100 = [(1x100) x 200];
Benchmark::timethese(100, {
'(1)x200' => sub { $s->method(a => $array1) },
'(1x100)x200' => sub { $s->method(a => $array100) },
})
# mod_perl ================================================
use SOAP::Lite;
$s = SOAP::Lite
-> uri('http://www.soaplite.com/My/Parameters')
-> proxy('http://localhost/soap')
;
use Benchmark;
$s->echo; # ignore first call, don't give a start to the first one
$array1 = [(1) x 200];
$array100 = [(1 x 100) x 200];
Benchmark::timethese(10, {
'1x100' => sub { $s->echo($array1) },
'100x100' => sub { $s->echo($array100) },
})
# ================================================
> second(!) to serialize a large data structure. I believe the
> reason is that it
> makes method calls for every element in the Perl data structure,
> and method
> calls in Perl are inefficient due to the symbol table lookups and
> @ISA
> checking. So the larger the data structure the worse the
That's right, but first Perl caches calls that involve inheritance
and second, I use the same scheme, because arrays can have everything
inside and I need to call serialization function for every element in
array. I did profiling for several versions and did some
improvements, but there is no obvious stopper.
> I am currently using SOAP, because I like the DM design, but I
> would switch to
> SOAP::Lite if its serialization speed is significantly better.
I'd like to know your results, with your Array implementation. Thank
you.
Best wishes, Paul.
--- Adi Fairbank <[EMAIL PROTECTED]> wrote:
> Paul,
>
> I've done some work on Keith Brown's SOAP module, and I like its
> design, but one
> thing I noticed is that it is slow. Even under mod_perl, it can
> take up to 1
> second(!) to serialize a large data structure. I believe the
> reason is that it
> makes method calls for every element in the Perl data structure,
> and method
> calls in Perl are inefficient due to the symbol table lookups and
> @ISA
> checking. So the larger the data structure the worse the
> performance. (I added
> array support to it and tested an array of 200 values, which took
> ~1 sec to serialize under mod_perl).
>
> I'd be interested in speed comparisons between SOAP and SOAP::Lite.
> I've looked
> at your code, but not actually run it. It doesn't look like you
> use recursive
> method calls the way Keith does. Have you done any benchmarks on
> large data
> structure serialization? I assume deserialization performance will
> be roughly
> equivalent for SOAP vs. SOAP::Lite since they both use XML::Parser.
> I read the
> PERFORMANCE section on base64 encoding, but it didn't mention
> serialization
> speed.
>
> I am currently using SOAP, because I like the DM design, but I
> would switch to
> SOAP::Lite if its serialization speed is significantly better.
>
> Cheers,
> -Adi
>
> Paul Kulchenko wrote:
> >
> > > you are dedicated to supporting the full SOAP API (not sure
> what
> > > SOAP::Lite leaves out).
> > First thing I did seven months ago was my email to Keith Brown
> > (author of DM's SOAP/Perl module) about possible ways for
> cooperation
> > and I'v been told that he's willing to, but design of his module
> > should be consistent with other DM's implementations and he has
> no
> > plans to change it. There was no easy way to combine our efforts
> and
> > I came up with another implementation. Don't want to praise
> myself,
> > but feature set seems to be pretty comparable with other
> toolkits. I
> > took ::Lite, just because SOAP namespace was already taken. It
> does
> > much more than you can expect from something with suffix Lite.
> "Lite
> > suffix reflects number of calories you should spend using this
> > module".
> >
>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/