Last visit was: It is currently Thu Mar 28, 2024 6:04 pm


All times are UTC-05:00




Post new topic Reply to topic  [35 posts ] 
Author Message
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 7:53 pm 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
Quote:
However I have grown far to acustom to the class layout of Java and I doupt I could create anything efficient in C++ anymore.
I would like to say that's not possible, but I've not done a lot of Java. The basics are bad enough.

System.out.println? Are you bloody joking?

I suppose I could have made my tenure a tad more enjoyable, but I don't even know if Java has a #define preprocessor. I can't say I'm terribly motivated to even look.

I mean, come on. It's Java.

Of course, you should note that C++ can be object oriented. This would be valid code in Onlink:
Code:
game->GetInterface()->GetRemoteInterface()->GetInterfaceScreen()->GetComputerScreen()->GetComputer()->security.GetSystem(0)->Disable();
Of course, there's a lot cleaner of a way to do this. I'm just noting that it's all linked, and if you don't use much care, it can get REALLY messy.


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 8:16 pm 
User avatar
 

Joined:Mon Sep 22, 2008 9:51 am
Posts:112
Quote:
System.out.println? Are you bloody joking?

I suppose I could have made my tenure a tad more enjoyable, but I don't even know if Java has a #define preprocessor. I can't say I'm terribly motivated to even look.
Okay I get it :), you hate Java but that doesn't make it a bad language in and of itself. It doesn't have define thats true, you cannot redefine what the basic operators do.
Quote:
Of course, you should note that C++ can be object oriented. This would be valid code in Onlink:
Code:
game->GetInterface()->GetRemoteInterface()->GetInterfaceScreen()->GetComputerScreen()->GetComputer()->security.GetSystem(0)->Disable();
I see that and its true, in fact IRC you could even do that in C.

I grew up on C, I was a basement programmer and never took a course on any programming language until just recently in college (then it was just an intro... does that even count?).

Seg faults fun fun, what grand memories of working in pico on a remote machine via an ssh terminal.

But generally overall I think its mostly that I have been spoiled by Java and havent work in any language aside from it, php and actionscript recently.

