PDA

View Full Version : How much slower is lscript?



TripD
11-14-2010, 01:33 PM
So, I was pondering how intensive the computing would be to to run a Mandelbrot (or other) simulation on a plane pre-divided into screen resolution polys. It must take some time for those fractal art programs to kick out the calcs for roughly a million screen pixels times say 500 calcs to see if the function leaves the screen area. Then I wondered how much slower this kind of task would be for lscript. Much? A little?

Lightwolf
11-14-2010, 03:15 PM
I would suspect at least a factor of 5x slower compared to normal compiled C/C++.
But that's just a guess - and only for the pure computational part.

I've certainly never benchmarked it.

Cheers,
Mike

TripD
11-14-2010, 03:57 PM
Thanks for the quick reply. I thought it might be bad.... but that makes it sound not doable. I should have guessed though, cause if it could have been done... it likely would have already.


Oooo.... I managed to put should/would/could in one sentence. :thumbsup:

Lightwolf
11-14-2010, 05:02 PM
Well, I was basically extrapolating from the speed ups that Javascript engines got in the last few years when going from being purely interpreted to byte code (either of which is what LScript does, I suspect it's only interpreted but pre-parsed) to being just-in-time compiled.

Cheers,
Mike

art
01-19-2011, 02:20 PM
If LScript fails you can always try it in excel ;)
http://newtek.com/forums/showthread.php?t=113302

I find lscript much slower than compiled C. Pure computations are probably in the 5x slower range as Mike says, but geometry manipulation in LS appears to be even slower than that as compared to compiled code. At least that's my feeling. And there seems to be something "inefficient" going on in LS when working with bigger data structures.

xxiii
01-25-2011, 04:47 PM
I happened to mention in another forum that I'd written a mandelbrot generator in lscript, (as well as a star generator, using real stars).

Someone asked if these scripts were available. So I'm looking around for the best place to post them, although I haven't decided yet if I want to post the source or only the compiled versions. I need to dust them off and see how non-trivial and/or embarassing they are. The mandelbrot generator probably has lots of room for improvement (to support julia sets and other fractals for instance). And what are the guidelines for posting lscripts?

The mandelbrot generator isn't terribly slow, but it depends on what parameters you feed it; the resulting object can really bog down modeler though.

art
01-26-2011, 06:39 AM
You are free to post your scripts (compiled or uncompiled) in this forum and I don't think there are any official guidelines. Some people add them directly as attachements and others post links to files hosted somewhere else.
If you share them in a forum thread there is a good change they'll get "lost and forgotten". I would host them somewhere, add a reference to a site such as lwplugindb.com and then mention it in the forum.
So your script generates mandelbrot geometry?

xxiii
01-26-2011, 10:12 AM
Here is a quickie shot combining the results of both scripts.

It just occurred to me that I should probably try making the Y-axis the square root, or a logarithm, or something like that, of the actual value...

(The script sets X as the real coordinate, Z as the imaginary coordinate, and Y as the escape value).

art
01-26-2011, 10:50 AM
Maybe you could also try getting rid of the "pillars" by setting the points that never escape (reach max iretations) to Y=0. This way the area inside of the mandelbrot set would be at the "ground" level. Just an idea.

TripD
01-30-2011, 01:34 PM
If LScript fails you can always try it in excel ;)
http://newtek.com/forums/showthread.php?t=113302.

Wow..... been a long time since I did something in excel. I forgot how cool that software can be.

@xxiii Very cool lscript!! I was pondering using the output (number of iterations) to possibly feed a gradient for each particular poly.... but pondering was as far as I got :thumbsup: