Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Jul 9, 2019
0 parents commit 78f67ff
Show file tree
Hide file tree
Showing 52 changed files with 268,570 additions and 0 deletions.
Binary file added Default-568h@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions README.md
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.
Loading

0 comments on commit 78f67ff

Please sign in to comment.