Re: ofstream buffer not working in libc++?
Re: ofstream buffer not working in libc++?
- Subject: Re: ofstream buffer not working in libc++?
- From: "Mills, Steve" <email@hidden>
- Date: Wed, 09 Apr 2014 15:06:24 +0000
- Thread-topic: ofstream buffer not working in libc++?
On Apr 8, 2014, at 23:33:08, Mills, Steve <email@hidden> wrote:
> We use an ofstream to write large files. I found that a larger buffer (32k, set via stream.rdbuf().pubsetbuf(buf, syz)) resulted in better performance than the standard buffer (4k), when we were using libstdc++. Now that we've switched to libc++ so we can use C++11, it seems as if the buffer is not being utilized at all. Performance has slowed considerably, and I don't see the data we stream out ever appear in the buffer. And if I stick with the standard buffer by not calling pubsetbuf, I never see the default buffer get changed either.
>
> Is buffered file writing broken in Xcode 5.1's libc++?
I found the problem. If you reuse the stream for more than one file, and set the buffer after the first one, it doesn't use your buffer and slows to a crawl (it takes 3 times as long to write ~20M file). Seems buggy to me, since it worked correctly when using libstdc++.
--
Steve Mills
office: 952-818-3871
home: 952-401-6255
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden