Seek for speed

Started by newdep, August 17, 2004, 06:23:46 AM

Previous topic - Next topic

newdep

Goal: create a 1 GIG file, data content does not matter.



So i tried some tests in newlisp but most of them eat performance

on the OS (linux and windows) or where too slow...



So my quest is: Whats the fastest way in newlisp to create a 1 GIG datafile

(on disk!) without too much OS load ....



PS: I used 'dup 'dotimes 'write-char / 'write-buffer



Regards, Norman.
-- (define? (Cornflakes))

Lutz

#1
I tried this:



;; make 1 Gig big file



(set 'onemeg (dup "." (* 1024 1024)))

(set 'fle (open "bigfile" "w"))

(println (time (dotimes (x 1000) (write-buffer fle 'onemeg (* 1024 1024)) )))

(close fle)



(exit)



and it took 47 seconds on a 1.4Ghz Celeron (e-machines) with 256 Mbyte of memory on Linux Mandrake 9.2, which is about 20 Megabte per second.



Probably this experiment measures mostly the performance of your hardware and nothing else.



Lutz

newdep

#2
Well i needed a 1 GIG file just within minutes and i had newlisp at hand

(ofcausre ;-)



It took more than minutes overehere on a Intel P4 and a Altlon 1200..



(close (set 'fle (open "bigfile" "w")))

(set 'onemeg (dup "." (* 1024 1024)))

(set 'fle (open "bigfile" "a"))

(dotimes (x 1024) (write-buffer fle 'onemeg 1024))

(close fle)



a (dup "a" (* 1024 1024 1024)) will kill your machine.. (just for a while)

But thats also to slowest way of doing it..



Mmm so i was quiet near the solution...



Thanks, Norman.
-- (define? (Cornflakes))