mmap() in C/C++ vs. Java

B

beejisbrigit

Hi there,

I was wondering if anyone had experience with File I/O in Java vs. C/C+
+ using mmap(),
and knew if the performance was better in one that the other, or more
or less negligible.
My instinct would say C/C++ is faster, but Java has made some
improvements with its
FileChannel class.

The situation is that a 1GB is to be loaded into memory and indexed as
the user needed.

thanks!
brigit.
 
U

user923005

Hi there,

I was wondering if anyone had experience with File I/O in Java vs. C/C+
+ using mmap(),
and knew if the performance was better in one that the other, or more
or less negligible.
My instinct would say C/C++ is faster, but Java has made some
improvements with its
FileChannel class.

The situation is that a 1GB is to be loaded into memory and indexed as
the user needed.

Memory mapping is OS specific.
Any support for memory mapping is a compiler extension and not
directly supported by the C language per se.
Probably, you want Of course, you'll read their FAQ first:
http://www.erlenstar.demon.co.uk/unix/
 
S

santosh

Hi there,

I was wondering if anyone had experience with File I/O in Java vs. C/C+
+ using mmap(),
and knew if the performance was better in one that the other, or more
or less negligible.
My instinct would say C/C++ is faster, but Java has made some
improvements with its
FileChannel class.

The situation is that a 1GB is to be loaded into memory and indexed as
the user needed.

thanks!
brigit.

There's no such language called 'C/C++'. The C and C++ languages
differ in subtle but important ways. Though they have a shared
history, they're better thought of as similar but distinct languages
rather than as "C/C++."

Now coming to your question, though I don't know about Java, but C and
C++ don't provide any native support for memory-mapped I/O. It's more
a facility of the underlying operating system and it's relative
performance is probably dependant on a lot of disparate factors, over
which the languages themselves are likely to have little, if any,
control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top