Giter Club home page Giter Club logo

mpcf-testbench's Introduction

MPCF-TestBench

Actions Status license swift-5.2 @heckj

I was curious how "fast" MultipeerConnectivity operates.

MultipeerConnectivity does a lot of "magic" in a really nice way: peer to peer advertising, supporting delegated connects, and transfer of data. And it operates seamlessly over multiple transports - bluetooth and wifi, focusing on connecting "nearby" peers - while hiding a lot of that detail away.

There are some really interesting wrappers over the top of it as well, such as MultipeerKit (github repo). This repository, with it's workspace and targets, is how I'm answering that question.

I found other repositories that worked MultipeerConnectivity to create benchmarks, but most of them are dated and didn't directly compile. This is written with Swift 5, simple UI with SwiftUI, and has targets building for macOS, iOS, and tvOS.

There are two sides to this "benchmark generator app": a reflector and a test runner.

  • The reflector broadcasts that it's open to chat and reflects back any data sent to it.
  • The test runner is the UI that can be used to trigger data sends and collects data about how it's operating.

It's up to you - running the benchmark - to configure your devices appropriately if you want to see differences in transport modes.

Because MultipeerConnectivity works over bluetooth or wifi, and seamlessly across both - and iOS doesn't provide mechanisms to control what's on and off, I'm leaving that to the user setup if that's a dimension you want to gather measurements against.

The project includes 3 reflector targets and 2 test-runner targets.

Reflector

  • macOS
  • iOS
  • tvOS

Test Runner

  • macOS
  • iOS

Command Line Builds

Development setup

brew bundle

investigating the workspace:

xcodebuild -list -workspace MPCF-TestBench.xcworkspace

schemes:

MPCF-Reflector-ios
MPCF-Reflector-mac
MPCF-Reflector-tvOS
MPCF-TestRunner-ios
MPCF-TestRunner-mac

building the projects on the command line

xcodebuild -workspace MPCF-TestBench.xcworkspace \
-scheme MPCF-Reflector-ios \
-destination 'platform=iOS Simulator,OS=13.4,name=iPhone 8'

xcodebuild -workspace MPCF-TestBench.xcworkspace \
-scheme MPCF-TestRunner-ios \
-destination 'platform=iOS Simulator,OS=13.4,name=iPhone 8'

xcodebuild -workspace MPCF-TestBench.xcworkspace \
-scheme MPCF-Reflector-mac

xcodebuild -workspace MPCF-TestBench.xcworkspace \
-scheme MPCF-TestRunner-mac

xcodebuild -workspace MPCF-TestBench.xcworkspace \
-scheme MPCF-Reflector-tvOS \
-destination 'platform=tvOS Simulator,OS=13.4,name=Apple TV'

linting the code

brew bundle
swift format lint --configuration .swift-format-config -r .

mpcf-testbench's People

Contributors

heckj avatar

Stargazers

Pushpal Roy avatar Aidar Nugmanoff avatar Iain Smith avatar YoungChief avatar Julián Romero avatar Marcelo Perretta avatar  avatar

Watchers

 avatar Marcelo Perretta avatar  avatar

mpcf-testbench's Issues

fix how testrunner displays receiving values

The mechanism that I have in place works fine for small values, but it quadratic and goes to crap quiclyl with large bursts of data (1,000+ values), and ends up locking the CPU doing the gymnastics to count the values returned - which shouldn't be that bad, but I was foolish.

Redesign this whole flow so that the UI updates as we get receipts for sent values, but doesn't use quadratic computation insanity.

iOS data export

refactor the kit to try and use UIDocument, and see if that nets things further. It's exporting, but there's some hang where you never get an end-state when it's done exporting. I suspect the UIKit stuff "auto-dismisses" but that's not happening with SwiftUI

create a span view - text based

create a view that can provide visual output from a Span - an individual element, so they can be inspected with a text view

break up the views even more

break up the component views and refactor them down to the basics so they're easier to mix and match, and remove what's no longer relevant

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.