They are 2 different languages in design, and should be treated as such.
C is a low-level, executable-compiled language, that can do low-level hardware operations such as dynamic memory allocation, and accessing hardware drivers at a very low level. C is normally faster than Java, if it is written efficiently, but it always depends on the compiler. Some compilers support optimization on the compile time, to produce more efficient code, by removing redundant code and other unnecessary artefacts.
One reason that people say C is faster is because you can do allot more with it, such as use low-level multi threading, memory allocation (Via malloc), and other operations that could speed up the program's operation considerably.
Java, on the other hand, is compiled to JVM bytecode, which depends entirely on the JVM (Written in C++) for it's speed. Java has allot less low-level functionality than C, and therefore loses speed in some cases, where C would run allot faster.
Overall, the general reasons your program could lose performance in C is the fact that you
- Used a bad compiler
- Wrote inefficient code
- Used slower functions, structures, etc.
But, in most cases, C normally runs considerably faster, and is known to have that over Java, which is one reason it lies at the core of most operating systems, and other advanced software.