Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
| import selectors | |
| import socket | |
| selector = selectors.DefaultSelector() | |
| server_socket = socket.socket() | |
| server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
| server_address = ("127.0.0.1", 1234) | |
| server_socket.setblocking(False) |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
| #![allow(non_snake_case)] | |
| #![allow(dead_code)] | |
| use std::borrow::Borrow; | |
| use std::convert::AsRef; | |
| struct Y; | |
| struct X { | |
| y: Y |
| # -*- coding: utf-8 -*- | |
| from odoo import http | |
| import aiohttp | |
| import asyncio | |
| import time | |
| import json | |
| async def get_json(client, url): |
| project ( lua C ) | |
| cmake_minimum_required ( VERSION 2.8 ) | |
| include_directories ( src ${CMAKE_CURRENT_BINARY_DIR} ) | |
| set ( SRC_CORE src/lapi.c src/lcode.c src/lctype.c src/ldebug.c src/ldo.c src/ldump.c src/lfunc.c src/lgc.c src/llex.c | |
| src/lmem.c src/lobject.c src/lopcodes.c src/lparser.c src/lstate.c src/lstring.c src/ltable.c | |
| src/ltm.c src/lundump.c src/lvm.c src/lzio.c ) | |
| set ( SRC_LIB src/lauxlib.c src/lbaselib.c src/lbitlib.c src/lcorolib.c src/ldblib.c src/liolib.c | |
| src/lmathlib.c src/loslib.c src/lstrlib.c src/ltablib.c src/lutf8lib.c src/loadlib.c src/linit.c ) |
| --log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
| type: bool default: false | |
| --expose_gc (expose gc extension) | |
| type: bool default: false | |
| --max_new_space_size (max size of the new generation (in kBytes)) | |
| type: int default: 0 | |
| --max_old_space_size (max size of the old generation (in Mbytes)) | |
| type: int default: 0 | |
| --max_executable_size (max size of executable memory (in Mbytes)) | |
| type: int default: 0 |
| // Multiplexed PWM RGB Led Demo | |
| // By Petri Hakkinen | |
| // 24th November 2014 | |
| // | |
| // Arduino Uno driving a single RGB led with only one resistor. | |
| // | |
| // Make the following connections: | |
| // * Connect Arduino pins D2,D3,D3 to anodes of a RGB led. | |
| // * Connect cathode of the RGB led to 330 ohm resistor. | |
| // * Connect the other end of the resistor to ground. |
| (module | |
| (func $addTwo (param i32 i32) (result i32) | |
| (i32.add | |
| (get_local 0) | |
| (get_local 1))) | |
| (export "addTwo" (func $addTwo))) |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/satori/go.uuid" | |
| "math/rand" | |
| "sync" | |
| "time" | |
| ) |
| #include <unistd.h> | |
| #include <node.h> | |
| #include <string.h> | |
| #include <v8.h> | |
| using namespace v8; | |
| unsigned long long count = 0; | |
| // native blocking/compute intensive function |