r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3]

Andreas
13-Dec-2010
[6610x3]
Well, at around 2^24 entries things start to deteriorate noticeably.
Long before we even reach 2GB resident.
So probably Jerry was right from the beginning after all :)
BrianH
13-Dec-2010
[6613]
The OS and other apps are also resident. Anything over 512MB would 
push things on a 2GB system running OSX.. I wish my main system was 
running - it has 4GB, which is plenty even on Win7.
Andreas
13-Dec-2010
[6614x2]
Believe me when I say I have sufficient amounts of free RAM :)
Only the R3 process looks like it doesn't even want to go beyond 
1.9GB resident :)
Kaj
13-Dec-2010
[6616]
Are you aware that on a 32 bits system, not the full 4 GB is available, 
because that's the size of the total address space?
Andreas
13-Dec-2010
[6617]
Yes.
Kaj
13-Dec-2010
[6618]
A considerable part of that is needed by the OS for its kernel space. 
2 GB is a bit low for that limit on the main OSes, but it makes you 
think that there's a sort of limit like that in R3
Andreas
13-Dec-2010
[6619]
64-bit host system here.
Kaj
13-Dec-2010
[6620]
Yes, but R3 is 32 bits, so its address space is at most 4 GB and 
could be 2 GB if for example one bit of the address is used as a 
flag
Andreas
13-Dec-2010
[6621x2]
Of course.
But it's easy to confirm that this is not the case for R3.
Kaj
13-Dec-2010
[6623]
You said it doesn't seem to want to go beyond 1.9 GB resident
Andreas
13-Dec-2010
[6624]
For a single map, yes.
Kaj
13-Dec-2010
[6625]
So maybe a 31 bits limit for a map
Andreas
13-Dec-2010
[6626x3]
>> m5: make map! 22'000'000 
** Internal error: not enough memory
** Where: make
** Near: make map! 22000000
>> stats
== 3890639112
So obviously no PAE hacks, but we get 4GB usable address space for 
the R3 process, at least.
BrianH
13-Dec-2010
[6629]
On pre-Vista server versions of Windows you used to be able to change 
the balance to 1GB OS, 3GB apps, as an install opton. This is likely 
done dynamically now.
Andreas
13-Dec-2010
[6630]
The famous /3GB switch :)
BrianH
13-Dec-2010
[6631]
Recently Carl increased the limit on maps - it used to be less than 
500,000 pairs - but if there is a hard limit now it is unlikely to 
be increased for the 32bit builds.
Andreas
13-Dec-2010
[6632]
Do you have a CureCode reference for that handy?
BrianH
13-Dec-2010
[6633]
He even wrote a blog about it.
Andreas
13-Dec-2010
[6634x3]
Here are my current findings:
https://gist.github.com/1ece58c8302b2d1f734b
Ah, of course!
A hard-coded allocation progression would have been my current guess 
:)
BrianH
13-Dec-2010
[6637]
http://issue.cc/r3/1344
Andreas
13-Dec-2010
[6638x2]
http://www.rebol.net/r3blogs/0295.html
We clearly have a different concept of "recently" :)
BrianH
13-Dec-2010
[6640]
On this project, anything in the last year is recently.
Andreas
13-Dec-2010
[6641]
Disqualifying that ticket and blog :)
BrianH
13-Dec-2010
[6642x2]
Which this wasn't
I'm having AltME freezes again.
Andreas
13-Dec-2010
[6644]
A single map! is limited to 2 ** 26 - 1 entries. Or ~3GB memory.
BrianH
13-Dec-2010
[6645]
You should put that in a comment to #1344.
Andreas
13-Dec-2010
[6646x2]
Already did. Also added a (rather unlovingly formatted) comment to 
the map! docs.
(http://www.rebol.com/r3/docs/datatypes/map.html)
Andreas
14-Dec-2010
[6648x2]
Here's a plot of the DT for each "put" operation (m/(i): i) for 19M 
puts:
http://bolka.at/2010/rebol3/tmp/raw19.png
Will do a properly sampled one tomorrow.
Jerry
14-Dec-2010
[6650]
>> to-integer #{ffff}

== 65535  ; how can I make it -1,  is there a to-signed-integer function?
PeterWood
14-Dec-2010
[6651]
I believe that integer!s in R3 are signed 64-bit integers.

>> to-integer #{ffffffffffffffff}

== -1
Oldes
14-Dec-2010
[6652]
They are, but that's the question is different... we should be able 
to do such a conversions somehow. Don't know how at this moment.
Andreas
14-Dec-2010
[6653]
>> sext32: func [x] [32768 xor x - 32768]
>> sext32 to-integer #{ffff}
== -1
Oldes
14-Dec-2010
[6654x2]
something like:
>> shift to-integer #{FFFF0000 00000000} -48
== -1
:)
Andreas
14-Dec-2010
[6656x2]
sorry, should be sext16
>> sext16: func [x] [32768 xor x - 32768]
>> sext16 to-integer #{ffff}
== -1
Oldes
14-Dec-2010
[6658x2]
>> shift shift to-integer #{FFFF} 48 -48
== -1

>> shift shift to-integer #{0001} 48 -48
== 1
My version seems to be a little bit faster:
>> sext16_v1: func [x] [32768 xor (to integer! x) - 32768]
>> sext16_v2: func [x] [shift shift to integer! x 48 -48]
>> dt [sext16_v1 #{ffff}]
== 0:00:00.00001
>> dt [sext16_v2 #{ffff}]
== 0:00:00.000009