Evgeny, > Maybe i will try to describe my situation more detailly to > explain what issues i'm facing. > > I have restlet-based serivce that exposes some XML documents. > It's perfomance is tested with ab and satisfies my needs :)
Cool :) > At client side i have some JSP that are using my service. In > JSP code i'm writing smth like. > > Client client = new Client(Protocol.HTTP); > client.getContext() > Response resp = client.get(......); > > XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); > XmlPullParser xpp = factory.newPullParser(); > xpp.setInput(resp.getEntity().getStream(), "UTF-8"); > > And as a result i'm having huge delays for getting the XML text. I've > discovered it with tests that measures delays of ccertain operation. > My client uses java.net.HttpURLConnection-based connector class. > > Then i decided to try use simple URLConnection approach. > > URLConnection con = new URL(....).openConnection(); > ((HttpURLConnection)con).setRequestMethod("GET"); > con.setDoOutput(true); > > XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); > XmlPullParser xpp = factory.newPullParser(); > xpp.setInput(con.getInputStream(), "UTF-8"); > > And according to timing delays for getting XML reduced 4-5 times. > So i'm not thinking that restlet client is workign so slow > and wanted someone > to advice if i'm usign Client instances incorrectly. Thanks for sharing this experience. The observed performance is very surprising to me, there is really no technical reason for such an overhead, the code inside the connector should be straightforward and cause no noticeable delay. Could you drill down the Restlet source code to give us indication of where this time is spent, maybe using a profiling tool? Best regards, Jerome