[Glass] UUID new >100x slower than Pharo?
Paul DeBruicker
pdebruic at gmail.com
Tue Sep 17 11:27:26 PDT 2013
Thanks Dale,
Tobias Pape replied off list that I should just use the FFI library as
Pharo is calling the libuuid on the platform anyway. So I'll work on
that.
Paul
On 09/17/2013 10:44 AM, Dale K. Henrichs wrote:
> Paul,
>
> First the call to userAction:onClient: does not imply that the operation is being done on the client. HostRandom operates against /dev/urandom on the server side so the cost you are seeing is likely just the overhead of accessing the file.
>
> On my laptop the expression
>
> [1000 timesRepeat:[UUID new]] timeToRun
>
> takes 800ms using HostRandom and 400ms using Lag25000CmwcRandom (not file-based although HostRandom is used to define initial seed) ...
>
> Still, there is a fair amount of Smalltalk code being executed here so a primitive call (which is what pharo does) would be the way to speed this up ...
>
> I'll look into this for 3.2...(or at least making random number generation a lot faster)...
>
>
> Dale
>
>
> | From: "Paul DeBruicker" <pdebruic at gmail.com>
> | To: glass at lists.gemtalksystems.com
> | Sent: Tuesday, September 17, 2013 6:43:46 PM
> | Subject: [Glass] UUID new >100x slower than Pharo?
> |
> | Hi-
> |
> | This is on Glass 1.0.beta9.1 and Gemstone 3.1.0.4 using GemTools
> | 1.0.b71. as the client.
> |
> | Seems like its spending time looking up random numbers using file
> | accesses on the client.
> |
> | [1000 timesRepeat:[UUID new]] timeToRun
> |
> | On my laptop in pharo this takes 14ms and in gemstone it takes 1920
> | ms
> |
> |
> | Is there a way to get it to use the server as I thought that was much
> | faster?
> |
> | Or is there a setting I need to fiddle with?
> |
> | Thanks
> |
> | Paul
> |
> |
> |
> | Here is the output from:
> |
> | ProfMonitor monitorBlock:[1000 timesRepeat:[UUID new]]
> |
> |
> |
> | '================
> | STATISTICAL SAMPLING RESULTS
> | elapsed CPU time: 12308 ms
> | monitoring interval: 1.0 ms
> |
> | tally % class and method name
> | ------ ----- --------------------------------------
> | 2298 18.69 GsFile >> userAction:onClient:
> | 1258 10.23 HostRandom >> integer
> | 1111 9.04 SmallInteger >> bitShift:
> | 944 7.68 GsFile >> next
> | 914 7.43 Character >> asciiValue
> | 906 7.37 GsFile
More information about the Glass
mailing list