[REBOL] Re: Initializing
From: rebol-list2:seznam:cz at: 20-Dec-2002 11:27
Hello Charles,
Monday, December 16, 2002, 3:13:01 AM, you wrote:
C> A little question. What would be the primary differences between something
C> like:
C> my-block: copy []
C> and
C> my-block: make block! []
C> ? Performance issues? Memory/speed? What other methods are there, without
C> doing a direct assign (like my-block: [])?
C> --Charles
with the Rebol/Base:
system/stats/series
;== [4096 2624 1353 1 118 117 70]
t: now/time/precise loop 100000 [make block! []] now/time/precise - t
;== 0:00:00.1
system/stats/series
;== [66048 13825 1199 1 51023 51022 75]
foreach pool system/stats/pools [probe pool]
...
(using new Rebol/Base console)
system/stats/series
;== [4096 2624 1353 1 118 117 70]
t: now/time/precise loop 100000 [copy []] now/time/precise - t
;== 0:00:00.09
system/stats/series
;== [66048 13822 1199 1 51026 51025 75]
foreach pool system/stats/pools [probe pool]
...
So it looks that there is almost no difference between the copy [] and
make block! []
The other issue would be with the make block! 10 which allocates more
memory.
=( Oliva David )=======================( [oliva--david--seznam--cz] )==
=( Earth/Europe/Czech_Republic/Brno )=============================
=( coords: [lat: 49.22 long: 16.67] )=============================