The point I am trying to make is that, as flawed as it is, Java is my language. I know some people hate Java and I know its preformance can sometimes lack compaired along side its natively compiled peers (C, C++, C#, etc).

Remember most those preformance studies we're done atleast 5 years ago (if not more).

_________________
Oh this and that.


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 9:01 pm 
User avatar
 

Joined:Sat Jun 03, 2006 3:51 am
Posts:1186
Website:http://griffinhart.livejournal.com/
Yahoo Messenger:Squall591
AOL:FinalWarrior591
Location:Look at my horse, my horse is amazing!
Bloody fuck MIah. Did you know that Firefox 3.0.3 doesn't wrap really long strings of text, and that for whatever reason, the forums don't have a horizontal scroll bar?

What I'm saying is that I can't read the very ends of your post because they go offscreen. ;_;

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 9:08 pm 
Literally Nine
User avatar
 

Joined:Sat Apr 02, 2005 3:31 pm
Posts:1171
Location:The vicinity of an area adjacent to a location.
Quote:
Bloody fuck MIah. Did you know that Firefox 3.0.3 doesn't wrap really long strings of text
Well, it does, but it doesn't do so for code bbtags. I'd wager this is a CSS error.
Quote:
and that for whatever reason, the forums don't have a horizontal scroll bar?
Another CSS error. I'll dig through the CSS in a moment.

_________________
- Tycho

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 9:15 pm 
User avatar
 

Joined:Sat Jun 03, 2006 3:51 am
Posts:1186
Website:http://griffinhart.livejournal.com/
Yahoo Messenger:Squall591
AOL:FinalWarrior591
Location:Look at my horse, my horse is amazing!
Quote:
Quote:
Bloody fuck MIah. Did you know that Firefox 3.0.3 doesn't wrap really long strings of text
Well, it does, but it doesn't do so for code bbtags. I'd wager this is a CSS error.
Actually, I don't think it does for anything. I tried posting that really long name for that one chemical formula in the "Mac Version of Onlink" thread (the one that was 1913 characters long), and I ended up going offscreen as well (which is why I edited my post so it was the actual chemical formula instead of the name).

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 9:32 pm 
Literally Nine
User avatar
 

Joined:Sat Apr 02, 2005 3:31 pm
Posts:1171
Location:The vicinity of an area adjacent to a location.
Quote:
Quote:
Bloody fuck MIah. Did you know that Firefox 3.0.3 doesn't wrap really long strings of text
Well, it does, but it doesn't do so for code bbtags. I'd wager this is a CSS error.
OK, I forced it to add scroll bars if the text gets too damned long.
Quote:
Quote:
and that for whatever reason, the forums don't have a horizontal scroll bar?
Another CSS error. I'll dig through the CSS in a moment.
This is also fixed. It was a bug I fixed in the Naiad code base, but the forums' CSS isn't managed by Naiad.

_________________
- Tycho

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 9:54 pm 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
Quote:
...you hate Java but that doesn't make it a bad language in and of itself.
That really depends on one's definition. It's less the syntax and more the loss of control. And the crappy optimization. But I'm a speed whore.


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Wed Oct 08, 2008 10:17 pm 
Literally Nine
User avatar
 

Joined:Sat Apr 02, 2005 3:31 pm
Posts:1171
Location:The vicinity of an area adjacent to a location.
Quote:
But generally overall I think its mostly that I have been spoiled by Java and havent work in any language aside from it, php and actionscript recently.
Whenever I refer to Java or computer science in general rotting someone's brain, this is pretty much what I'm talking about.
Quote:
The point I am trying to make is that, as flawed as it is, Java is my language. I know some people hate Java and I know its preformance can sometimes lack compaired along side its natively compiled peers (C, C++, C#, etc).
C# is as bad as Java. In fact, it was Microsoft's answer to Java. Further, it's NOT natively compiled! It's interpreted.
Quote:
Remember most those preformance studies we're done atleast 5 years ago (if not more).
So you think Java has undergone fundamental redesign in 5 years?

_________________
- Tycho

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 12:20 am 
User avatar
 

Joined:Mon Sep 22, 2008 9:51 am
Posts:112
Oh wow, you guys just want to fight, well okay i'll indulge a little but I am generally a firefighter (anti flame war) so I won't go to far.
Quote:
So you think Java has undergone fundamental redesign in 5 years?
YES, The language structure itself hasn't very much but the technology and optimizations in the official runtime environment and the APIs have, there has been major improved in its speed in the last 5 years.

In 2003, IRC java was j2se 1.4, which by current java standards is horrible. Java is normally no longer interpreted, it uses JIT (just-in-time compilation), this is a huge boost from its early days and is compairible in speed to compiled code (becase it was compiled, but only just in time).

As time goes on and things are actively developed such as java, the code execution times get better, while the API increases in size this has very little to due with the speed of execution (unless your using every class) and more to do with memory usage.

Actually I am not going to go any further on that topic, I doupt you really care enough since you have a prejudice against it.
Otherwise you can read more here: http://en.wikipedia.org/wiki/Java_performance
Quote:
Whenever I refer to Java or computer science in general rotting someone's brain, this is pretty much what I'm talking about.
I am not going to try to glorify Java, but it is not a bad language. By being spoiled by Java I refer to its oh so very useful Garbage Collector. I use the GC as it is Java's method of taking care of used resources and properly releasing unused components to be taken care of by the GC is important.

The fact that I haven't programmed C++ in years is the reason I don't program it now, really I left C++ because I didn't have a compiler (~6 years ago). At the time I wasn't as knowledgable on the free alternatives. Therefore I do no remember how to correctly setup and use the alloc or the header files (very important stuff).

Quote:
C# is as bad as Java. In fact, it was Microsoft's answer to Java. Further, it's NOT natively compiled! It's interpreted.
You sir are sadly misinformed. While it is true C# was inspired in part by Java it is not thier answer to Java. So unless you have some secret In-House Microsoft memo, I don't wanna hear anything more about that part.

Further more it is NOT interpreted, it was never interpreted. C# is compiled, only MSIL code units are compiled just when needed at runtime (via JIT which is not interpretation). See here: http://en.csharp-online.net/Glossary:De ... st-In-Time

Last thing and this one is really really mean for me:
Now please do your homework, before you open your mouth, or you look like a total idiot sometime later.

_________________
Oh this and that.


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 3:43 am 
Literally Nine
User avatar
 

Joined:Sat Apr 02, 2005 3:31 pm
Posts:1171
Location:The vicinity of an area adjacent to a location.
Quote:
Oh wow, you guys just want to fight, well okay i'll indulge a little but I am generally a firefighter (anti flame war) so I won't go to far.
It's not a fight. We just don't like when people are wrong.
Quote:
Quote:
So you think Java has undergone fundamental redesign in 5 years?
YES, The language structure itself hasn't very much but the technology and optimizations in the official runtime environment and the APIs have, there has been major improved in its speed in the last 5 years.

In 2003, IRC java was j2se 1.4, which by current java standards is horrible. Java is normally no longer interpreted, it uses JIT (just-in-time compilation), this is a huge boost from its early days and is compairible in speed to compiled code (becase it was compiled, but only just in time).

As time goes on and things are actively developed such as java, the code execution times get better, while the API increases in size this has very little to due with the speed of execution (unless your using every class) and more to do with memory usage.

Actually I am not going to go any further on that topic, I doupt you really care enough since you have a prejudice against it.
Otherwise you can read more here: http://en.wikipedia.org/wiki/Java_performance
Give me a break. Java is a clear loser:
Code:
Steven@alcarin ~/GenPrime $ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing) Steven@alcarin ~/GenPrime $ time nice -n -20 java -jar GenPrime.jar real 0m29.697s user 0m0.030s sys 0m0.015s Steven@alcarin ~/GenPrime $ g++ -v Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext -- enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java- awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio ns --enable-hash-synchronization --enable-libstdcxx-debug Thread model: posix gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) Steven@alcarin ~/GenPrime $ g++ -O3 -Wall -std=c++98 -pedantic -o genprime genprime.cpp Steven@alcarin ~/GenPrime $ time nice -n -20 ./genprime real 0m15.452s user 0m15.358s sys 0m0.015s
And that was with Cygwin's GCC 3.4.4, which is significantly outdated and runs under the Cygwin POSIX emulation layer. It should have lost, by all means. I could have gone to a machine with GCC 4.x, but it clearly wasn't necessary in order to beat Java's horrendous performance.

