wtorek, października 31, 2017

Rynek twierdzi, że złoty będzie się umacniał


wtorek, października 24, 2017

The simplest bash scripts to build ears and projlibs


wtorek, października 17, 2017

What is the overhead of Java reflection in Tibco BW?

Let's create 2 processes: one with 2 plain Java measurement activities using System.nanoTime() (Run1) and one with mapper between them (Run1). When we substract nano times we measure time between: output from Java activity, transition, input to Java activity - which would be the same as combined Java execution. Now, time Run2 - Run1 is overhead of Java reflection over simple mapper activity. Let's measure with many repetitions. On Intel Core i7-6820HQ 2.7GHz overhead is below 0.2ms.



środa, października 04, 2017

Parallel transitions in BW 5

In Tibco Designer we can draw parallel transitions, but how are they executed? In parallel? The answer is: no, not quite. Let's create a simple process printing to console Thread.currentThread()+"@"+System.currentTimeMillis() before and after calling HTTP request reply and put it 9 times in different transitions. We see that all activities before HTTP are executed sequentially by the same JobCourier thread and all activities after HTTP are executed by another thread from JobPool, the same for all 9 calls. Please notice that HTTP call is not performed inline. It is executed by dedicated thread pool different than Engine.ThreadCount pool. After the work is queued the process is suspended and its JobCourier is returned to the pool. When HTTP is done Engine seeks for the first unused (round robin) JobCourier thread and resumes main process. Dedicated thread pool is the place where multithreading is utilized.

Let's try to replace HTTP call with plain Sleep, parameterized with integer from 1 to 1000. We see that Sleep in not performed inline. Thread is taken away from process and then returned. Even Sleep(1ms) causes thread switch.