MantisBT - opensim
View Issue Details
0008251opensim[REGION] Script Functionspublic2017-10-19 13:262019-02-05 12:32
Kayaker Magic 
closedno change required 
Linux/monoOpen Sim 0.8.3, 0.9.0, 0.9.1 devseveral
master (dev code) 
Grid (Multiple Regions per Sim)
Mono / Linux64
0008251: Mono 5.2 and 5.4 slow some script functions down by a factor of 55
When upgrading from mono 4.2.1 to 5.2 I noticed a decrease in the speed of list fetch functions (such as llList2Float). I used the timing test script I wrote for the related mantis 0008127 to measure the slowdown and found that fetches were taking 0.055ms on mono 5.2 and less than 0.001ms on mono 4.2.1. I tried upgrading to mono and saw the same 0.055ms results, list fetches are >55 times slower on 5.4.

All tests were done on Ubuntu 16.04 Linux systems, I did not test under Microsoft .NET. At first all the instances had AppDomainLoading=false.

I tested OpenSim 0.9.1 dev, release, and also 0.8.3 release (from the binaries downloaded from In all versions of OpenSim I saw the same results: list fetch functions are 0000057:0000055 times slower under mono 5.2 or 5.4 than they are under mono 4.2.

0.9.1 dev is git 3d6553afeee3d4605851b6f336c17d5a6b07c6ad

I tested with AppDomainLoading=true and was surprised that the problem reported in related mantis 0008127 was there! I recall only seeing this problem on instances running on Windows .NET systems. List fetches are 0002113:0005000 times slower with a combination of mono 5.x and AppDomainLoading=true.

The only way I found to get the list fetch speed back to normal was to switch back to mono 4.2.1 and make sure AppDomainLoading=false in the ini file. I did not try earlier versions of mono. Mono 4.2.1 is not one of the recommended versions. It cannot compile the OpenSim sources, but it does seem to run the binaries reasonably well. Perhaps switching to an even older version of mono, like 3.8, will allow you to both compile and run OpenSim.
Put the script below in a prim. Reset or rez the prim to start the statistics over. The second line of the floating text shows the average llList2Float time in seconds. On systems with mono 4.2.1 (or earlier?) fetches will take <1 microsecond, on systems running mono 5.2 or 5.4 the script will show that fetches take around 55 microseconds each.
    //llListFetch timing test
    //Rev 2.1 Put in loop to catch llGetTime resolution issue
    //Rev 2.0: simple list, mean and variance of results
    //Note: timer is only used to generate a bunch of test results
    //there is no dependency on the accuracy of timer events
    //only llGetTime is used to measure the time to perform a fetch
float sum=0.0;
float sum2=0.0;
float n=0;
list test=[];
         integer i;
         for (i=0;i<500;i++) //create a list
             test += [llFrand(500.0)];
     on_rez(integer param)
         float r;
         integer i;
         for (i=0;i<1000;i++)
            r=llList2Float(test,(integer)llFrand(500.0)); //random fetch
         float time = llGetTime(); //how long did that take?
         sum += time;
         sum2 += time*time;
         n += 1000.0;
         " n="+(string)((integer)n)+
        " var="+(string)(sum2/n-sum*sum/n/n),
        <0,1,0>,1.0); //display results
No tags attached.
Issue History
2017-10-19 13:26Kayaker MagicNew Issue
2017-10-19 13:45UbitUmarovNote Added: 0032353
2017-10-20 03:50JeffKelleyNote Added: 0032354
2017-10-20 03:51BillBlightNote Added: 0032355
2017-10-20 12:22smxyNote Added: 0032356
2017-10-20 14:37OtakuMeganeNote Added: 0032357
2018-12-17 00:08Kayaker MagicNote Added: 0033646
2018-12-17 00:09Kayaker MagicNote Edited: 0033646bug_revision_view_page.php?bugnote_id=33646#r7434
2018-12-17 00:13BillBlightNote Added: 0033647
2018-12-17 00:13BillBlightStatusnew => resolved
2018-12-17 00:13BillBlightResolutionopen => no change required
2018-12-17 00:13BillBlightAssigned To => BillBlight
2019-02-05 12:32BillBlightNote Added: 0034324
2019-02-05 12:32BillBlightStatusresolved => closed

2017-10-19 13:45   
tested on VM, on a now old Xeon cpu, and got 0.000156ms on your script.
opensim compiled and running on a 5.2 mono version
this does not tell much since I can't test 4.x on it now :(
2017-10-20 03:50   
MONO 4.3.2, Xeon E3-1225
mean = 0.000000 (S)

After multiplying by 10^6:
mean = 0.25 (┬ÁS)
2017-10-20 03:51   
I just ran this and I am getting .000057 on average ...
2017-10-20 12:22   
mean = 0.000226
var = 0.000052

OpenSim Dev a4e7ab6 2017-08-03 18:09:26 +0100 [CentOS 7.3.1611/Mono] (Unix/Mono)
2017-10-20 14:37   
Xeon X5670
CentOS 6.9, Mono
OpenSim Dev 59afeb6

AppDomainLoading off:
mean = 0.000062
var = 0.000004

AppDomainLoading on:
mean = 0.003596
var = 0.012909
Kayaker Magic   
2018-12-17 00:08   
(edited on: 2018-12-17 00:09)
I eventually discovered that the decrease in the speed of the test script was all in the setup time of the for loop. If I subtracted the for loop time from the calculations of the test, there was no increase in the time to do list fetches.

I remove any concerns I had about list fetch speeds on Mono 5.x

I would mark this mantis resolved, but I don't seem to be able to do so.

2018-12-17 00:13   
Resolved via , Reporter Kayaker Magic
2019-02-05 12:32   
Marked resolved, and closed, can be reopened if they still exist