Logo by Pauldelbrot - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. April 16, 2024, 10:22:12 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: 1st 4 me  (Read 833 times)
0 Members and 1 Guest are viewing this topic.
Imagyx
Navigator
*****
Posts: 72


Finally 3D and more... Thank you !! ;-)


« on: September 22, 2011, 11:35:07 PM »

1st 4 me



http://www.fractalforums.com/index.php?action=gallery;sa=view;id=8677

First Mandelbulb picture I rendered with Java
Logged

During difficult times, keep steady and play the match.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #1 on: September 23, 2011, 10:30:39 AM »

Isn't your program slow? smiley Java should be a bit slower than other languages (I suppose)
Logged

No sweat, guardian of wisdom!
Imagyx
Navigator
*****
Posts: 72


Finally 3D and more... Thank you !! ;-)


« Reply #2 on: September 23, 2011, 11:02:13 AM »

As far as I know Java is not that much slower than other languages anymore,
look for "java vs. c++ benchmark" and you will find a lot of interesting tests that prove
this wrong.
What I'm sure of is that my program is a lot slower than some GPU-program,
because all these programs seem to calculate the fractals in realtime.

The advantage with my program is that it already uses as many cores as given.
I have a quadcore so the picture below was calculated with ~98 % of all four core's power
and rendered within three seconds.

I'm just curious to see what Java can do with 3D-Rendering and want to improve my program as far
as the 2D-program has.
Logged

During difficult times, keep steady and play the match.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #3 on: September 23, 2011, 12:29:50 PM »

Thanks for the reply! cheesy
Logged

No sweat, guardian of wisdom!
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #4 on: September 23, 2011, 01:28:40 PM »

As far as I know Java is not that much slower than other languages anymore,
look for "java vs. c++ benchmark" and you will find a lot of interesting tests that prove
this wrong.
The best way to make an argument like this is to bring your own evidence to the table; "you can Google for other people's arguments to support my point of view" isn't a very strong statement.

Just saying.
Logged

Imagyx
Navigator
*****
Posts: 72


Finally 3D and more... Thank you !! ;-)


« Reply #5 on: September 23, 2011, 03:08:18 PM »

If you want personal experience, I have some, not much:

