Changeset 228023 in webkit
- Timestamp:
- Feb 2, 2018 12:30:23 PM (6 years ago)
- Location:
- trunk/PerformanceTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/ChangeLog
r227946 r228023 1 2018-02-01 Geoffrey Garen <ggaren@apple.com> 2 3 Make MallocBench easier for non-WebKit engineers to run 4 https://bugs.webkit.org/show_bug.cgi?id=182415 5 6 Reviewed by Saam Barati. 7 8 * MallocBench/MallocBench.xcodeproj/project.pbxproj: Use c++14 so we 9 can make_unique. 10 11 Specify that we support all Darwin platforms so you can test them. 12 13 * MallocBench/run-malloc-benchmarks: Specify the path to MallocBench 14 and libmbmalloc explicitly, rather than computing them implicitly 15 using webkitdirs. Non-WebKit folks don't have the directory structure 16 required by webkitdirs. 17 18 Remove Linux-specific and cmake-specific behaviors because we only 19 needed them in the world of implicit path computation. 20 1 21 2018-01-31 Ryosuke Niwa <rniwa@webkit.org> 2 22 -
trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj
r222900 r228023 370 370 buildSettings = { 371 371 ALWAYS_SEARCH_USER_PATHS = NO; 372 CLANG_CXX_LANGUAGE_STANDARD = " gnu++0x";372 CLANG_CXX_LANGUAGE_STANDARD = "c++14"; 373 373 CLANG_CXX_LIBRARY = "libc++"; 374 374 CLANG_ENABLE_MODULES = YES; … … 397 397 GCC_WARN_UNUSED_FUNCTION = YES; 398 398 GCC_WARN_UNUSED_VARIABLE = YES; 399 IPHONEOS_DEPLOYMENT_TARGET = 11.3; 399 400 MACOSX_DEPLOYMENT_TARGET = 10.9; 400 401 ONLY_ACTIVE_ARCH = YES; 401 402 SDKROOT = macosx; 403 SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 402 404 }; 403 405 name = Debug; … … 407 409 buildSettings = { 408 410 ALWAYS_SEARCH_USER_PATHS = NO; 409 CLANG_CXX_LANGUAGE_STANDARD = " gnu++0x";411 CLANG_CXX_LANGUAGE_STANDARD = "c++14"; 410 412 CLANG_CXX_LIBRARY = "libc++"; 411 413 CLANG_ENABLE_MODULES = YES; … … 429 431 GCC_WARN_UNUSED_FUNCTION = YES; 430 432 GCC_WARN_UNUSED_VARIABLE = YES; 433 IPHONEOS_DEPLOYMENT_TARGET = 11.3; 431 434 MACOSX_DEPLOYMENT_TARGET = 10.9; 432 435 SDKROOT = macosx; 436 SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 433 437 }; 434 438 name = Release; -
trunk/PerformanceTests/MallocBench/run-malloc-benchmarks
r222900 r228023 4 4 require 'getoptlong' 5 5 require 'pathname' 6 7 $binDir = "#{File.expand_path(File.dirname(__FILE__))}"8 $productDir = `perl -e 'use lib \"#{$binDir}/../../Tools/Scripts\"; use webkitdirs; print productDir()'`9 10 def determineOS11 case RbConfig::CONFIG["host_os"]12 when /darwin/i13 "darwin"14 when /linux/i15 "linux"16 when /mswin|mingw|cygwin/17 "windows"18 else19 $stderr.puts "Warning: unable to determine host operating system"20 nil21 end22 end23 24 $hostOS = determineOS unless $hostOS25 $cmake = false26 27 if $hostOS == 'darwin'28 $libraryExtension = "dylib"29 else30 $libraryExtension = "so"31 end32 6 33 7 $benchmarks_all = [ … … 97 71 98 72 def usage 99 puts "run-malloc-benchmarks [options] <Name:/path/to/dylib> [<Name:/path/to/dylib>]"73 puts "run-malloc-benchmarks [options] /path/to/MallocBench Name:/path/to/libmbmalloc.dylib [ Name:/path/to/libmbmalloc.dylib ]" 100 74 puts 101 75 puts " Runs a suite of memory allocation and access benchmarks." 102 76 puts 103 puts " <Name:/path/to/ dylib> is a symbolic name followed by a folder containing alibmbmalloc.dylib."77 puts " <Name:/path/to/libmbmalloc.dylib> is a symbolic name followed by a path to libmbmalloc.dylib." 104 78 puts 105 79 puts " Specify \"SystemMalloc\" to test the built-in libc malloc." … … 108 82 puts " Example usage:" 109 83 puts 110 puts " run-malloc-benchmarks SystemMalloc NanoMalloc"111 puts " run-malloc-benchmarks FastMalloc:/path/to/FastMalloc/Build/Products/Release/"112 puts " run-malloc-benchmarks --benchmark churn SystemMalloc FastMalloc:/path/to/FastMalloc/Build/Products/Release/"84 puts " run-malloc-benchmarks /BUILD/MallocBench SystemMalloc:/BUILD/libmbmalloc.dylib NanoMalloc:/BUILD/libmbmalloc.dylib" 85 puts " run-malloc-benchmarks /BUILD/MallocBench FastMalloc:/BUILD/FastMalloc/libmbmalloc.dylib" 86 puts " run-malloc-benchmarks --benchmark churn SystemMalloc:/BUILD/libmbmalloc.dylib FastMalloc:/BUILD/FastMalloc/libmbmalloc.dylib" 113 87 puts 114 88 puts "Options:" … … 116 90 puts " --benchmark <benchmark> Select a single benchmark to run instead of the full suite." 117 91 puts " --heap <heap> Set a baseline heap size." 118 puts " --cmake Specify if build directory layout is for CMake."119 92 puts 120 93 end … … 126 99 def initialize(name, path) 127 100 @name = name 128 @path = File.join(path, "libmbmalloc.#{$libraryExtension}")101 @path = path 129 102 end 130 103 end … … 239 212 GetoptLong.new( 240 213 ['--benchmark', GetoptLong::REQUIRED_ARGUMENT], 241 ['--cmake', GetoptLong::NO_ARGUMENT],242 214 ['--memory', GetoptLong::NO_ARGUMENT], 243 215 ['--memory_warning', GetoptLong::NO_ARGUMENT], … … 253 225 when '--memory_warning' 254 226 $benchmarks = $benchmarks_memory_warning 255 when '--cmake'256 $cmake = true257 227 when '--heap' 258 228 $heap = arg … … 265 235 } 266 236 267 if $cmake268 $libraryDir = "#{$productDir}/lib"269 $systemMallocLibraryDir = "#{$productDir}/lib/system"270 $binaryDir = "#{$productDir}/bin"271 else272 $libraryDir = $productDir273 $binaryDir = $productDir274 $systemMallocLibraryDir = $productDir275 end276 277 237 if ARGV.length < 1 238 puts "Error: No MallocBench specified." 239 exit 1 240 end 241 242 if ARGV.length < 2 278 243 puts "Error: No dylib specified." 279 244 exit 1 280 245 end 246 247 $mallocBench = File.absolute_path(ARGV.shift) 248 if !File.exists?($mallocBench) 249 puts "File not found: #{$mallocBench}." 250 exit 1 251 end 252 253 $buildDir = Pathname.new($mallocBench).dirname 281 254 282 255 dylibs = [] 283 256 ARGV.each { 284 257 | arg | 285 if arg == "SystemMalloc" 286 dylib = Dylib.new("SystemMalloc", $systemMallocLibraryDir) 287 elsif arg == "NanoMalloc" 288 dylib = Dylib.new("NanoMalloc", $libraryDir) 289 else 290 name = arg.split(":")[0] 291 path = arg.split(":")[1] 292 if !name || name.length < 1 || 293 !path || path.length < 1 294 puts "Invalid <Name:/path/to/dylib>: '#{arg}'." 295 exit 1 296 end 297 298 dylib = Dylib.new(name, File.expand_path(path)) 299 end 258 name, path = arg.split(":") 259 if !name || name.length < 1 || 260 !path || path.length < 1 261 puts "Invalid <Name:/path/to/dylib>: '#{arg}'." 262 exit 1 263 end 264 265 dylib = Dylib.new(name, File.expand_path(path)) 300 266 301 267 if !File.exists?(dylib.path) … … 329 295 if dylib.name == "NanoMalloc" 330 296 env += "MallocNanoZone=1 " 297 elsif dylib.name == "SystemMalloc" 298 env += "MallocNanoZone=0 " 331 299 end 332 input = "cd '#{$ productDir}'; #{env} '#{$binaryDir}/MallocBench' --benchmark #{benchmark} --heap #{$heap}}"300 input = "cd '#{$buildDir}'; #{env} '#{$mallocBench}' --benchmark #{benchmark} --heap #{$heap}}" 333 301 output =`#{input}` 334 302 splitOutput = output.split("\n")
Note: See TracChangeset
for help on using the changeset viewer.