Skip to content

Instantly share code, notes, and snippets.

View hoangpq's full-sized avatar
🏠
Working from home

Hoang Phan hoangpq

🏠
Working from home
View GitHub Profile
@hoangpq
hoangpq / borrow_vs_as_ref.rs
Created May 10, 2020 14:20 — forked from koute/borrow_vs_as_ref.rs
Rust: Borrow vs AsRef
#![allow(non_snake_case)]
#![allow(dead_code)]
use std::borrow::Borrow;
use std::convert::AsRef;
struct Y;
struct X {
y: Y
@hoangpq
hoangpq / Profile Rust on Linux.md
Created June 11, 2020 16:21 — forked from KodrAus/Profile Rust on Linux.md
Profiling Rust Applications

Profiling performance

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 -g option.

[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@hoangpq
hoangpq / big-o.md
Created November 18, 2021 14:37 — forked from PJUllrich/big-o.md
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for < 32 elements, O(log n) for >= 32 elements [2]
Deletion O(n) for < 32 elements, O(log n) for >= 32 elements