Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Improve servicePort validation performance. #4115

Merged
merged 2 commits into from
Jul 20, 2016

Conversation

jmlvanre
Copy link
Contributor

@jmlvanre jmlvanre commented Jul 19, 2016

This does a single scan over the app definitions.

Benchmarks (both before and after) include a patch pending from @mpark that reduces dependency graph calls.

  • All Apps are at the root level
    Starting with 2000 apps, launching the next 100 sequentially:

Before:
run1: 2m 07s
run2: 2m 23s
After:
run1: 0m 24s
run2: 0m 23s

Starting with 5000 apps, launching the next 100 sequentially:
Before:
run1: 13m 02s
After:
run1: 0m 50s
run2: 0m 54s

// We keep track of the total number of ports to support an
// early exit condition.
var ports: Int = 0
var merged: mutable.MultiMap[Int, AppDefinition.AppKey] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe you need the type annotation. Also, please add the "import collection.mutable" as a fully qualified import - preferably to the top of the file - e.g. "import scala.collection.mutable"

@jasongilanfarr
Copy link
Contributor

A few minor issues (except the 'A' conflicts with itself, which I'd hope AppDef would validate).

// Otherwise we find all ports that have more than 1 app
// interested in them.
var groupViolations = Set.empty[RuleViolation]
for ((port, apps) <- merged) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the if statement to the for loop

@aquamatthias aquamatthias merged commit 30f4966 into d2iq-archive:master Jul 20, 2016
@aquamatthias
Copy link
Contributor

Thanks!

aquamatthias pushed a commit that referenced this pull request Jul 20, 2016
* Improve servicePort validation performance.

* Clean up loops. Improve error message.
unterstein pushed a commit that referenced this pull request Jul 25, 2016
* Improve servicePort validation performance.

* Clean up loops. Improve error message.
@marcomonaco marcomonaco added the pr label Mar 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants