Subject Re: [Firebird-Java] Driver Speed Tests - Patch
Author David Jencks
This is definitely an improvement. I think the question is whether the
data is ever updated after the string is created. I think it can be if you
clone a default cri and then modify it.

I wrote a slightly different version with a StringClumplet class that never
needs to create a string, and committed it. Could you see how the
performance compares to what you came up with?

Many thanks for finding this bottleneck and figuring out what to do about
it!

david jencks



On 2002.10.17 16:04:20 -0400 Ken Richard wrote:
> This patch adds a "findString" method to the clumplet. The findString
> is implemented by caching the string representation of the content -
> only after the first time that content is requested. I did notice a
> performance gain in my tests. Would you review the patch and apply it
> if you feel that it is acceptable? My question would be - does the data
> inside the clumplet ever change after it created?
>
>
>
> C:\dev\firebird>call cvs
> -d:pserver:anonymous@...:/cvsroot/firebird/
> login
> (Logging in to anonymous@...)
>
> C:\dev\firebird>call cvs -z3
> -d:pserver:anonymous@...:/cvsroot/firebird diff
> client-java
> ? client-java/.cvspass
> ? client-java/output
> ? client-java/thirdparty
> Index: client-java/src/main/org/firebirdsql/gds/Clumplet.java
> ===================================================================
> RCS file:
> /cvsroot/firebird/client-java/src/main/org/firebirdsql/gds/Clumplet.java
> ,v
> retrieving revision 1.2
> diff -r1.2 Clumplet.java
> 41c41,43
> <
> ---
> >
> > String findString(int type);
> >
> Index:
> client-java/src/main/org/firebirdsql/jca/FBConnectionRequestInfo.java
> ===================================================================
> RCS file:
> /cvsroot/firebird/client-java/src/main/org/firebirdsql/jca/FBConnectionR
> equestInfo.java,v
> retrieving revision 1.2
> diff -r1.2 FBConnectionRequestInfo.java
> 80,89c80,84
> < if (c == null)
> < {
> < return null;
> < } // end of if ()
> < if (c.find(type) == null)
> < {
> < return null;
> < } // end of if ()
> < return new String(c.find(type));
> < }
> ---
> > if (c == null) {
> > return null;
> > }
> > return c.findString(type);
> > }
> Index: client-java/src/main/org/firebirdsql/jgds/ClumpletImpl.java
> ===================================================================
> RCS file:
> /cvsroot/firebird/client-java/src/main/org/firebirdsql/jgds/ClumpletImpl
> .java,v
> retrieving revision 1.2
> diff -r1.2 ClumpletImpl.java
> 45a46
> > String cachedString = null;
> 85a87,99
> >
> > public String findString(int type) {
> > if (type==this.type) {
> > if (cachedString==null) {
> > cachedString = new String(content);
> > }
> > return cachedString;
> > }
> > if (next==null) {
> > return null;
> > }
> > return next.findString(type);
> > }
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>