Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25616 > unrolled thread

Re: deleting files

Started byLuuk <Luuk@invalid.lan>
First post2011-01-28 20:34 +0100
Last post2011-01-28 11:49 -0800
Articles 4 — 4 participants

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: deleting files Luuk <Luuk@invalid.lan> - 2011-01-28 20:34 +0100
    Re: deleting files Roedy Green <see_website@mindprod.com.invalid> - 2011-01-29 13:52 -0800
      Re: deleting files Arne Vajhøj <arne@vajhoej.dk> - 2011-01-29 17:13 -0500
    Re: deleting files Lew <lew@lewscanon.com> - 2011-01-28 11:49 -0800

#25616 — Re: deleting files

FromLuuk <Luuk@invalid.lan>
Date2011-01-28 20:34 +0100
SubjectRe: deleting files
Message-ID<laib18-l6o.ln1@luuk.invalid.lan>
On 28-01-11 20:00, Roedy Green wrote:
> I wrote a program to tidy up my hard disk. I run it as administrator.
> It tells me there are a fair number of junk files I cannot delete. I
> have a utility, presumably written in C, that much more rapidly scans
> my drive for junk and manages to wipe out much of the junk I could
> not.
> 
> I curious if anyone has experimented and could tell me:
> 
> 1. why in the C utility is so much faster than my utility. My code is
> basically just a bunch of File.list() with filters. What Java doing to
> dither?
> 
> 2. What is the utility doing to let it kill more files?

Whats the name of that utility, and how does you java-source look like

C is compiled code, and runs faster/more-optimized than Java which is
byte-compiled (as i remember correctly) to be platform independend, so
there a penalty at the last step....

-- 
Luuk

[toc] | [next] | [standalone]


#25674

FromRoedy Green <see_website@mindprod.com.invalid>
Date2011-01-29 13:52 -0800
Message-ID<ls29k61k8c85vkgoi86rfl4hdsqdvec3cd@4ax.com>
In reply to#25616
On Fri, 28 Jan 2011 20:34:16 +0100, Luuk <Luuk@invalid.lan> wrote,
quoted or indirectly quoted someone who said :

>C is compiled code, and runs faster/more-optimized than Java which is
>byte-compiled (as i remember correctly) to be platform independend, so
>there a penalty at the last step....

I usually use Jet to compile my Java to native code. I have examined
code and discovered that it is generally better than hand-coded
assembler since it takes into account pipelines, not just cycle counts
on individual instructions.

I would have expected finding files to delete would be an i/o bound
operation.


-- 
Roedy Green Canadian Mind Products
http://mindprod.com
To err is human, but to really foul things up requires a computer.
~ Farmer's Almanac
It is breathtaking how a misplaced comma in a computer program can
shred megabytes of data in seconds.

[toc] | [prev] | [next] | [standalone]


#25826

FromArne Vajhøj <arne@vajhoej.dk>
Date2011-01-29 17:13 -0500
Message-ID<4d449103$0$23764$14726298@news.sunsite.dk>
In reply to#25674
On 29-01-2011 16:52, Roedy Green wrote:
> On Fri, 28 Jan 2011 20:34:16 +0100, Luuk<Luuk@invalid.lan>  wrote,
> quoted or indirectly quoted someone who said :
>> C is compiled code, and runs faster/more-optimized than Java which is
>> byte-compiled (as i remember correctly) to be platform independend, so
>> there a penalty at the last step....
>
> I usually use Jet to compile my Java to native code. I have examined
> code and discovered that it is generally better than hand-coded
> assembler since it takes into account pipelines, not just cycle counts
> on individual instructions.

So you have proved that poorly written assembler is slower
than HLL.

That is hardly surprising.

But not very relevant either.

Arne

[toc] | [prev] | [next] | [standalone]


#25734

FromLew <lew@lewscanon.com>
Date2011-01-28 11:49 -0800
Message-ID<be3eb6ea-7068-4d04-947e-897f8a827307@s28g2000prb.googlegroups.com>
In reply to#25616
Luuk wrote:
> C is compiled code, and runs faster/more-optimized than Java which is

Baloney.

> byte-compiled (as i [sic] remember [in]correctly) to be platform independend, so
> there a penalty at the last step....
>

Java code gets compiled to machine code under certain circumstances,
so that statement is not universally true, even if we assume you meant
"compiled to bytecode" rather than the meaningless "byte-compiled".

We don't know from the OP if the JVM startup time is part of the
perception of slowness for the Java code.  For all we know it might
run just as fast as the C version once it gets started.

We also do not know what, if any, algorithmic differences there are
between the Java program and the C utility.  The C program might make
platform-specific low-level calls.  The speed difference might have
absolutely nothing at all whatsoever in the least to do with byte code
vs. machine code, rather due to the difference between high-level and
low-level calls.  This could also account for the observed difference
in behavior.

There's no way to answer the OP's question as it stands.  He wants to
know the difference in speed between two programs, written in
different languages, with markedly different behaviors, with no source
code available for either.  It's a bloody meaningless question -
apples and oranges.

--
Lew
Ceci n'est pas une pique.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web