I've included source if you want to try it yourself. Show some numbers instead of meaningless banter.
Quote:
Quote:
Whenever I refer to Java or computer science in general rotting someone's brain, this is pretty much what I'm talking about.
I am not going to try to glorify Java, but it is not a bad language. By being spoiled by Java I refer to its oh so very useful Garbage Collector. I use the GC as it is Java's method of taking care of used resources and properly releasing unused components to be taken care of by the GC is important.

The fact that I haven't programmed C++ in years is the reason I don't program it now, really I left C++ because I didn't have a compiler (~6 years ago). At the time I wasn't as knowledgable on the free alternatives. Therefore I do no remember how to correctly setup and use the alloc or the header files (very important stuff).
I really hate the garbage collection model. It doesn't make sense to me that you allow memory leaks by design and then whenever they get to be too much, clean them up later. Java applications take a huge amount of RAM to run, and this is one of the multitude of reasons.

As for getting a free C++ compiler, you could use Cygwin if you wanted. Just select 'gcc' when installing. I also recommend adding 'make', 'git', 'ncurses', and a few other useful libraries and applications.
Quote:
Quote:
C# is as bad as Java. In fact, it was Microsoft's answer to Java. Further, it's NOT natively compiled! It's interpreted.
You sir are sadly misinformed. While it is true C# was inspired in part by Java it is not thier answer to Java. So unless you have some secret In-House Microsoft memo, I don't wanna hear anything more about that part.
You don't need an in-house memo to figure this out. It's quite simple. Microsoft had their own Java virtual machine until Sun Microsystems, being the asses they are, decided to sue them. So Microsoft went off and wrote a language that is virtually identical to Java, and performs just as badly. It's simple business politics.
Quote:
Further more it is NOT interpreted, it was never interpreted. C# is compiled, only MSIL code units are compiled just when needed at runtime (via JIT which is not interpretation). See here: http://en.csharp-online.net/Glossary:De ... st-In-Time
JIT is a method emulation. It's NOT NATIVE CODE. Try running a C# application or Java application on a machine without a JRE or .NET framework (Mono or the official one, whichever). It CAN'T be done, because the code isn't native. It's bytecode. Yes, it's "compiled on the fly" with JIT, but that's a massive detriment to performance, and it's truly just acting as an emulator for the virtual machine that the bytecode is designed for.
Quote:
Last thing and this one is really really mean for me:
Now please do your homework, before you open your mouth, or you look like a total idiot sometime later.
"really really mean for me"? What the fuck?

