mbeddr.core icon indicating copy to clipboard operation
mbeddr.core copied to clipboard

mpsutil.common.graph topological is stable

Open abstraktor opened this issue 4 years ago • 5 comments

sorting is maintaining order of equal items (a.k.a. "a stable sorting algorithm")

this would solve Issue 1 of #2139

abstraktor avatar Jul 23 '20 09:07 abstraktor

Before we merge this, apart from fixing the obvious build problem, I will need collect some real world performance numbers on how this impacts performance, especially for interpreters.

coolya avatar Jul 23 '20 11:07 coolya

sorting the interpreters seems to be the only usage of common.graph from mpsutils. I asked around and didn't hear about any other project using it.

Regarding the perormance of sorting the interpreters: Our largest interpreter is the javainterpreter with around 10 interpreter nodes. So we're talking about performance of sorting 10 items, which shouldn't be of too high impact, I guess. Or are there places where the interpreter is called in such a frequent fashion that this turns relevant?

abstraktor avatar Jul 28 '20 09:07 abstraktor

The java interpreter is a toy example. That's why we need metrics from real world and yes there are places especially when collecting coverage information where hundreds of interpreters are called rapidly.

coolya avatar Jul 28 '20 10:07 coolya

Oh I see. I didn't know that.

abstraktor avatar Jul 28 '20 10:07 abstraktor

While the sorted version seems slower, most interpreter usecases will anyway use InterpreterEvaluationHelper which caches the interpreter for a given category hence the sorted evaluators are also cached. From an interpreter point of view I see now reason not to merge this change since the performance impact is not really relevant.

coolya avatar Aug 06 '20 11:08 coolya

I am closing this PR because the changes were merged but not through this PR.

alexanderpann avatar Apr 26 '24 06:04 alexanderpann