On Thu, Jul 23, 2026 at 01:56:21PM +0800, Qian Yun wrote:
> On 7/22/26 9:50 PM, Waldek Hebisch wrote:
> >
> > At first glance main work should be scanning given volume of
> > executable code. It should not make much difference if the
> > code is in single piece or in several pieces.
> >
>
> No, the virus scanning is done on each and every binary load.
But the question is how much time does it take. Single 10Gb binary
is likely to take long time simply because this is a lot of code
to scan. If you have measured time needed in both cases, then
we would know. But without measurement it is just guessing.
And of course time will depend on specific antivirus program
in use.
> > Concerning many parts, various plugin architectures seem to be
> > quite popular, mayby not with 1400 parts, but certainly with
> > hundreds.
> >
> > But if you have data showing that having code in one piece helps
> > then we can try to do something.
> >
>
> Just thought of another benefit:
>
> If we have a single binary, then it will have a larger ".text"
> section, will cost more memory than load-on-demand version,
> but when running multiple FRICASsys processes in parallel,
> that could save memory because ".text" section will be shared,
> but '(load "xxx.fasl")' will consume heap memory and will not be
> shared.
There will be some saving. But ECL .fas is just a shared library
and code in shared libraries is shared between processes. We
will probably save a bit on relocatations. But note that ECL
creates at runtime many things that are logically constant
(say a big immutable list). So there will be extra runtime
and extra memory use from files which are unused but included
in the executable.
> >> Also, this approach can help fricas on ecl on wasm, because loading
> >> domains one by one via network is too slow. Loading all domains
> >> at once is faster.
> >
> > Is it really? IIUC connection setup takes some time, but once
> > set up connection can transfer hundreds of files. Also, typical
> > FriCAS run should only use part of algebra, not the whole. So
> > there is less data to transfer and less compute time spend in
> > LOAD.
> >
>
> Yes, because we load each domain one by one, not in parallel.
> (Only after loading domainA, we know its dependencies.)
Web browsers are supposed to handle this. Browser first loads
a page, parses it and only after that knows what more is needed.
The loaded files can recursively load more things. If all
this works as designed the whole cascade will be loaded via
single connection.
So, dependencies alone do not exclude reusing the same connection.
> Then the IOPS over network is significantly worse than disks.
> Even if downloading a domain needs 100ms (TCP 3 way handshake),
> doing integral requiring dozens of domains, costing seconds
> just to download them. While in the mean time, loading 1400+
> domains in a single binary, only cost seconds as well.
This is question of balace between bandwidth and latency.
And possibly question of loading strategy. IIUC web
version currently uses simple strategy of downloading a domain
when FriCAS wants to load it. But we can predict with
rather high probablity that after loading one domain some
other will be loaded too. So we could initiate downloading
much earlier.
In fact, in web version it probably would make sense to exclude
Spad compiler and some other pieces to reduce size of main
file.
Maybe you have better data, but when I tried web version it
took a lot of time to get to the first prompt, which should be
just loading a single file.
--
Waldek Hebisch