Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Acid - final release

Name: FrozenVoid 2011-10-28 11:50

Optimized quasicrystal code: full window size render ~17 seconds for 30 frames
http://pastebin.com/fjLQnbkB

Name: Anonymous 2011-10-28 12:36

Name: Anonymous 2011-10-28 12:48

fuck off back to reddit

Name: Anonymous 2011-10-28 13:04

haskell is for faggots
lisp sucks dicks

Name: FrozenVoid 2011-10-29 2:04

http://pastebin.com/hAyVZ1Yk
branchless version of >>1, about 1s faster

Name: FrozenVoid 2011-10-29 2:50

>>2
Thats cute, but thirty times slower

Name: Anonymous 2011-10-29 3:27

>>6
Because the JavaScript one caches the frames after they're rendered first. The Haskell one doesn't.

Name: FrozenVoid 2011-10-29 5:04

>>7
Haskell(single threaded) renders each frame ~15 seconds, mine 0.5s (most recent is 0.43s)
15/0.5=30

Name: Anonymous 2011-10-29 5:08

GC is shit. You should be ashamed of yourself for not writing this in C.

Name: FrozenVoid 2011-10-29 5:18

>>9
There is no point, C can do it realtime, but you can't embed C in a webpage.

Name: Anonymous 2011-10-29 5:21

>>10
You want to embed this cpu-intensive-as-shit (even once it renders) thing into a webpage? What's wrong with you?
If you want this animation on a website, put up an APNG or GIF animated image.

Name: FrozenVoid 2011-10-29 5:24

>>11
That not for consumers, its a demoscene-like show-off to see how fast you can get with javascript.

Name: Anonymous 2011-10-29 5:51

>>12
In that case, it's not all that special. JS can do basic math and draw images, everyone knows that.

Name: FrozenVoid 2011-10-29 6:03

>>13
The version which i wrote is 3-4 times faster than naive implementation from Haskell used by http://www.jasondavies.com/animated-quasicrystals/

Name: Anonymous 2011-10-29 6:08

>>14
So you didn't even write it all by yourself, you just improved the performance of another's work.

Name: FrozenVoid 2011-10-29 6:26

>>15
Thats the whole point, you take Code A and improve it to reach much faster speed.
The fastest program is considered the best(as long as it render correct quasicrystal output).
You're welcome to take >>5 and write a faster version yourself, so you see how hard it is.

Name: Anonymous 2011-10-29 6:46

-funroll-all-loops!

Name: FrozenVoid 2011-10-29 6:47

For example
Code A is optimized to Code B
if B time < A time , A is replaced by B
next version must be faster than new A
Each new optimization level is harder to get, and clever programming tricks come to background.
 In javascript there is easy, though artificially limited environment where you can test-debug-compare thousand of scripts per day by simply realoding one .htm file in the browser(which can be sent to anyone and displayed/installed in seconds).

Name: Anonymous 2011-10-29 6:49

>>16
Sure: http://pastebin.com/gnHTKVj6
This version is 3 seconds faster (12 to 12.3, before it was 15.2 to 15.5), yet I won't pretend I made something so great others should adore me and my work.

Name: Anonymous 2011-10-29 7:57

Good job FV.

Name: FrozenVoid 2011-10-29 11:06

I'm currently working on precomputed version.
>>19 wasn't fast enough on my machine(even 600ms slower, athlon II x2 240 (it doesn't like branching apparently))
This algorithm is extremely simple and there could be further optimizations, but i can't find any yet(except precomputing alot of values)

Name: Anonymous 2011-10-29 11:44

>>21
Strange, especially considering how slow JavaScript functions are.
On my Intel i5 CPU, my version was 3 seconds faster. Optimization is often architecture-specific.

Also, I have never written anything more complex than a Hello World in JavaScript.

Name: Anonymous 2011-10-29 11:54

>>22
dem dubs

Name: FrozenVoid 2011-10-29 11:58

http://pastebin.com/PH4VGt9u
8228ms  per 30 frames. new record

Name: FrozenVoid 2011-10-29 12:01

I'll rewrite Math.cos/sin calls to my version later, this is just a demo

Name: FrozenVoid 2011-10-29 13:01

Current breakdown for optimizations:
2348 ms cost storing.data[i++]
3777 ms inner loop
1420 ms precomputation/rest
compared:51580ms(Jasons)/8228ms(Current)=x6.26 speed

Name: Anonymous 2011-10-29 13:10

Name: FrozenVoid 2011-10-29 13:26

http://pastebin.com/svrK76sT
7097ms (relocated inner loop mul vars to outer loop)

Name: Anonymous 2011-10-29 14:15

don't post

Name: FrozenVoid 2011-10-29 22:34

Name: Anonymous 2011-10-29 22:40

Still a useless gimmick.

Name: FrozenVoid 2011-10-29 22:57

>>31
If you don't appreciate programming just stop shitposting in my thread and get out of /prog/

Name: Anonymous 2011-10-30 0:26

I appreciate your javascript performance demo gimmick :]

Name: Anonymous 2011-10-30 0:46

Date.now() is better than (new Date().getTime())

Name: Anonymous 2011-10-30 0:53

also you should be posting these on jsperf maybe

Name: FrozenVoid 2011-10-30 2:23

http://pastebin.com/SBDutK45
5851ms: inner loop reduced to 2 multiplies and 1 add

Name: FrozenVoid 2011-10-30 13:51

http://pastebin.com/zduwQEiR
Refactored code 5835 ms

Name: FrozenVoid 2011-10-30 14:38

5572 ms : ternary removed
http://pastebin.com/wzYWG8wD

Name: Anonymous 2011-10-30 15:38

Why is this thread being bumped by invisible posts?

Name: Anonymous 2011-10-30 16:20

I could use some acid, man

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List