ArchiveOrangemail archive

An SMB/CIFS client implementation in Java.


jcifs.lists.samba.org
(List home) (Recent threads) (19 other Samba lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Low traffic list: less than 3 messages per day
  • This list contains about 10,118 messages, beginning Dec 2003
  • 0 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

Does jcifs use an internal buffer

Ad
Christoph Held 1120735844Thu, 07 Jul 2005 11:30:44 +0000 (UTC)
Fujitsu EST is delivering jcifs with the Fujitsu Enabler product. 

I am wondering if jcifs uses an internal buffer.

I have noticed that the read() function of SmbFileInputStream class is quite 
slow. Wrapped in a BufferedInputStream the read() function of 
BufferedInputStream is about 500 times faster. The conclusion is, that jcifs 
does not use an internal buffer (at least in our configuration).

My questions are:
1. Is this conclusion correct?
2. Should we recommend our customers, always to wrap the SmbFileInputStream in 
a BufferedInputStream?

(I am not a real developer and the answers are not obvious to me)

Greetings

Christoph Held
Fujitsu EST_______________________________________________________________________________
This message has been scanned for all known virus by OMNIQuad Mailwall Remote.
Michael B Allen 1120773236Thu, 07 Jul 2005 21:53:56 +0000 (UTC)
Christoph Held said:
> Fujitsu EST is delivering jcifs with the Fujitsu Enabler product.
>
> I am wondering if jcifs uses an internal buffer.
>
> I have noticed that the read() function of SmbFileInputStream class is
> quite
> slow. Wrapped in a BufferedInputStream the read() function of
> BufferedInputStream is about 500 times faster. The conclusion is, that
> jcifs
> does not use an internal buffer (at least in our configuration).
>
> My questions are:
> 1. Is this conclusion correct?Yes, SmbFileInputStream (like FileInputStream) is not buffered. The byte[]
buffer provided to read() is passed directly to the underlying socket
read(). If you're seeing poor performance you should try a larger byte[]
buffer or perhaps wrap it in a BufferedInputStream. It really depends on
the situation.> 2. Should we recommend our customers, always to wrap the
> SmbFileInputStream in
> a BufferedInputStream?I don't know about "always". If you use a sufficiently large byte[] buffer
(e.g. 8192) I don't think you should see any real performance difference.
If anything the direct read should actually be faster. With the
BufferedInputStream you're doing two System.arraycopys.

You could just add a little note in your docs like:

"Note: SmbFileInputStream and SmbFileOutputStream are not buffered. It may
be desireable to wrap these with BufferedInputStream and
BufferedOutputStream respectively depending on the situation."

Mike
Christoph Held 1120825008Fri, 08 Jul 2005 12:16:48 +0000 (UTC)
Hallo Inge,

die Antwort auf die JCIFS Frage von dem JCIFS Forum:

----------  Weitergeleitete Nachricht  ----------

Subject: Re: [jcifs] Does jcifs use an internal buffer
Date: Donnerstag, 7. Juli 2005 23:53
From: Christoph Held 
To: "Christoph Held" Cc: 

Christoph Held said:
> Fujitsu EST is delivering jcifs with the Fujitsu Enabler product.
>
> I am wondering if jcifs uses an internal buffer.
>
> I have noticed that the read() function of SmbFileInputStream class is
> quite
> slow. Wrapped in a BufferedInputStream the read() function of
> BufferedInputStream is about 500 times faster. The conclusion is, that
> jcifs
> does not use an internal buffer (at least in our configuration).
>
> My questions are:
> 1. Is this conclusion correct?Yes, SmbFileInputStream (like FileInputStream) is not buffered. The byte[]
buffer provided to read() is passed directly to the underlying socket
read(). If you're seeing poor performance you should try a larger byte[]
buffer or perhaps wrap it in a BufferedInputStream. It really depends on
the situation.> 2. Should we recommend our customers, always to wrap the
> SmbFileInputStream in
> a BufferedInputStream?I don't know about "always". If you use a sufficiently large byte[] buffer
(e.g. 8192) I don't think you should see any real performance difference.
If anything the direct read should actually be faster. With the
BufferedInputStream you're doing two System.arraycopys.

You could just add a little note in your docs like:

"Note: SmbFileInputStream and SmbFileOutputStream are not buffered. It may
be desireable to wrap these with BufferedInputStream and
BufferedOutputStream respectively depending on the situation."

Mike

-------------------------------------------------------_______________________________________________________________________________
This message has been scanned for all known virus by OMNIQuad Mailwall Remote.
Home | About | Privacy