-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 78f67ff
Showing
52 changed files
with
268,570 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# iossimdjson | ||
Experimenting with JSON decoding on ios | ||
|
||
## Requirements | ||
|
||
- A recent mac with Xcode installed | ||
- A recent iOS device | ||
|
||
|
||
## Usage | ||
|
||
- Open BitmapDecoding.xcodeproj in Xcode (macOS) | ||
- Click on the "BitmapDecoding" project within Xcode, go to "Identity" and select a valid account under "Team". | ||
- Plug your device (e.g., iPhone) in your mac. | ||
- In Xcode, go to Window > Devices. This will open a new window. You should see your device in this new window. Don't lose this new window. | ||
- In Xcode, go to Product > Build For > Running | ||
- You should see in Xcode under Products "BitmapDecoding.app", drag and drop it into the "Devices" window we opened previously. | ||
- You should now see the app on your device. By default, iOS won't let you run it, so go under Settings > General. You will find a setting there to allow you to run the app. | ||
- Run the app. | ||
|
||
## Sample result | ||
|
||
iPhone XR, Xcode 10.1 | ||
``` | ||
129996 129996 | ||
basic_decoder time 49.067215 nanoseconds per set bit | ||
simdjson_decoder time 11.251628 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.704219 nanoseconds per set bit | ||
simdjson_decoder time 1.197152 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.682744 nanoseconds per set bit | ||
simdjson_decoder time 1.172792 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.693321 nanoseconds per set bit | ||
simdjson_decoder time 1.175998 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.683385 nanoseconds per set bit | ||
simdjson_decoder time 1.168626 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.699411 nanoseconds per set bit | ||
simdjson_decoder time 1.176318 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.750374 nanoseconds per set bit | ||
simdjson_decoder time 1.171510 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.744284 nanoseconds per set bit | ||
simdjson_decoder time 1.167344 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.717040 nanoseconds per set bit | ||
simdjson_decoder time 1.164138 nanoseconds per set bit | ||
129996 129996 | ||
basic_decoder time 1.792363 nanoseconds per set bit | ||
simdjson_decoder time 1.331451 nanoseconds per set bit | ||
``` | ||
|
||
The Apple A12 has seemingly a rated frequency of 2.5GHz. So these nanoseconds translate into about 4.3 and 3.0 cycles per set bit. For comparison, an Intel Skylake get 4.7 and 3.4 cycles per set bit. | ||
|
||
|
||
|
||
## Credit | ||
|
||
|
||
The app. reuses code by Benoît Maison. |
Oops, something went wrong.