
nobjective
NObjective bridge to Objective-C provides the necessary classes to develop and run .NET applications which interact with Objective-C frameworks and libraries under Mac OS X with high performance and reliability.
<wiki:gadget url="http://www.ohloh.net/p/309337/widgets/project_users.xml?style=blue" height="100" border="0" />
Description:- High-performance solution with minimal cpu/memory overheads compared to similar bridges ( Monobjc, Mobjc, Cocoa# )
- Huge library of automatically generated proxies around Objective-C classes
- More than 2300 classes and 23000 methods can be used directly from your .NET code
- Proxies are generated using Objective-C introspection. Using .h files parsing provides more natural method signatures.
- Generates essential enums and structs
- Also proxies can be generated without C header files
- More than 2300 classes and 23000 methods can be used directly from your .NET code
- Transparent cross-runtime exception rethrowing
- from managed to unmanaged world
- from unmanaged to managed world
- from managed to unmanaged world
- Easy access to major Mac OS X frameworks and libraries
- Ability to generate Objective-C proxies for any framework
- Ability to build your own types that can be used inside Cocoa
- Ability to generate Objective-C proxies for any framework
- Combines flexibility of managed and power of unmanaged code to achieve highest performance
- Deep integration with Objective-C runtime
- Ships with x86/ppc UB library
- Deep integration with Objective-C runtime
- Used special coding style which provides exellent perception
- Client applications can be written in some .NET language ( C#, VB.NET, etc )
- Works with the most popular versions of OS X:
- MacOS Tiger 10.4 ( x86/ppc )
- about 2000 classes and 20000 methods are available
- about 2000 classes and 20000 methods are available
- MacOS Leopard 10.5 ( x86/ppc )
- about 2300 classes and 23000 methods are available
- about 2300 classes and 23000 methods are available
- MacOS Snow Leopard 10.6 ( x86 )
- about 2300 classes and 23000 methods are available
- about 2300 classes and 23000 methods are available
- MacOS Tiger 10.4 ( x86/ppc )
- Open Source, Free Software
<wiki:gadget url="http://www.ohloh.net/p/309337/widgets/project_languages.xml" border="0" height="240" width="400" />
Notes: * Library aimed on mature Objective-C developers so if something will not work.. use Objective-C before shout that the bridge sucks. * Library doesn't provide any tools to simplify your build process on Mac.
Planned features: * Create hierarchy for property accessors. * Add Property synthezation for exported classes. * Add Ivars accessors for generated proxies. * Add bitset accessors for generated structs. * Reduce metadata size after fixing P/Invoke layer for vararg calls in Mono.
Also you can make project better! * Useful patches are welcomed! * Ask mono team to implement value type inheritance properly in compiler (it should not able to create such inheritance from C# code, but able to work with such structs referenced from assemblies ) and execution engine. Currently it behaviour differs from MS implementation. With such feature Proxy Dlls will about 4 times smaller. But Novell customers not interested in fast and efficient bindings (compatible on IL level with MS CLR) so it would be trouble. * Ask mono team to implement 'arglist' and related keywords in compiler and execution engine - it will reduce metadata size for native calls. Mono team don't like refactoring ( need to refactor P/Invoke layer for vararg calls ) so it would be trouble.
Results of simple performance benchmark:
1) Mac Pro ( Intel Xeon ) OS X 10.6.2 ``` Jack$ ./run_leopard_tests.sh
Mono JIT compiler version 2.6.3 (tarball Wed Mar 10 18:18:12 MST 2010) Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none
NObjective v0.9.6.0 results: Invocations per second: 7342143 Allocations per second: 4179728 Vararg invocations per second: 36452 Protected calls per second: 224517 Exception rethrows per second: 28563 Managed memory consumption (KiB): 472 Unmanaged memory consumption (KiB): 19076
Monobjc v2.0.492.0 results: Invocations per second: 1128158 Allocations per second: 119183 Vararg invocations per second: 20386 Managed memory consumption (KiB): 14876 Unmanaged memory consumption (KiB): 44860
mobjc v0.7.0.0 results: Invocations per second: 73379 Allocations per second: 17912 Protected calls per second: 16635 Exception rethrows per second: 913 Managed memory consumption (KiB): 1384 Unmanaged memory consumption (KiB): 115772
cocoa-sharp v1.9.0.0 results: Invocations per second: 47828 Allocations per second: 10930 Vararg invocations per second: 2531 Managed memory consumption (KiB): 29072 Unmanaged memory consumption (KiB): 71344
```
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|9694|19389|29084&cht=bhg&chd=t:1.62288543529088|51.1483977444643|4.75863017466648|100&chdl=NObjective|Monobjc|mobjc|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|38590|77181|115772&cht=bhg&chd=t:16.4772138340877|38.7485747849221|100|61.8007808451094&chdl=NObjective|Monobjc|mobjc|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
Note: vararg calls not implemented in mobjc
Note: cross-runtime exception rethrowing not supported by monobjc/cocoa#
2) Mac Pro ( Intel Xeon ) OS X 10.5.8 ``` ./run_leopard_tests.sh
Mono JIT compiler version 2.6.3 (tarball Wed Mar 10 18:18:12 MST 2010) Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none
NObjective v0.9.6.0 results: Invocations per second: 6731740 Allocations per second: 4285408 Vararg invocations per second: 36170 Protected calls per second: 217997 Exception rethrows per second: 29442 Managed memory consumption (KiB): 476 Unmanaged memory consumption (KiB): 16008
Monobjc v2.0.492.0 results: Invocations per second: 1206709 Allocations per second: 129954 Vararg invocations per second: 20877 Managed memory consumption (KiB): 14116 Unmanaged memory consumption (KiB): 42220
mobjc v0.7.0.0 results: Invocations per second: 72914 Allocations per second: 21188 Protected calls per second: 16732 Exception rethrows per second: 804 Managed memory consumption (KiB): 1364 Unmanaged memory consumption (KiB): 61484
cocoa-sharp v1.9.0.0 results: Invocations per second: 48668 Allocations per second: 10461 Vararg invocations per second: 2459 Managed memory consumption (KiB): 29092 Unmanaged memory consumption (KiB): 65548 ```
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|9697|19394|29092&cht=bhg&chd=t:1.63618864292589|48.521930427609|4.68857417846831|100&chdl=NObjective|Monobjc|mobjc|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|21849|43698|65548&cht=bhg&chd=t:24.4217977665222|64.4108134496857|93.7999633856105|100&chdl=NObjective|Monobjc|mobjc|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
3) PowerMac
G4 1GHz OS X 10.5.8
```
./run_leopard_tests.sh
Mono JIT compiler version 2.6.3 (tarball Wed Mar 10 18:31:54 MST 2010) Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: ppc Disabled: none
NObjective v0.9.6.0 results: Invocations per second: 813504 Allocations per second: 518510 Vararg invocations per second: 5902 Protected calls per second: 26115 Exception rethrows per second: 7383 Managed memory consumption (KiB): 448 Unmanaged memory consumption (KiB): 16360
Monobjc v2.0.492.0 results:
Unhandled Exception: System.ExecutionEngineException: SIGILL mobjc v0.7.0.0 results: Invocations per second: 10845 Allocations per second: 5730 Protected calls per second: 2437 Exception rethrows per second: 173 Managed memory consumption (KiB): 1364 Unmanaged memory consumption (KiB): 61948
cocoa-sharp v1.9.0.0 results: Invocations per second: 8708 Allocations per second: 1778 Vararg invocations per second: 455 Managed memory consumption (KiB): 28484 Unmanaged memory consumption (KiB): 63384 ```
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|9494|18989|28484&cht=bhg&chd=t:1.57281280719|4.78865327903384|100&chdl=NObjective|mobjc|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|21128|42256|63384&cht=bhg&chd=t:25.8109302032059|97.7344440237284|100&chdl=NObjective|mobjc|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
Note Monobjc 2.0.492 didn't work on PowerPC with mono 2.6.3
4) PowerMac
G4 1GHz OS X 10.4.11
```
./run_tiger_tests.sh
Mono JIT compiler version 2.6.3 (tarball Wed Mar 10 18:31:54 MST 2010) Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: ppc Disabled: none
NObjective v0.9.6.0 results: Invocations per second: 992999 Allocations per second: 467836 Vararg invocations per second: 3660 Protected calls per second: 28710 Exception rethrows per second: 4167 Managed memory consumption (KiB): 448 Unmanaged memory consumption (KiB): 16344
Monobjc v1.0.492.0 results:
Unhandled Exception: System.ExecutionEngineException: SIGILL cocoa-sharp v1.9.0.0 results: Invocations per second: 5673 Allocations per second: 1945 Vararg invocations per second: 444 Managed memory consumption (KiB): 46300 Unmanaged memory consumption (KiB): 95768 ```
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|15433|30866|46300&cht=bhg&chd=t:0.967602591792657|100&chdl=NObjective|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
&chts=000000,12&chs=1000x120&chf=bg,s,ffffff|c,s,ffffff&chxt=x,y&chxl=1:||0:|0|31922|63845|95768&cht=bhg&chd=t:17.0662434216022|100&chdl=NObjective|cocoa-sharp&chco=cc0000,003399,ff00cc,cc6600&chbh=10&nonsense=something_that_ends_with.png)
Note Monobjc 2.0.492 didn't work on PowerPC with mono 2.6.3
Libraries used: * NObjective v0.9.5 * Monobjc v2.0.404 * Mobjc v0.7 * Cocoa# v0.9.4
Contacts:
Email: eugeny.grishul(a)gmail.com
Facebook: http://www.facebook.com/profile.php?id=1038466393
VKontakte: http://vkontakte.ru/id181869
WBR, Eugeny Grishul
Project Information
- License: GNU Lesser GPL
- 15 stars
- svn-based source control
Labels:
benchmark
.net
mono
objective-c
objc
bridge
macintosh
C
NObjective
objc_msgSend
bridge
monobjc
mobjc
cocoa
cocoa-sharp