And try to explain to any Intel or AMD engineer that Java performs just as well as native code. It's complete and utter bullshit. hardware engineers know this, and you'd be laughed out of the room.

_________________
- Tycho

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 4:05 am 
 

Joined:Wed May 14, 2008 3:31 am
Posts:14
I like C# alot more than I do Java( UIs look better etc ). I guess it just depends on what you are doing with it.


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 4:49 am 
Literally Nine
User avatar
 

Joined:Sat Apr 02, 2005 3:31 pm
Posts:1171
Location:The vicinity of an area adjacent to a location.
Jeez. I just re-ran the Java and C++ versions of GenPrime on a different machine running Linux. It's a significantly slower machine (Pentium M 900MHz) than the one I tested on first (Core 2 Duo 2.33GHz), and it makes my point even clearer:
Code:
steven@kuila ~ $ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing) steven@kuila ~ $ g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.1.2 (Gentoo 4.1.2 p1.1) steven@kuila ~ $ javac GenPrime.java steven@kuila ~ $ time sudo nice -n -20 java GenPrime real 4m13.627s user 4m12.180s sys 0m0.294s steven@kuila ~ $ g++ -O3 -Wall -std=c++98 -pedantic -o genprime genprime.cpp steven@kuila ~ $ time sudo nice -n -20 ./genprime real 1m17.806s user 1m17.702s sys 0m0.016s
I ran the Java one twice because I had a hard time believing it was really that bad. The result is indeed accurate.

The Java version took 3 times as long. So much for JIT approaching native performance.

_________________
- Tycho

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 8:32 am 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
This is exactly why I stepped aside. I knew Tycho wouldn't be able to resist.

Frankly, I would not call Java a coding language at all. I would call it a scripting language. Seems to fit the definition better.


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 11:23 am 
User avatar
 

Joined:Sat Jun 03, 2006 3:51 am
Posts:1186
Website:http://griffinhart.livejournal.com/
Yahoo Messenger:Squall591
AOL:FinalWarrior591
Location:Look at my horse, my horse is amazing!
And it's being taught as the language du jour in my county. ;_;
DigiPen doesn't even use Java in its curriculum, so I'm slightly pissed that I'm being made to learn it at all.

(My CompSci teacher, who is 112% awesome and win, says it's "great for teaching object-oriented programming" and not much else.)

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline  
 Post subject:Re: Challenge Five: An Efficient Tree Structure
PostPosted:Thu Oct 09, 2008 1:24 pm 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
Quote:
(My CompSci teacher, who is 112% awesome and win, says it's "great for teaching object-oriented programming" and not much else.)
I wouldn't even say it's good at that, unless you want to learn worst case scenarios. :p


Top
Offline  
Display posts from previous: Sort by 
Post new topic Reply to topic

All times are UTC-05:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created by Miah with assistance from hyprnova