TRANSFORMER cf SWITCH speed benchmark
Moderators: chulett, rschirm, roy
TRANSFORMER cf SWITCH speed benchmark
Has anybody ever compared the speed of TRANSFORMER stage and SWITCH stage specifically on case-like processing?
Which is one is faster?
Which is one is faster?
-
- Participant
- Posts: 28
- Joined: Mon Jan 09, 2006 1:31 pm
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 TRANSFORMER stage would be a better choice, but if u have a nested if stmt like then it is better to go for SWITCH.
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 ....
Code: Select all
if .... then .... else if... then ... and so on
With regards,
Thiru
Thiru
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
Re: TRANSFORMER cf SWITCH speed benchmark
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).
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).
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!
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
If it is based on a value, which one is faster, the Switch or Transformerray.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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact: