Post Reply 
HP 49G / HP 50G memory
11-18-2017, 03:32 PM
Post: #6
RE: HP 49G / HP 50G memory
(11-17-2017 04:14 PM)Han Wrote:  Port 0 resides in SRAM and programs run directly off of SRAM (presumably the first two 128KB banks of the 512KB chip). Port 1 is the remaining SRAM. Both of these are equally fast.

But there's still some overhead required for port 1 that isn't for port 0, so in practical use they aren't really equally fast. I realize that I'm being very picky here, but the incremental difference can be seen for repeated operations:
Code:
\<<
  @ store a simple object in each port 0-2
  "ABCDEFG"
  DUP :0:tempstr STO
  DUP :1:tempstr STO
  :2:tempstr STO

  @ retrieve the object 500 times from port 0
  TICKS
  1 500 START
    :0:tempstr RCL DROP
  NEXT
  TICKS SWAP - B\->R 8192 /
  "port0" \->TAG

  @ retrieve the object 500 times from port 1
  TICKS
  1 500 START
    :1:tempstr RCL DROP
  NEXT
  TICKS SWAP - B\->R 8192 /
  "port1" \->TAG

  @ retrieve the object 500 times from port 2
  TICKS
  1 500 START
    :2:tempstr RCL DROP
  NEXT
  TICKS SWAP - B\->R 8192 /
  "port2" \->TAG

  @ purge the objects
  { :0:tempstr :1:tempstr :2:tempstr } PURGE
\>>
(Disclaimer: the above is meant to be more illustrative than efficient Smile)

Note that each of the loops is exactly the same except for the port designation of the object it recalls. The tagged numbers in the result are the times (in seconds) for each of the retrieval loops.

Results on my 50g:
port0: 1.993
port1: 2.992
port2: 4.046

Results on my 49g:
port0: 3.700
port1: 4.550
port2: 5.738


(11-18-2017 05:46 AM)Joe Horn Wrote:  When a library is stored in a high port (not main RAM), every time a command in the library is called, ONLY THAT COMMAND gets copied to RAM, then it is run there. The entire library is NOT copied to RAM. Library authors must be aware of one potential danger (caused by this scheme) which can even wipe out all your memory.
...

The advantage of the above design is more efficient use of available memory, of course. One way of dealing with that is to cache subroutines where needed into locals. Yes, there's more setup required when accessing them that way, but in my experience it's still faster than repeatedly accessing library entries when the library is stored in port 1 or 2.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 49G / HP 50G memory - groskwik - 11-15-2017, 06:54 PM
RE: HP 49G / HP 50G memory - DavidM - 11-16-2017, 03:41 PM
RE: HP 49G / HP 50G memory - Han - 11-17-2017, 04:14 PM
RE: HP 49G / HP 50G memory - Joe Horn - 11-18-2017, 05:46 AM
RE: HP 49G / HP 50G memory - DavidM - 11-18-2017 03:32 PM
RE: HP 49G / HP 50G memory - pier4r - 11-18-2017, 09:50 AM
RE: HP 49G / HP 50G memory - TravisE - 11-19-2017, 01:37 AM
RE: HP 49G / HP 50G memory - DavidM - 11-19-2017, 04:22 PM



User(s) browsing this thread: 1 Guest(s)