alibaba / alibaba/HandyJSON

这个性能有点低怎么办

Open
#385 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4.3k
Forks
677
PR merge metrics
No merged PRs in 30d

Description

我就拿官方的 demo 去测试了,用的最简单的 json


> let jsonString = "{\"data\":{\"aInt\":100,\"aStr\":\"string data\",\"id\":1},\"code\":200,\"biz\":\"social\"}"

> let result = Result.deserialize(from: jsonString)

```
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.

print(CACurrentMediaTime())
for i in 1...200 {
self.deserialization()
}
print(CACurrentMediaTime())
}
```

200 个都需要 0.04s 在 60 帧的刷新率下完全不能在主线程转

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the official demo using Result.deserialize(from:) in viewDidLoad, running deserialization 200 times and measuring CACurrentMediaTime before and after. The issue names no source file, test, or acceptable performance target, so completion would require identifying the deserialization bottleneck and agreeing on a benchmark for main-thread use.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
data, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.