Start-up time again #1209
Replies: 8 comments
-
No we do not 'fully parse' the LV2 plugins. We don't even open them until instantiation time. I've not noticed any unusual LV2 delays, and I have a lot of them. |
Beta Was this translation helpful? Give feedback.
-
With "parsing" I mean parsing the ttl files, not opening the binaries. There could be several hundreds of lv2 plugins on my system. I'm trying to reduce the number now (I had to install additional plugin packs because of the resizing and other issues I was working at), but for some synths even the individual sounds/patches are delivered as individual "plugins" so I suppose there will always be quite a high number of them. |
Beta Was this translation helpful? Give feedback.
-
Yeah, it does take a significant amount of time on my system too.
I have kxstudio installed and it pulls in a pretty large amount of plugins
so there is probably several hundred lv2 plugins here too.
Tried to time startup in different configurations.
With no plugins MusE starts in ~2s
With all but LV2 ~3s
With all plugins ~11s
Could the discovery be done in a background thread?
Den tors 25 mars 2021 kl 09:28 skrev kybos ***@***.***>:
… With "parsing" I mean parsing the ttl files, not opening the binaries.
There are various ttl files for each plugin - the small manifest.ttl with
basic info and one or several others which are typically much bigger.
From the lv2 book:
"Hosts typically read the manifest of every installed bundle to discover
plugins on start-up, so it should be as small as possible for performance
reasons. Details that are only useful if the host chooses to load the
plugin are stored in other files and linked to from manifest.ttl."
lilv_world_load_all() seems to parse everything at start (=all the ttl
files), but I don't know how it works internally, maybe it starts with the
manifest and loads the other ttls only when needed...
Anyway, I will have to look into it in more detail on my system to get out
where the time gets lost.
There could be several hundreds of lv2 plugins on my system. I'm trying to
reduce the number now (I had to install additional plugin packs because of
the resizing and other issues I was working at), but for some synths even
the individual sounds/patches are delivered as individual "plugins" so I
suppose there will always be quite a high number of them.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/orgs/muse-sequencer/teams/musedevteam/discussions/83/comments/2>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCFAN5YVXZZ2SOX37OEEDTTFLXKTANCNFSM4ZYAOZ7Q>
.
|
Beta Was this translation helpful? Give feedback.
-
Unfortunately I was right in my assumptions. All lv2 plugins are instantiated at startup and the LV2Synth constructor reads all data from the ttl files. There can be megabytes of them per synth (e.g. amsynth). Profiling shows that the main performance killer is this function (also called in the LV2Synth constructor): Here this lilv call alone can take up to about 60% of the overall startup time: All that looks like a considerable wasting of system resources (and of the startup time) and clearly contradicts the smart approach of lv2 (separation of basic info from the details for efficient scanning). |
Beta Was this translation helpful? Give feedback.
-
No hurry for my sake, there is room for improvement but it's not a breaking
issue. If there is some improvement before 4.0 goes live, fine, but if not
that's fine by me.
Den fre 26 mars 2021 kl 17:03 skrev kybos ***@***.***>:
… Unfortunately I was right in my assumptions. All lv2 plugins are
instantiated at startup and the LV2Synth constructor reads all data from
the ttl files. There can be megabytes of them per synth (e.g. amsynth).
Profiling shows that the main performance killer is this function (also
called in the LV2Synth constructor):
LV2Synth::lv2state_UnloadLoadPresets(this, true);
Here this lilv call alone can take up to about 60% of the overall startup
time:
lilv_world_load_resource(lilvWorld, preset);
All that looks like a considerable wasting of system resources (and of the
startup time) and clearly contradicts the smart approach of lv2 (separation
of basic info from the details for efficient scanning).
I'm afraid this design can't be changed easily (and I suppose we don't
want to delay the final 4.0 release any further). But at least reading the
presets should be avoided IMO (i.e. before the plugin is really used), that
would already help a lot as it seems.
I should have some time tomorrow so will try to check for possible
improvements (unless one of you knows the lv2 area well and would like to
take over).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/orgs/muse-sequencer/teams/musedevteam/discussions/83/comments/4>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCFANYKCMMOFIKXOMTDMEDTFSVUNANCNFSM4ZYAOZ7Q>
.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the profile. I see the code and call sequence you mention. But I don't know if I can do this quickly. I was hoping to get my fixes in before release. |
Beta Was this translation helpful? Give feedback.
-
I also thought about populating the presets the first time someone opens the presets popup menu. Well, lookie here what ol' Andrew commented:
Yeah, lv2state_UnloadLoadPresets is only called from lv2state_applyPreset and from Intriguing. |
Beta Was this translation helpful? Give feedback.
-
I wrote:
Eh, like eight seconds too long:
Right. (Not so much plugin discovery, but loading presets.) |
Beta Was this translation helpful? Give feedback.
-
We had this discussion before (and I noticed once again that it seems impossible to find anything in this team space, so lots of precious information is lost - or am I just to stupid to find it?).
Anyway: I noticed that the delays at startup are caused by the lv2 scanning. Without it (with the -2 switch), MusE is up almost immediately.
From the lv2 specs I gather that all plugins must offer a small manifest.ttl that can be parsed quickly to get the basic info. The full parsing should only be done if the plugin is actively used, as it of course takes considerable time.
But MusE seems to do the exact opposite and do the full parsing of all lv2 plugins at startup. This increases the startup time in factors of 10-1000, depending of how many plugins are installed.
Have I misunderstood something or do we have a problem here?
Beta Was this translation helpful? Give feedback.
All reactions