Very important for calculating fractals is accuracy.
I wrote an LR-Decomposition once in C++ and Java
with the exact same calculations and (!) comparable accuracy, which means
the same number of fractional digits used.
Some of the "intersting" matrices I tested were singular depending on C++,
in Java I could easily compute the inverse matrix, which had to be impossible in C++.
(I checked it, don't worry, Java was correct there, A*A^-1 = I   was alright.)
That's for accuracy,
speedwise the programs were comparable, Java was neither slower nor faster.
So Java even had the advantage there  wink

Another test I once made was a simple prime-calculation.
Same algorithm and C++ needed ~5000 ms. for the primes between 2 and 1.000.000  (Was a simple program, not optimal)
Java needed only 3500 ms.

What's also very important: Every language can be slow, depending on how good you are with it.
I use Java many years now and think of C++ as a ugly language, harder to read and with a crappy error-handling.
So I will always be faster with Java than any other language, especially when using GUI's (very easy in Java).

The only interesting alternative in my point of view would be some GPU-programming, but I don't know where to start
and learning that would consume a lot of time, that I currently don't have...

Give me some examples, where C++ or any other language is faster than Java (you experienced yourself)  cheesy
Logged

During difficult times, keep steady and play the match.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #6 on: September 23, 2011, 03:47:26 PM »

All I really meant to say with the above post is the more general point that you could Google to find support for UFOs, 9/11 being an inside job, the existence of Gods, the Earth being flat, etc smiley Doesn't necessarily mean it's true wink

But, more specifically, there is a fundamental issue in Java that all array accesses are bounds checked. So what boils down to a single MOV instruction in some languages, becomes a sequence of comparisons with possible exceptions being thrown, etc... this is absolutely fundamental, since in almost all programming situations you're doing a lot of array access (eg. in loops, where all the time is spent).

I'm not saying Java is extremely slow, and I'm not disputing that it's gotten a lot faster recently (eg. they finally introduced a stack instead of allocating everything on the heap). However, there are fundamental reasons why the performance will not be able to match that of lower level languages in many situations.

Your asking me to provide my own evidence is misplacing the burden of proof (I'm not the one making bold claims about language performance), however I've written "a few" ray tracers in my time, and found Java to be a lot slower. That was before Java 6, on older CPU architectures (Athlon 64), so I'm not going to take it as being indicative of what performance is like now... but there are fundamental reasons such as these array bounds checks which should bear consideration. The point you made about accuracy and something being "impossible in C++" is laughable and not worth a proper refutation.

Obviously if you're just doing file I/O and calling system libraries (as the majority of Java apps seem to be doing), you're not going to notice any performance difference; however, we're here to do some serious computation, and we're doing it ourselves.
« Last Edit: September 23, 2011, 03:49:02 PM by lycium » Logged

Imagyx
Navigator
*****
Posts: 72


Finally 3D and more... Thank you !! ;-)


« Reply #7 on: September 23, 2011, 05:06:19 PM »

I don't know where the accuracy problems arise, it's only what I observed,
concerning the LR-decomp the syntax of Java and C++ is nearly the same,
so I could translate one program into the other and check.
But calculating with matrices there's obviously a huge amount of array using involved.
The speed was nearly the same, some seconds here and there.

You seem to know a lot more about different languages than me, and I really don't want to deny you that.
But as you said yourself, it all depends on what you want to prove.
For me it does the job and I'm happy with it  smiley
And I can't say it's to slow for me, my 2D-fractal-program, which contains 6 years of effort
calculates the classic z²+c Mandelbrot with a resolution of 3000x3000 pixels
from [-2,-2]x[2,2] in about 13 seconds with a value of maxIter=1000.

I hope to learn something here about 3D-fractals and maybe in the future I get to learn how to write a GPU-program for that as well.
And I'm thankful for advice. Please don't get me wrong here, this is all about fun, nothing to argue about, ok ?  A Beer Cup
Logged

During difficult times, keep steady and play the match.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #8 on: September 23, 2011, 05:12:41 PM »

Well, I can briefly justify my (admittedly sharp) comment about something being impossible to compute with C++, on the basis of it being Turing complete: http://en.wikipedia.org/wiki/Turing_completeness

I really like Java btw, and C# even more so. They're just usually not the best tools for high performance computing, and as you correctly point out, GPU computing is an entirely different matter because the CPU need only fire off the process and do a bit of memory copying smiley

If you're keen to learn about that, there are a number of excellent CUDA (NVIDIA only) and OpenCL (vendor agnostic) tutorials and examples on the internet - this is a good place to ask about specific issues, such as performance for high precision arithmetic (there's a good thread on that topic here).
Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #9 on: September 23, 2011, 05:17:03 PM »

Oh, and since you mention the basic Mandelbrot, I did a simple version in C++ some years ago: http://lyc.deviantart.com/art/fast-accurate-mandelbrot-74088382

Might be interesting to compare the performance of this old application against Java now.

Note that it also isn't a "real example" because it does very little memory access, sidestepping the array bounds checking issue I referred to earlier.
Logged

Imagyx
Navigator
*****
Posts: 72


Finally 3D and more... Thank you !! ;-)


« Reply #10 on: September 23, 2011, 05:55:45 PM »

Funny you mention turing completeness  smiley
Have you ever tried to "write a program" with a turing machine before ? It's fun  Azn
I wrote a simple calculator for binary numbers, e.g.  1011+11010 = ? or 101*11011 = ?
with a selfmade turing simulator. It would be really hard to code the mandelbrot with a turing machine  cheesy
But I know where you're going and what you imply by saying C++ can handle everything, in that way it's correct.

That aside I think I might look for CUDA sometime, my NVIDIA could want some hard work to do  wink

265 sec. on a 3.0GHz Quadcore for 1800x1200 pixels I understand.
With 12*12 supersampling you mean actually 144x the amount of pixels calculated and then antialiased ?
Seems to be a good speed to me and may actually be faster than mine.
Logged

During difficult times, keep steady and play the match.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #11 on: September 23, 2011, 06:08:05 PM »

Correct re 12*12 supersampling, and the maximum iteration depth was 1024.
Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.199 seconds with 28 queries. (Pretty URLs adds 0.008s, 2q)