[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slow memory access, Not understood when using integer@(mem address)
[Thread Prev] | [Thread Next]
- Subject: Re: Slow memory access, Not understood when using integer@(mem address)
- From: Brian G <brian@xxxxxxxxxxxxxxxx>
- Date: Wed, 23 Sep 2026 13:57:01 -0700
- To: Gambas Users <user@xxxxxxxxxxxxxxxxxxxxxx>
On 9/23/26 13:36, Brian G wrote:
I have attached a small project that tests the access speed to memory using integer@(memory address), as used for Linux library interfaces. I am sorry but 44 times slower than access through a struct pointer is just a bit much to accept!Using this structure and allocating a data space Public Struct myint counter As Integer End Struct mptr=alloc(100)Here is an example using integer@(xx) compared to accessing thru a structure 1 million timesTest Speed to Access script Variables using integer@ptr access method, no lockingusing: Integer@(mptr) = Integer@(mptr) + 1 Total time 4.40942561195698Test Speed to Access script Variables using struct direct access method, no lockingdim vptr as myint = mptrusing: Inc vptr.counter and tested with vptr.counter = vptr.counter + 1, same resultsTotal time 0.098687710007653Struct access is 44.6810829482192 times faster than integer @ access to the same memory addressCan this be fixed, it is pretty bad!
Updateusing fast unsafe the values are interesting so normal is about 1442 times slower than fast unsafe version
Hello worldTest Speed to Access script Variables using integer@ptr access method, no locking
Total time 0.003050090977922Test Speed to Access script Variables using struct direct access method, no locking
Total time 0.041397490072995Struct access is now 13.5725427118894 times slower..... confusing such a big difference
-- ~~~~ Brian
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
| Re: Slow memory access, Not understood when using integer@(mem address) | Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx> |
| Slow memory access, Not understood when using integer@(mem address) | Brian G <brian@xxxxxxxxxxxxxxxx> |