TRANSFORMER cf SWITCH speed benchmark

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
djoni
Participant
Posts: 98
Joined: Wed Oct 05, 2005 1:01 pm

TRANSFORMER cf SWITCH speed benchmark

Post by djoni »

Has anybody ever compared the speed of TRANSFORMER stage and SWITCH stage specifically on case-like processing?
Which is one is faster?
reachthiru
Participant
Posts: 28
Joined: Mon Jan 09, 2006 1:31 pm

Post by reachthiru »

Hi,

I have not done such a comparison. But as mentioned in the help file, SWITCH stage is analogous to C switch statement. So, if ur selection is a simple

Code: Select all

if ... then .... else ....
TRANSFORMER stage would be a better choice, but if u have a nested if stmt like

Code: Select all

if .... then .... else if... then ... and so on
then it is better to go for SWITCH.
With regards,
Thiru
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Re: TRANSFORMER cf SWITCH speed benchmark

Post by Ultramundane »

I ran some tests with a row generator (10,000,000 records) and 6 values to switch upon. The transformer ran 100,000 rows/second faster than the switch stage. 400,000 rws/sec vs 300,000 rws/sec.

I ran a test where I dropped the values c,d,e,f using the switch (drop) by only mapping a,b and used a constraint < 'c' for transformer. Again the transformer was faster. But this time by only 30,000 rws/second. 210,000 rws/second (trans) and 180,000 rws/second (switch).
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ultramundane - thanks for doing the research work that the original poster didn't :D You were more energetic than I, since the only real learning out of a question such that that can come by actually doing the exercise. Thanks!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Switch is based on a value only. Transformer (and Filter) are based on expressions. It's not comparing apples with apples. Actual results will depend on how complex the expression is. It would be interesting to include Filter stage in the comparison, as one uses an Orchestrate operator while the other uses compiled C++ code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

I tested the same examples used with the transformer and switch with the filter stage. The filter stage performed exactly the same as the transformer. For the examples I tested, the transformer and filter performed better than the switch.
djoni
Participant
Posts: 98
Joined: Wed Oct 05, 2005 1:01 pm

Post by djoni »

ray.wurlod wrote:Switch is based on a value only. Transformer (and Filter) are based on expressions. It's not comparing apples with apples. Actual results will depend on how complex the expression is. It would be interesting to include Filter stage in the comparison, as one uses an Orchestrate operator while the other uses compiled C++ code.
If it is based on a value, which one is faster, the Switch or Transformer :?:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not running on a PX site at the moment. Can't say.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

I had tested with values and the transformer and filter performed about the same. The switch was slower than the transformer and filter. However, all were fast.
Post Reply