Skip to content

Commit

Permalink
Source file re-ordering for performance after trace
Browse files Browse the repository at this point in the history
  • Loading branch information
johnno1962 committed Oct 20, 2020
1 parent bddabe3 commit ac903b6
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 171 deletions.
2 changes: 2 additions & 0 deletions InjectionBundle/InjectionClient.h
Expand Up @@ -43,6 +43,7 @@ typedef NS_ENUM(int, InjectionCommand) {
InjectionStats,
InjectionCallOrder,
InjectionFileOrder,
InjectionFileReorder,

InjectionInvalid = 1000,

Expand All @@ -57,6 +58,7 @@ typedef NS_ENUM(int, InjectionResponse) {
InjectionError,
InjectionFrameworkList,
InjectionCallOrderList,
InjectionCallReorderList,

InjectionExit = ~0
};
Expand Down
8 changes: 7 additions & 1 deletion InjectionBundle/InjectionClient.mm
Expand Up @@ -5,7 +5,7 @@
// Created by John Holdsworth on 06/11/2017.
// Copyright © 2017 John Holdsworth. All rights reserved.
//
// $Id: //depot/ResidentEval/InjectionBundle/InjectionClient.mm#131 $
// $Id: //depot/ResidentEval/InjectionBundle/InjectionClient.mm#133 $
//

#import "InjectionClient.h"
Expand Down Expand Up @@ -320,6 +320,12 @@ - (void)runInBackground {
componentsJoinedByString:CALLORDER_DELIMITER]];
[self needsTracing];
break;
case InjectionFileReorder:
[self writeCommand:InjectionCallReorderList
withString:[[SwiftInjection callOrder]
componentsJoinedByString:CALLORDER_DELIMITER]];
[self needsTracing];
break;
case InjectionInvalid:
printf("💉 ⚠️ Connection rejected. Are you running the correct version of InjectionIII.app from /Applications? ⚠️\n");
break;
Expand Down
102 changes: 89 additions & 13 deletions InjectionIII.xcodeproj/project.pbxproj
Expand Up @@ -83,6 +83,8 @@
BBE64E5D2524D1B50049B6D4 /* SwiftEval.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB439B8A1FABA65D00B4F50B /* SwiftEval.swift */; };
BBEB704C1FD28C6F00127711 /* XcodeHash.m in Sources */ = {isa = PBXBuildFile; fileRef = BBEB704B1FD28C6F00127711 /* XcodeHash.m */; };
BD35949E21A6C5DE0020EB94 /* Vaccine.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD35949D21A6C5DE0020EB94 /* Vaccine.swift */; };
CEC1702A253ED117002E823F /* Experimental.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC17029253ED117002E823F /* Experimental.swift */; };
CEC17035253ED472002E823F /* SwiftRegex in Frameworks */ = {isa = PBXBuildFile; productRef = CEC17034253ED472002E823F /* SwiftRegex */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -261,6 +263,7 @@
BBEB704B1FD28C6F00127711 /* XcodeHash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeHash.m; sourceTree = "<group>"; };
BD35949D21A6C5DE0020EB94 /* Vaccine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vaccine.swift; sourceTree = "<group>"; };
BDB6A7CE21824C800001CF95 /* UserDefaults.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserDefaults.h; sourceTree = "<group>"; };
CEC17029253ED117002E823F /* Experimental.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Experimental.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -291,6 +294,7 @@
files = (
BBB64FEC1FD585D50020BE47 /* WebKit.framework in Frameworks */,
BBB040641FB17A6C007DDD0A /* ScriptingBridge.framework in Frameworks */,
CEC17035253ED472002E823F /* SwiftRegex in Frameworks */,
BBB64DE51FD571310020BE47 /* libz.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -483,6 +487,7 @@
BBCA02011FB0F10300E45F0F /* AppDelegate.swift */,
BB7D7CAB2512F8F00069FE2C /* UpdateCheck.swift */,
BBCA02551FB1099500E45F0F /* InjectionServer.swift */,
CEC17029253ED117002E823F /* Experimental.swift */,
BBE490CE1FB2368A003D41BB /* FileWatcher.swift */,
BBCA025A1FB1132700E45F0F /* Xcode.h */,
BBEB704A1FD28C6F00127711 /* XcodeHash.h */,
Expand Down Expand Up @@ -657,6 +662,9 @@
BB1A8406252266D4003873C3 /* PBXTargetDependency */,
);
name = InjectionIII;
packageProductDependencies = (
CEC17034253ED472002E823F /* SwiftRegex */,
);
productName = InjectionIII;
productReference = BBCA01FE1FB0F10300E45F0F /* InjectionIII.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -750,6 +758,9 @@
Base,
);
mainGroup = BB439B5C1FABA64300B4F50B;
packageReferences = (
CEC17033253ED472002E823F /* XCRemoteSwiftPackageReference "SwiftRegex5" */,
);
productRefGroup = BB439B661FABA64300B4F50B /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -935,6 +946,7 @@
BBB64DD41FD56F570020BE47 /* XprobeConsole.m in Sources */,
BBCA022A1FB0F64800E45F0F /* SimpleSocket.mm in Sources */,
BB79FC79245CC02200A4B4CB /* TimeLapseBuilder.swift in Sources */,
CEC1702A253ED117002E823F /* Experimental.swift in Sources */,
BB56393C1FD5C25A002FFCEF /* SignerService.m in Sources */,
BBEB704C1FD28C6F00127711 /* XcodeHash.m in Sources */,
BBCA02021FB0F10300E45F0F /* AppDelegate.swift in Sources */,
Expand Down Expand Up @@ -1047,7 +1059,11 @@
INFOPLIST_FILE = SwiftUISupport/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../../macOSInjection.bundle/Contents/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../../macOSInjection.bundle/Contents/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1084,7 +1100,11 @@
INFOPLIST_FILE = SwiftUISupport/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../../macOSInjection.bundle/Contents/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../../macOSInjection.bundle/Contents/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.SwiftUISupport;
Expand Down Expand Up @@ -1150,7 +1170,10 @@
GCC_WARN_UNUSED_VARIABLE = YES;
HELPER_MACH_ID = com.johnholdsworth.InjectionIII.Helper.mach;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/$(SWIFT_PLATFORM_TARGET_PREFIX) $PLATFORM_DIR/Developer/Library/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(SWIFT_PLATFORM_TARGET_PREFIX)",
$PLATFORM_DIR/Developer/Library/Frameworks,
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=150";
Expand Down Expand Up @@ -1213,11 +1236,15 @@
GCC_WARN_UNUSED_VARIABLE = YES;
HELPER_MACH_ID = com.johnholdsworth.InjectionIII.Helper.mach;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/$(SWIFT_PLATFORM_TARGET_PREFIX) $PLATFORM_DIR/Developer/Library/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(SWIFT_PLATFORM_TARGET_PREFIX)",
$PLATFORM_DIR/Developer/Library/Frameworks,
);
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = macOSInjection;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
Expand All @@ -1231,7 +1258,11 @@
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = SwiftEvalTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.SwiftEvalTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1249,7 +1280,11 @@
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = SwiftEvalTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.SwiftEvalTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1281,7 +1316,11 @@
);
INFOPLIST_FILE = SwiftTrace/SwiftTrace/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1314,7 +1353,11 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftTrace/SwiftTrace/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.SwiftTrace;
Expand Down Expand Up @@ -1384,7 +1427,11 @@
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = InjectionBundle/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LD_RUNPATH_SEARCH_PATHS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME) /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME)",
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks,
"@loader_path/../Frameworks",
);
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionBundle;
Expand All @@ -1409,7 +1456,11 @@
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = InjectionBundle/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LD_RUNPATH_SEARCH_PATHS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME) /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME)",
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks,
"@loader_path/../Frameworks",
);
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionBundle;
Expand Down Expand Up @@ -1442,7 +1493,10 @@
"$(inherited)",
);
INFOPLIST_FILE = EvalApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand All @@ -1467,7 +1521,10 @@
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = EvalApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.EvalApp;
Expand Down Expand Up @@ -1544,6 +1601,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
CEC17033253ED472002E823F /* XCRemoteSwiftPackageReference "SwiftRegex5" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "http://github.com/johnno1962/SwiftRegex5";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.2.1;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
CEC17034253ED472002E823F /* SwiftRegex */ = {
isa = XCSwiftPackageProductDependency;
package = CEC17033253ED472002E823F /* XCRemoteSwiftPackageReference "SwiftRegex5" */;
productName = SwiftRegex;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = BB439B5D1FABA64300B4F50B /* Project object */;
}

0 comments on commit ac903b6

Please sign in to comment.