UPDATE APRIL 2017
I just tried to follow my own directions and found out that Instruments no longer lets you export CSV data that the Time Profiler collects (I’m currently using Instruments Version 8.3 (8E162)). I’m leaving the rest of the post as-is in case it’s useful to anyone still on an older version of Instruments, but any point after the export won’t work, so no pretty flame graphs anymore :( There’s still analysis of performance you can do within Instruments.
Download Minecraft texture packs to update game graphics for any version or resolution. Sort Minecraft resource packs by category, resolution and game version! 3 / Synthesis Algorithims. MiniSpillage is a free professional quality drum synthesizer plugin featuring high resolution 64-bit DSP processing. MiniSpillage includes 3 exclusive drum synthesis algorithms along with distortion effects and resonant filters. Reveal your inner musician in the Instrument Pack for Rust - a collection of 10 new musical instruments! Lay down a beat with the Drum Kit, belt out a tune on the Piano and become popular with your friends with the Cowbell! These new instruments use a new range of notes letting you play a variety of music. Mod Pack (Includes: Flair, Choral and Phasis effects) Native Instruments Komplete 12 64-bit (AU and VST Format) Mac OSx 10.12, 10.13, 10.14 Direct Download (373MB).
Original Post
I recently decided I wanted to figure out a way to measure the performance of the Rust code I’ve been writing and see pretty graphs of what parts of the code were slower. There are a bunch of different ways to do this, and I was going to cover more than one of them, but I am le tired so I decided to post this after writing only about Instruments + FlameGraph.
My somewhat-arbitrary constraints used in picking this method of profiling and graphing:
- Profile Rust programs’ time (I’d like to profile memory usage too, but that’ll be in another post)
- In a way that produces graphs
- On OSX (Linux has other, some may say better, options, but for getting a first look at the performance of my code at all, I don’t feel like booting a VM)
If these constraints are the same as yours, great! Read on! However, there are many more tools that didn’t meet these constraints (or that I didn’t find), so I encourage you to do research specific to your situation as well.
Prerequisites
For any profiling of Rust code on OSX, it’s recommended to do the following:
- Build with
cargo build --release
then run./target/release/[binary]
; or usecargo run --release
- Forgetting to build in release mode (which turns on optimizations) is the #1 cause of unexpected Rust slowness.
- By default, cargo builds in debug mode, which is faster to compile but runs more slowly.
- We want to profile the optimized code.
- Turn on debug symbols in your release profile in Cargo.toml
- This lets the profiling tools match up to your source code.
As documented on crates.io, this is done by adding this to your
Cargo.toml
:
- Use OSX’s system allocator instead of jemalloc
- This requires using nightly Rust.
- I’m not going to pretend to understand this, but it seems like valgrind might not report allocations correctly with jemalloc? It didn’t seem to hurt anything, but I’m not sure how important this is.
- More discussion on /r/rust about the impact of this on benchmarks.
As documented in the book, this is done by adding this code to your crate:
Protip on inlining
I had to consult with Jake Goulding on this one– I was profiling some code that had a function calling another function, and only the inner function was showing up. I couldn’t figure out why. Jake quickly looked at what I was doing and guessed correctly that the compiler was inlining the contents of the outer function as an optimization, so it effectively didn’t exist anymore.
Jake taught me about adding the annotation #[inline(never)]
before the outer function, which will tell the compiler to not inline it so that I could see the profiling for it.
Instruments
Instruments is a part of XCode. You’ve already downloaded 2 gigs of XCode, right?
- Open XCode. Don’t pick anything on the splash screen.
- From the XCode menu, choose “Open Developer Tool” -> “Instruments”.
- Choose a blank profiling template. (Or try others! I haven’t explored all the options yet)
- Click the “+” button in the upper right. Choose “Time Profiler” and drag it to the section in the upper left.
- In the upper left, after your computer name (yes, my computer’s name is the tableflip emoji), click on where it says “All processes” and click on “Choose Target” in order to choose just your executable instead of all processes. For some reason, populating the list of executables to choose from takes a long time, so don’t be alarmed.
- If needed, you can type environment variables and arguments into the “Choose Target” window. Here’s an example where I added some arguments:
- By default, the Time Profiler takes a sample every 1 ms. Because I was using a toy example, I found that I wasn’t getting interesting results because my code wasn’t being sampled very often, so I changed the sample interval from 1 ms to 40 microseconds in the lower right.
- Click the record button in the upper left and wait for it to run your code. You may need to give administrator privileges to Instruments. You’ll know it’s done when the button changes back to a record button after being a stop button.
- You do get a little bit of a graph across the top– From the View menu, choosing “Snap Track to Fit” makes it a little easier to see. It still doesn’t show very specific information though.
Flamegraph
Flamegraph is an awesome collection of perl scripts that can take the output of a few different profiling tools and produce a lovely SVG.
- To get the data out of Instruments for Flamegraph to use, I followed these instructions which say to:
- Expand all the nodes in the call tree: Option-click on all the roots to toggle them open
- From the Instrument menu, choose “Export track” and save the CSV.
Download the FlameGraph code and run:
- Open the resulting svg in your browser. You now have a pretty graph!!
Rust Instrument Mod
Here’s an SVG I made from the toy code in this repo.
Happy profiling!!!
'Air Music Technology’s latest incarnation of its Air Instrument Expansion Pack 3 is nothing short of phenomenal. An awe-inspiring collection of virtual instruments and high quality sound design tools and FX, this is, in my opinion, an essential buy for anyone making music in their computer, regardless of what platform they’re using. I can’t recommend it highly enough - I use it every day of my life!'Andy Richards
Keyboardist, Editor, Producer
UPGRADES:
Users who own previous versions of the AIR Instrument Expansion Pack, the AIEP 3 SELECT or a single AIR Music Technology instrument can upgrade for just $149.99 by entering their existing products serial number when asked for a promotional code during checkout. Need help? Please contact softwaresales@airmusictech.com
It's Time to Energize Your Music
The AIEP3 Complete Instrument Pack is an inspiring collection of twenty virtual instruments and progressive sound-design tools for the modern producer, composer and performer. Developed by AIR Music Technology, the team responsible for creating the award-winning virtual instruments and core effects offered with Avid’s Pro Tools software, the AIR Instrument Expansion Pack brings the world’s most innovative virtual instruments to your favorite DAW. These twenty instruments, ranging from breathtaking emulations of vintage gear, classic instruments and unique synthesis technologies, enable you to tap into familiar sounds or create something no one has ever heard before. With the AIEP3 Complete collection, if you can dream it, you can create it. There are no limits! Energize your music.
'An incredible collection of sophisticated instruments.'- Synthtopia.com
The AIR AIEP3 Complete Instrument Pack Includes:
• Hybrid 3.0 – High-Definition Analog & Wavetable Synth
• Loom – Modular Additive Synthesizer
• Vacuum Pro – Polyphonic Analog Tube Synthesizer
• Structure – Multi-Timbral Sampler Instrument
• Strike – Ultimate Virtual Drummer Instrument
• Velvet – Vintage Electric Piano Instrument
• Transfuser – Melodic & Rhythmic Groove-Creation Instrument
• THE RISER – Synth-based Transition Designer
• DB-33 – Tonewheel Organ Simulator
• MINI GRAND – Acoustic Grand Piano
• Fresh AIR Expansion – Presets for Vacuum Pro
• Flux Transitions Expansion – Presets for theRiser
• AIR Creative FX Collection PLUS – 28 Classic Audio FX
• XPAND!2 – MULTITIMBRAL ALL–IN–ONE WORKSTATION
• D. Ramirez Expansion – Presets for Hybrid 3
• Marco Lys Expansion – Presets for Hybrid 3
• Mark Knight Expansion – Presets for Hybrid 3
• Rene Amesz Expansion – Presets for Hybrid 3
• Tocadisco Expansion – Presets for Hybrid 3
• Analog Trap Expansion – Presets for Hybrid 3
The Ultimate Virtual Instrument Collection
The AIR AIEP3 Complete Instrument Pack combines multiple synthesis technologies, premium instrument samples, high-definition drums, vintage electric pianos, and a comprehensive groove-creation platform to provides today’s musician, composer, and producer with the latest innovations of German-engineered software. Hybrid 3.0 is an analog and wavetable synthesizer that combines the warmth of analog synthesis with futuristic digital controls; Loom is a modular additive synthesizer that lets you explore additive synthesis with 30 editable modules and a sound-shifting Morph Pad; Vacuum Pro is a polyphonic analog tube synthesizer that re-invents the gritty glory of the analog age; Structure delivers a world of sounds with multi-timbral layering and comprehensive sample editing; Strike is a drum and arranger instrument with a realistic performance engine; Velvet puts five sought-after electric pianos at your fingertips; and Transfuser is a melodic and groove creation that offers powerful sound manipulation capabilities. Altogether, the AIR instrument Expansion Pack includes 70+GB (uncompressed) samples, loops, effects, and 3000+ tweakable patches and presets programmed by legendary sound designers.
Universal Plugin Support
All twenty plugin instruments in the AIR AIEP3 Complete Instrument Pack are available in VST, AU, and AAX formats. Each title seamlessly integrates with popular DAWs such as Ableton Live, Logic, Cubase, Pro Tools, and more. The new AIR Instrument Expansion Pack includes the 2.0.2 enhancements of its 4 core offerings (Strike, Velvet, Structure, and Transfuser), 1.0.1 versions of Loom and Vacuum Pro, and AIR Music Tech’s flagship synthesizer – Hybrid 3.0.
AIR Music Technology is a trademark of inMusic Brands, Inc., registered in the U.S. and other countries. All other product or company names are trademarks or registered trademarks of their respective owners. Product features, specifications, system requirements, and availability are subject to change without notice.
Loom
- Loom, a modular additive synthesizer, comes packed with 30 editable modules and a sound-shifting Morph Pad. The intuitive Loom architecture enables you to quickly combine any of the 30 editable modules into 10 available cells to create unique and captivating sounds. The Morph Pad shifts your patch between user-defined variations to add richness, dynamics, and motion to your sounds.
Vacuum Pro
- Vacuum Pro is a polyphonic analog synthesizer with vacuum tube circuit modeling that perfectly captures the crunchy, warm sound of the analog era. With four analog oscillators, six vacuum tube circuits, multiple filters and envelopes, and built-in audio effects, Vacuum Pro lets you dive deep into subtractive synthesis to recreate those sought-after analog sounds from the 70s and 80s.
Hybrid 3.0
- Hybrid 3.0, a high-definition analog and wavetable synthesizer, combines the legendary warmth of analog synths with a full range of futuristic digital manipulation capabilities. The result is a versatile virtual instrument that can sound like a synth you remember or something no one has ever heard before.
Velvet
- Modeled off of five legendary electronic pianos, Velvet is a versatile instrument that features highly realistic emulations of the Fender Rhodes Suitcase, Fender Rhodes MK I and MK II Stage Pianos, Wurlitzer 200A and Hohner Pianet-T. With Velvet, you can tap into the vintage sound and response of these classic instruments.
Structure
- Structure is a multi-timbral sampler instrument that brings a world of sounds to your music. A massive 37GB premium sound library from AIR Music Tech includes acoustic and electronic drums, hand and pitched percussion, pianos and keyboards, choral sounds, guitars, basses, synth pads, synth leads, surround sounds, and atmospheres.
Strike
- A virtual drum instrument and arranger, Strike combines a world-class library of drum samples with a hyper-realistic performance engine. Strike puts you in the producer’s chair, allowing you to adjust and tweak the nuanced details of expertly recorded drum and percussion samples to create the perfect drum track.
Transfuser
- Transfuser is a dynamic audio/MIDI environment that enables you to tweak, remix, and slice up your loops and sounds with dozens of built-in modules, instruments, and effects. Transfuser offers dozens of innovative tools for creating, controlling, exploring, and experimenting with music and loops in new ways you never thought possible.
Rust For Mac
- System Requirements
- VST (32 bit and 64 bit) qualified for:
- Ableton Live, Cubase, Arsenal, VIP 2.0
- AU (64 bit only) qualified for:
- Logic Pro X
- AAX qualified for:
- ProTools 10.3 (32 bit), ProTools 11.x (64 bit) , ProTools 12.x (64 bit)
- RTAS qualified for:
- 32-bit ProTools (Loom and Vacuum Pro instruments only)
- PC: Windows 10, 8 or Windows 7 Service Pack 1; Minimum Dual Core 2GHz (Intel Core i5 or i7 Recommended)
- Mac: Mac OS X 10.8.5-10.14; Core Duo Processor (Core i5 or i7 Recommended)
- Minimum RAM 4GB (8GB or more recommended)
- 70GB free hard drive space (Download and Installation)
- Internet access (Download and Authorization)
- Notes:
- No iLok key required
- VST (32 bit and 64 bit) qualified for: