[plactorkit commit] r23 - Add an instrumentation case for PLActorRPCProxy message send performance.

0 views
Skip to first unread message

codesite...@google.com

unread,
May 8, 2009, 6:53:11 PM5/8/09
to plactorki...@googlegroups.com
Author: landon.j.fuller
Date: Fri May 8 14:33:43 2009
New Revision: 23

Added:
trunk/Source/PLActorRPCProxyInstrumentation.m
Modified:
trunk/ActorKit.xcodeproj/project.pbxproj

Log:
Add an instrumentation case for PLActorRPCProxy message send performance.


Modified: trunk/ActorKit.xcodeproj/project.pbxproj
==============================================================================
--- trunk/ActorKit.xcodeproj/project.pbxproj (original)
+++ trunk/ActorKit.xcodeproj/project.pbxproj Fri May 8 14:33:43 2009
@@ -87,6 +87,8 @@
05389E8E0EE6113300F8AA6F /* PLActorSimpleQueue.m in Sources */ = {isa =
PBXBuildFile; fileRef = 057706DA0ECA49AA00103B8A /* PLActorSimpleQueue.m
*/; };
05389E940EE6113300F8AA6F /* PLActorWriteLockQueue.m in Sources */ = {isa
= PBXBuildFile; fileRef = 0587F9670ECEB6D10066A0BC /*
PLActorWriteLockQueue.m */; };
05411B0E0E47B385009E3C18 /* Foundation.framework in Frameworks */ = {isa
= PBXBuildFile; fileRef = 05411B0C0E47B385009E3C18 /* Foundation.framework
*/; };
+ 055DE14D0FB4D24400901A92 /* PLActorRPCProxyInstrumentation.m in Sources
*/ = {isa = PBXBuildFile; fileRef = 055DE14C0FB4D24400901A92 /*
PLActorRPCProxyInstrumentation.m */; };
+ 055DE14E0FB4D24400901A92 /* PLActorRPCProxyInstrumentation.m in Sources
*/ = {isa = PBXBuildFile; fileRef = 055DE14C0FB4D24400901A92 /*
PLActorRPCProxyInstrumentation.m */; };
056E46170E492ACD00F3319F /* PLActorKitTests.m in Sources */ = {isa =
PBXBuildFile; fileRef = 056E46160E492ACD00F3319F /* PLActorKitTests.m */; };
0577070E0ECA4E7400103B8A /* PLActorSimpleQueueTests.m in Sources */ =
{isa = PBXBuildFile; fileRef = 0577070D0ECA4E7400103B8A /*
PLActorSimpleQueueTests.m */; };
057708070ECA57D100103B8A /* main.m in Sources */ = {isa = PBXBuildFile;
fileRef = 057707E30ECA568A00103B8A /* main.m */; };
@@ -227,6 +229,7 @@
05411ACD0E47AD0B009E3C18 /* Tests-Info.plist */ = {isa =
PBXFileReference; lastKnownFileType = text.plist.xml; path
= "Tests-Info.plist"; sourceTree = "<group>"; };
05411B0C0E47B385009E3C18 /* Foundation.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
Foundation.framework; path =
/System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>";
};
05411B120E47B3AA009E3C18 /* PLActorKit.m */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path =
PLActorKit.m; sourceTree = "<group>"; };
+ 055DE14C0FB4D24400901A92 /* PLActorRPCProxyInstrumentation.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = PLActorRPCProxyInstrumentation.m; sourceTree = "<group>"; };
056E46160E492ACD00F3319F /* PLActorKitTests.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = PLActorKitTests.m; sourceTree = "<group>"; };
057706BE0ECA40E600103B8A /* PLActorQueue.h */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
PLActorQueue.h; sourceTree = "<group>"; };
057706C00ECA417500103B8A /* PLActorSimpleQueue.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = PLActorSimpleQueue.h; sourceTree = "<group>"; };
@@ -335,6 +338,7 @@
0520FCDA0EA003AA000B1751 /* PLActorRPCProxy.h */,
0520FCDB0EA003AA000B1751 /* PLActorRPCProxy.m */,
0520FCE00EA003B6000B1751 /* PLActorRPCProxyTests.m */,
+ 055DE14C0FB4D24400901A92 /* PLActorRPCProxyInstrumentation.m */,
);
name = RPC;
sourceTree = "<group>";
@@ -827,6 +831,7 @@
052C2F2B0EE615020023E46D /* PLActorQueueInstruments.m in Sources */,
052C2F2C0EE615020023E46D /* PLActorWriteLockQueueInstrumentation.m in
Sources */,
0577080C0ECA57E200103B8A /* main.m in Sources */,
+ 055DE14E0FB4D24400901A92 /* PLActorRPCProxyInstrumentation.m in
Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -838,6 +843,7 @@
052C2F2E0EE6150A0023E46D /* PLActorQueueInstruments.m in Sources */,
052C2F2F0EE6150A0023E46D /* PLActorWriteLockQueueInstrumentation.m in
Sources */,
057708070ECA57D100103B8A /* main.m in Sources */,
+ 055DE14D0FB4D24400901A92 /* PLActorRPCProxyInstrumentation.m in
Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

Added: trunk/Source/PLActorRPCProxyInstrumentation.m
==============================================================================
--- (empty file)
+++ trunk/Source/PLActorRPCProxyInstrumentation.m Fri May 8 14:33:43 2009
@@ -0,0 +1,72 @@
+/*
+ * Author: Landon Fuller <lan...@plausiblelabs.com>
+ * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#import "ActorKit.h"
+
+#import <PLInstrument/PLInstrument.h>
+
+@interface PLActorRPCProxyInstrumentation : PLInstrumentCase
+@end
+
+#define ITERATIONS 1000000
+
+@implementation PLActorRPCProxyInstrumentation
+
+- (void) echo {
+ // Do nothing
+}
+
+/**
+ * Run ITERATIONS of synchonous Objective-C
-[PLActorRPCProxyInstrumentation echo] method calls
+ * with the given destination instance.
+ */
+- (PLInstrumentResult *) runWithDestination:
(PLActorRPCProxyInstrumentation *) dest {
+ PLIAbsoluteTime start, finish;
+
+ start = PLICurrentTime();
+ for (int i = 0 ; i < ITERATIONS; i++) {
+ [dest echo];
+ }
+ finish = PLICurrentTime();
+
+ return [PLInstrumentResult resultWithStartTime: start endTime: finish
iterations: ITERATIONS];
+}
+
+/**
+ * Instrument raw (non-proxy) Objective-C send/receive, for comparison
purposes.
+ */
+- (PLInstrumentResult *) instrumentRawMessaging {
+ return [self runWithDestination: self];
+}
+
+/**
+ * Instrument proxy-based Objective-C send/receive.
+ */
+- (PLInstrumentResult *) instrumentActorRPCProxyMessaging {
+ return [self runWithDestination: [PLActorRPCProxy proxyWithTarget:
self]];
+}
+
+@end

Reply all
Reply to author
Forward
0 new messages