BaseIncomplete

CWE-1235Incorrect Use of Autoboxing and Unboxing for Performance Critical Operations

Category: other

Description

The code uses boxed primitives, which may introduce inefficiencies into performance-critical operations.

Common consequences· 1

  • Availability — DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Resource Consumption (Other), Reduce Performance
    Incorrect autoboxing/unboxing would result in reduced performance, which sometimes can lead to resource consumption issues, impacting availability when used with generic collections.

Potential mitigations· 1

  • [Implementation]Use of boxed primitives should be limited to certain situations such as when calling methods with typed parameters. They should not be used for scientific computing or other performance critical operations. They are only suited to support "impedance mismatch" between reference types and primitives. Examine the use of boxed primitives prior to use. Use SparseArrays or ArrayMap instead of HashMap to avoid performance overhead.

References

  1. https://cwe.mitre.org/data/definitions/1235.html

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Reliance on Machine-Dependent Data Representation
CWE
Insufficient Control Flow Management
CWE
Invokable Control Element in Multi-Thread Context with non-Final Static Storable or Member Element
CWE
Insufficient Use of Symbolic Constants
CWE
Use of Function with Inconsistent Implementations
CWE
Floating Point Comparison with Incorrect Operator
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.