REXML performance gap between XP and OS X

I usually don’t notice these things as the differences are usually
irrelevant, but this one has triggered my curiosity:
I get a significant diference in performance using REXML betweeen OS X
and Windows XP. And with significant, I mean a factor of 4 with Windows
beeing the slower.
I expected XP to be slower, since I’m running a Parallels VM, but not
that much.
A bit of context: I have a 3.2 MB XML file and I am running several
XPath expressions over it collecting elements.

Two of these expressions are //element_name so that takes a bit of time.

Here are the results of a unit test on OS X
[20070906 16:00:39] INFO: Product groups parsed in 4.142405 seconds
[20070906 16:00:43] INFO: Activity groups parsed in 4.319004 seconds

and the same unit test on Windows XP
[20070906 16:01:49] INFO: Product groups parsed in 15.142 seconds
[20070906 16:02:07] INFO: Activity groups parsed in 18.497 seconds

Windows runs of my BootCamp partition in a Parallels VM with Coherence
enabled and 850 MB of memory.
Even considering the drop in performance the VM incurs I still think a
factor of 4 is a bit much.
Results have been consistent, meaning repeated runs give results in the
same ballpark (depending on what I am doing at the time the unit test
runs things run a bit faster sometimes).
The windows-based unit tests exhibit a worsening of performance as the
load on the CPU increases which is not linear to the worsening of the
test’s performance on OS X:
on a clean system with just the VM loaded, the difference is a factor of
~3.5: ~2 seconds for the OS X test per parsing and ~7 seconds on XP but
I can attribute that to the tuning of the VM which favors OS X

Any thoughts? Can it be that the VM influences performance so much?
If I get the time I’ll boot BootCamp and see what native XP does.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs