Most programs will not produce and assign to a large number of global "top-level" names. But it is interesting that the cost associated with such global name assignment is related to the number of entries in libname.

A possible cause of this cost is the need to check whether the name is protected, before assigning.

The following timings were made on 32bit Maple 15 running on Windows 7, on an Intel i7. The set of four timings is performed twice, to illustrate that the results are not due to the order in which the four are done.

The folder cat(kernelopts(mapledir),"/lib") is the principal "lib" folder in the Maple installation location. The NAG package (which doesn't do much unless you install the NAG C Library as a 3rd party application) is installed in cat(kernelopts('mapledir'),"/toolbox/NAG/lib") and is a module with about 1750 exports.

I haven't checked thoroughly whether the main effect on the timing is due to the number of folders in libname, or the number of .mla archives within such folders, or the number of exports within such .mla archives. But note that BlockImporter only has 7 exports, yet its inclusion in libname has just as much effect on the timing as does the 1750 export library.

restart:
libname:=cat(kernelopts(mapledir),"/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          4.634, 4.682

restart:
libname:=cat(kernelopts(mapledir),"/lib"),
         cat(kernelopts('mapledir'),"/toolbox/NAG/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          6.958, 6.957

restart:
libname:=cat(kernelopts(mapledir),"/lib"),
         cat(kernelopts('mapledir'),"/toolbox/BlockImporter/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          7.286, 7.292

restart:
libname:=cat(kernelopts(mapledir),"/lib"),
         cat(kernelopts('mapledir'),"/toolbox/NAG/lib"),
         cat(kernelopts('mapledir'),"/toolbox/BlockImporter/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          9.844, 9.856

restart:
libname:=cat(kernelopts(mapledir),"/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          4.556, 4.563

restart:
libname:=cat(kernelopts(mapledir),"/lib"),
         cat(kernelopts('mapledir'),"/toolbox/NAG/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          7.035, 7.042

restart:
libname:=cat(kernelopts(mapledir),"/lib"),
         cat(kernelopts('mapledir'),"/toolbox/BlockImporter/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          7.301, 7.300

restart:
libname:=cat(kernelopts(mapledir),"/lib"),
         cat(kernelopts('mapledir'),"/toolbox/NAG/lib"),
         cat(kernelopts('mapledir'),"/toolbox/BlockImporter/lib"):

st,str:=time(),time[real]():
for i from 1 to 20000 do
   a||i:=0:
end do:
time()-st,time[real]()-str;

                          9.844, 9.843

One thing I'm interested in is judging whether it's better to collect any and all add-on packages and user-defined modules from a possibly diverse set of .mla archives, and to instead merge them all into either a single folder (or possible a single archive). Note that the principal "lib" folder in installed Maple 15.01 has seventeen .mla archives. But this is not in proportion to the timing change due to adding just one more folder+archive. It's beginning to look (surprisingly) as if it is the number of folders (directories) which is the primary timing influence here.

The above is on a non-networked machine, running a purely local harddisk installation of Maple. Here is the result from running it on 64bit Linux, Maple 15.01, using a networked copy of Maple (ie. installation is via an NFS mounted disk). This is on a slightly slower Intel i5 machine. Notice the larger real-time delay. The figures show that each of these three tasks below had a ten second real-time pause (adding up to 30 seconds of "lost" time) while Maple waited on NFS disk access.

> restart:
> libname:=cat(kernelopts(mapledir),"/lib"):
> st,str:=time(),time[real]():
> for i from 1 to 20000 do
>    a||i:=0:
> end do:
> time()-st,time[real]()-str;

                                 2.560, 12.965

> restart:
> libname:=cat(kernelopts(mapledir),"/lib"),
>          cat(kernelopts('mapledir'),"/toolbox/NAG/lib"):
> st,str:=time(),time[real]():
> for i from 1 to 20000 do
>    a||i:=0:
> end do:
> time()-st,time[real]()-str;

                                 3.030, 13.366

> restart:
> libname:=cat(kernelopts(mapledir),"/lib"),
>          cat(kernelopts('mapledir'),"/toolbox/NAG/lib"),
>          cat(kernelopts('mapledir'),"/toolbox/BlockImporter/lib"):
> st,str:=time(),time[real]():
> for i from 1 to 20000 do
>    a||i:=0:
> end do:
> time()-st,time[real]()-str;

                                 3.450, 13.776

acer


Please Wait...