Skip to content

Split member cache #6

@chachako

Description

@chachako

目前在 JHM 结果 https://github.com/meowool-catnip/cloak/runs/5175083247?check_suite_focus=true#step:4:537 中表明 constructor 的缓存要比直接获取要慢,因此可能是不必要的空运算导致的

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is MemberCacheKey) return false
if (kind != other.kind) return false
if (clasѕ != other.clasѕ) return false
if (name != other.name) return false
if (parameters != null) {
if (other.parameters == null) return false
if (!parameters.contentEquals(other.parameters)) return false
} else if (other.parameters != null) return false
if (returns != other.returns) return false
return true
}
override fun hashCode(): Int {
var result = kind.hashCode()
result = 31 * result + clasѕ.hashCode()
result = 31 * result + (name?.hashCode() ?: 0)
result = 31 * result + (parameters?.contentHashCode() ?: 0)
result = 31 * result + (returns?.hashCode() ?: 0)
return result
}

考虑将缓存键对象拆分为不同的类 [FieldCacheKey, ConstructorCacheKey, MethodCacheKey]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions