One of the great things about Go is that you can easily profile your code to find and optimize bottlenecks. Here are the steps that I went through to profile my Go apps.
// Inside test file
" | |
" Darin's configuration file for vim/neovim | |
" | |
" My relatively minimal vimrc/init.vim file | |
" Most plugins are mostly simple and don't use too much vim magic | |
" | |
" I have lots of custom setups for different languagues like Clojure, Rust, | |
" and Go, so if you do not use these languages, you might be better off with | |
" a simpler vimrc. | |
" |
/env/ | |
/tmp/ | |
/vendor/ | |
/node_modules/ | |
/bin/ | |
*.exe | |
*.pyc | |
*.so | |
*.swp |
# Compiled source # | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # | |
*.7z |
(* A simple test harness for the MOCaml interpreter. *) | |
(* put your tests here: | |
each test is a pair of a MOCaml declaration and the expected | |
result, both expressed as strings. | |
use the string "dynamic type error" if a DynamicTypeError is expected to be raised. | |
use the string "match failure" if a MatchFailure is expected to be raised. | |
use the string "implement me" if an ImplementMe exception is expected to be raised | |
call the function runtests() to run these tests |
" Vim color file | |
" | |
" Author: Anthony Carapetis <[email protected]> | |
" | |
" Note: Based on github's syntax highlighting theme | |
" Used Brian Mock's darkspectrum as a starting point/template | |
" Thanks to Ryan Heath for an easy list of some of the colours: | |
" http://rpheath.com/posts/356-github-theme-for-syntax-gem | |
hi clear |
(when (>= emacs-major-version 24) | |
(require 'package) | |
(package-initialize) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) | |
) | |
; Packages installed: | |
; evil | |
; ensime | |
; linum-relative |
--- | |
# Conditions: | |
# 'enemy_pokemon': gets the current enemy pokemon | |
# 'your_pokemon': gets your current pokemon | |
# 'self': gets the move | |
# you can call properties on these ones | |
# enemy_pokemon[stats[hp]] gets the enemy_pokemon stat's hp | |
# | |
# Statements: |
There are three main concepts with Rust:
These are fairly simple concepts, but they are often counter-intuitive to concepts in other languages, so I wanted to give a shot at