Skip to content

Conversation

@evermeer
Copy link

@evermeer evermeer commented Oct 31, 2016

I know... I should not bring a Monk to a shootout... But I have to try and see if I can convince people that violence is not everything. 😉👊

EVReflection is a reflection base json mapper. Like almost any other library it's using JSONSerialization.jsonObject to create a dictionary from the json but instead of creating a manual mapping for serializing and deserializing it is using Mirror for getting data from an object and it's using setValue forKey for setting the properties.

Yes, this power comes with a costs. Reflection based object mapping is much slower. It's even 10 times slower than the libraries currently tested in this shootout.

Here are the test results on my MacBook:

[JSONShootoutTests.EVReflection_Tests testPerformance]' measured [Time, seconds] average: 27.109, relative standard deviation: 15.026%, values: [31.466236, 30.433386, 30.843063, 22.910764, 21.839983, 21.872713, 29.515760, 30.903421, 29.163686, 22.136771], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[JSONShootoutTests.EVReflection_Tests testPerformance]' passed (271.500 seconds).

P.S. Since the setValue forKey does not work on structs I added 2 almost identical classes for this.
P.S 2 I have no idea how you could put EVReflection in your readme.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant