Skip to content

Instantly share code, notes, and snippets.

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

Evgeniy Vansevich realdecisions

🏠
Working from home
View GitHub Profile
@jkeroes
jkeroes / perl-memory-modules
Created September 21, 2012 20:28
Perl memory leaks resources
Tracking memory leaks:
Devel::Arena - sv_stats() returns arena structures used for SV allocation
* Devel::Cycle - find_cycle($ref) returns all cycles found in $ref and the perl variables they point to
Devel::Gladiator - walk Perl variable arena
Devel::Leak - deprecated by Devel::LeakTrace::Fast
Devel::LeakTrace - deprecated by Devel::LeakTrace::Fast
* Devel::LeakTrace::Fast - prints leaked SV's and line numbers at END.
Data::Structure::Util - has_circular_ref($ref) returns ref to link in $ref that is circular or false.
Test::LeakTrace - no_leaks_ok(), etc.
@realdecisions
realdecisions / gist:87b1e77a3a4f85bf5cc5
Created September 25, 2015 15:51
Perl uniq array
#!perl
use Benchmark qw/cmpthese/;
use strict;
my @array = ( 'a', 'a', 'a', 'b', 'c', 'd', 'e', 'g', 'e', 'e', 'g', 'c' );
sub uniq_v1 {
my %tmp;
my @new_array = grep {