# Kapp Performance Enhancement
---
###### tags: `kapp`
---
## Background:
Kapp interact with K8s server a lot of times. These calls are expensive as they are over the network. As part of this exercise, we want to identify the places where we can reduce these outside calls and thus identify the candidates for performance optimization. Please note that we will not delve into the implementation but we will mark them as implementable/not implementable.
## Identified places
1. In Kapp, we have two kind of apps i.e. `recorded app` and `labeled app`.
* **Recorded App**: Everytime we run the kapp commands on recorded app, we try to get all the resources associated with this recorded app. For this, we query the k8s cluster with all the possible combination of GV's(in goroutines ofcourse). We also store the usedGV's in the app configmap. But we dont use this info while quering the k8s cluster. One optimization we can do is we query only the usedGV's rather than all the possible combinations.
* **Labeled App**: We dont store this info, hence we cant use this information while doing queries on labeled app.
## Potential Candidate
* Before creating a resource, we do the get.
* While looking for the resource belog to a particular Group Version, we query the k8s cluster 3 times. How can we reduce it. e.g. /apis/apps/v1?timeout=32s
* App configmap gets called quite often, how to reduce it.
## Open Points
* How to improve the performance while querying for labeled app.
* Create an excel sheet and note down all the k8s server calls.