Mirko Buholzer escribió:
> 
> Hi all ...
> 
> I am just writing some portlets connecting to external sources and had some
> ideas on how to enhance the request performance (processing time).
> 
> As I understand, Jetspeed calls every getContent() of a portlet in a
> sequential way. This means if a portlet waits for an answer of a third party system,
> the hole request will wait till this third party system has answered.
> So if you have 3 portlets in a portal screen connecting to different third
> party systems a request in the jetspeed engine would look like this.
> 
> --
> request                                     time
>   -> portlet01.getContent()
>        -> connect to third party system      10 ms
>        -> wait for result                    90 ms
>        -> porcess and return result          10 ms
>   -> portlet02.getContent()
>        -> connect to third party system      10 ms
>        -> wait for result                   160 ms
>        -> porcess and return result          10 ms
>   -> portlet03.getContent()
>        -> connect to third party system      10 ms
>        -> wait for result                   120 ms
>        -> porcess and return result          10 ms
> return result
> --                      processing time     420 ms
> 
> Another solution to handle this request is by a thread pool which will
> call the getContent() method of each portlet in parallel, the request would
> look like this.
> 
> -->
> request                                     time
>   -> portlet01.getContent()
>        -> connect to third party system      10 ms
>   -> portlet02.getContent()
>        -> connect to third party system      10 ms
>   -> portlet02.getContent()
>        -> connect to third party system      10 ms
>        -> wait for result                   160 ms
>        -> porcess and return result          10 ms
>        -> porcess and return result          10 ms
>        -> porcess and return result          10 ms
> return result
> <--                      processing time     220 ms
> 
> The processing time for a request would be pretty faster. Even when adding
> some time for thread handling and synchronization would beat the sequential
> method. Or do I oversee something?
> 
> 

Because of the disk and portlet caches, the second and succesive times
that the call happens it should be much faster, and most of the
resources required are CPU cycles. Nevertheless, it looks like a
possible improvement, specially in multiprocessor machines.

In a single processor I would not expect big gains.

It would require changes to the way the thread pool is managed,
specially having priorities in the ThreadPool, so that "layout" threads
have higher priority than "refresher" threads.

We should be aware of the multithreading issues of such a change,
specially since some multithreading issues are still not completely
clear yet in the curent implementation.


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?:          [EMAIL PROTECTED]

Reply via email to