Operating at speed now.

Stripe API is slowest to build at about 1.2s, the depth of the schemas on that spec are insane. The only way to speed things up here is to NOT wait for threads to finish before returning the model, and this creates a broken guarantee as the model won't be finished building by the time its returned to the consumer. When running tests against this - they fail randomly. depending on which thread reaches the finish first, before trying to be read.

This isn't an option, so for now, this is as fast as she will get, which is pretty good. 5ms for petstore and about 250ms for k8s.
This commit is contained in:
Dave Shanley
2022-08-12 09:41:03 -04:00
parent 51c4d08b5a
commit c320b2b9f1
6 changed files with 80 additions and 74 deletions

View File

@@ -886,7 +886,7 @@ func (index *SpecIndex) GetGlobalCallbacksCount() int {
return index.globalCallbacksCount
}
index.pathRefsLock.Lock()
//index.pathRefsLock.Lock()
for path, p := range index.pathRefs {
for _, m := range p {
@@ -918,7 +918,7 @@ func (index *SpecIndex) GetGlobalCallbacksCount() int {
}
}
}
index.pathRefsLock.Unlock()
//index.pathRefsLock.Unlock()
return index.globalCallbacksCount
}
@@ -932,7 +932,7 @@ func (index *SpecIndex) GetGlobalLinksCount() int {
return index.globalLinksCount
}
index.pathRefsLock.Lock()
//index.pathRefsLock.Lock()
for path, p := range index.pathRefs {
for _, m := range p {
@@ -963,7 +963,7 @@ func (index *SpecIndex) GetGlobalLinksCount() int {
}
}
}
index.pathRefsLock.Unlock()
//index.pathRefsLock.Unlock()
return index.globalLinksCount
}