Optimize WhiskEntity deserialization
- Dominant language
- Scala
- Stars
- 6.8k
- Forks
- 1.2k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 2
Description
Currently the deserialization logic for `WhiskEntity` uses a trail based approahc where it tries multiple deserializers
https://github.com/apache/openwhisk/blob/e9dd2073cd2343545d006cd71ca01dc24114c216/common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskEntity.scala#L134-L152
This can be optimized for newer setups which started using new `entityType` attribute (#3164). So we can have a pre check if the object have field `entityType` defined then use that otherwise fallback to existing approach.
It would avoid the cost of exception generated for cases where we are looking for entries later in the sequence
Contributor guide
Research direction
Start in common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskEntity.scala, especially lines 134-152, and trace the current trail-based deserialization. Verify how entityType is represented and where the fallback is used; done means newer entities avoid the exception-driven attempts while entities without entityType retain the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100