Computers & Electronics

What hardware need to upgrade to run Java programs faster?

  • Last Updated:
  • Jul 4th, 2016 8:49 am
Tags:
None
[OP]
Deal Addict
Mar 7, 2010
2525 posts
304 upvotes
Mississauga

What hardware need to upgrade to run Java programs faster?

What hardware need to upgrade to run Java programs faster?
doe a separate video card help?
or its all based on CPU performance?
14 replies
Deal Addict
Apr 15, 2004
1603 posts
149 upvotes
Toronto
java runs slow no matter what.
video card wont help

is it a huge java program or is it like a java applet on a website?
[OP]
Deal Addict
Mar 7, 2010
2525 posts
304 upvotes
Mississauga
Um I am not sure actually
How about those Facebook Vegas game? Are they use Java or flash?
How can i make them run faster?
It's feels over time, if run for too long it started to get slow and lag
Deal Addict
Apr 30, 2011
3392 posts
404 upvotes
RICHMOND HILL
killer007 wrote: Um I am not sure actually
How about those Facebook Vegas game? Are they use Java or flash?
How can i make them run faster?
It's feels over time, if run for too long it started to get slow and lag
Sounds like a poorly written application that caused memory leaks.
Deal Expert
Aug 22, 2006
27311 posts
13016 upvotes
loserga wrote: Sounds like a poorly written application that caused memory leaks.
Java? Never...
/s
Deal Guru
User avatar
Feb 6, 2003
10607 posts
1016 upvotes
Vancouver
You need a good a CPU. myVegas is a beast. I once ran it at 4k resolution on a high-end gaming PC (i7-6700k + Titan) and it was still janky as hell. No problems at 1920x1200 on my i5-2500k tho.
<< Public Mobile, Uber Eats, DoorDash, Tangerine, Coast Capital, STACK user >>
FS: Phanteks Low Profile Cooler | Athlon X2 265
MY HEATWARE
[OP]
Deal Addict
Mar 7, 2010
2525 posts
304 upvotes
Mississauga
Um won't the quad core CPU run better?
So if I have a better video card, it won't help with the flash or Java program?
Deal Addict
User avatar
Feb 8, 2006
3694 posts
190 upvotes
Montreal
"java program" is pretty vague.
But either way it's all CPU - and enough ram to avoid general system slowdowns. You want 8gb minimum.

And the usual logic applies... use Chrome, delete unnecessary startup software, etc.
Heatware: 2-0-0
eBay: 69-0-0
Deal Expert
Oct 6, 2005
16599 posts
2314 upvotes
killer007 wrote: Um won't the quad core CPU run better?
So if I have a better video card, it won't help with the flash or Java program?
No, most Java programs rely on raw CPU power - also very few programs are multi-threaded correctly, so you should be interested in the fastest single threaded performance over more cores.
Deal Fanatic
Nov 17, 2004
7123 posts
1455 upvotes
Toronto
You have to wait about a century for a quantum computer, only then will java not seem slow.
I workout to get big so I can pickup bricks and ****.
Deal Addict
Oct 17, 2004
1552 posts
137 upvotes
thesk8man wrote: java runs slow no matter what.
Java is very fast, its only shortly behind a well written C/C++ application.
Deal Addict
Jan 18, 2009
2982 posts
1586 upvotes
thesk8man wrote: java runs slow no matter what.
luthair wrote: Java is very fast, its only shortly behind a well written C/C++ application.
The google's guy who wrote jGit (and Gerrit) threw in the towel, regardless what he tried (he's pretty smart) Java is still way slower than C.
JGit struggles with not having unsigned types in Java. There are
many locations in JGit where we really need "unsigned int32_t" or
"unsigned long" (largest machine word available) or "unsigned char"
but these types just don't exist in Java. Converting a byte up to
an int just to treat it as an unsigned requires an extra " & 0xFF"
operation to remove the sign extension.

JGit struggles with not having an efficient way to represent a SHA-1.
C can just say "unsigned char[20]" and have it inline into the
container's memory allocation. A byte[20] in Java will cost an
*additional* 16 bytes of memory, and be slower to access because
the bytes themselves are in a different area of memory from the
container object. We try to work around it by converting from a
byte[20] to 5 ints, but that costs us machine instructions.

C Git takes for granted that memcpy(a, b, 20) is dirt cheap when
doing a copy from an inflated tree into a struct object. JGit has
to pay a huge penalty to copy that 20 byte region out into 5 ints,
because later on, those 5 ints are cheaper.
Deal Addict
Oct 17, 2004
1552 posts
137 upvotes
bogolisk wrote: The google's guy who wrote jGit (and Gerrit) threw in the towel, regardless what he tried (he's pretty smart) Java is still way slower than C.
What you're quoting doesn't really mean what you think it does, its basically a description that git was designed with the behaviour and advantages of of C in mind which makes it difficult to implement in Java. jgit is also actively maintained last I heard, though I don't know if Pearce is involved /shrug.
Deal Addict
Jan 18, 2009
2982 posts
1586 upvotes
luthair wrote: What you're quoting doesn't really mean what you think it does, its basically a description that git was designed with the behaviour and advantages of of C in mind which makes it difficult to implement in Java. jgit is also actively maintained last I heard, though I don't know if Pearce is involved /shrug.
Any program that needs fast access to largish data (which is most of them) would tremendously benefit from "direct" mmap() (not the crap Java gives you). Last month I needed and wrote a program to quickly retrieve key-ed data (~25M keys, ~1G dataset). I used a trie (not tree) to get O(1) complexity (vs O(log n) like most database packages) and use mmap() to take advantage the OS's on-demand loading. The code was beautifully simple and very efficient/fast. Doing the same thing in Java would be order of magnitude slower.

So it's not just git, C let you retrieve data much faster and in a much simpler way than Java.

Top