Skip to content

Instantly share code, notes, and snippets.

View ghazel's full-sized avatar

Greg Hazel ghazel

  • San Francisco, CA
View GitHub Profile
0.00 975.55 1 script:/data/myapp/releases/20110419145836/3a4c461c9424f4af37f05fb252fc52f6b74c32cb [44]
[45] 75.1 0.00 974.99 1 #<Object:0x30f08>.include [45]
0.00 974.99 1 Module#include [46]
-------------------------------------------------------
0.00 974.99 1 #<Object:0x30f08>.include [45]
[46] 75.1 0.00 974.99 1 Module#include [46]
0.00 974.99 1 Array#reverse_each [47]
-------------------------------------------------------
0.00 974.99 1 Module#include [46]
[47] 75.1 0.00 974.99 1 Array#reverse_each [47]
===== Thread 0 =====
Total running time: 1298.5767560000002s
index % time self children called name
----------------------------------------------------------
[1] 99.9 0.00 1297.53 1 Rubinius::Loader#script [1]
0.00 1297.53 1 Rubinius::CodeLoader.load_script [2]
0.00 0.00 1 IO.read [142821]
-------------------------------------------------------
0.00 1297.53 1 Rubinius::Loader#script [1]
[2] 99.9 0.00 1297.53 1 Rubinius::CodeLoader.load_script [2]
-------------------------------------------------------
0.01 971.30 1 Array#each [58]
[59] 74.8 0.01 971.29 1200 Module::append_features<108> {} [59]
0.05 971.25 1200 BlankSlate.hide [60]
-------------------------------------------------------
0.01 971.29 1200 Module::append_features<108> {} [59]
[60] 74.8 0.05 971.25 1200 BlankSlate.hide [60]
0.03 970.39 1200 Module#instance_methods [61]
0.01 0.27 1200 Module#undef_method [3729]
0.07 0.11 1200 Module#instance_method [5104]
===== Thread 0 =====
Total running time: 1339.589594s
index % time self children called name
----------------------------------------------------------
[1] 99.9 0.00 1338.55 1 Rubinius::Loader#script [1]
0.00 1338.55 1 Rubinius::CodeLoader.load_script [2]
0.00 0.00 1 IO.read
-------------------------------------------------------
0.00 1338.55 1 Rubinius::Loader#script [1]
[2] 99.9 0.00 1338.55 1 Rubinius::CodeLoader.load_script [2]
% cumulative self self total
time seconds seconds calls ms/call ms/call name
------------------------------------------------------------
15.21 340.42 211.90 31027435 0.01 0.01 Hash::Entry#match?
7.48 371.10 104.25 5956641 0.02 0.06 Hash#find_entry
5.92 415.34 82.50 3879913 0.02 0.11 Hash#[]=
5.12 70.80 71.34 34370433 0.00 0.00 Rubinius::Tuple#[]
4.74 65.70 65.98 31793459 0.00 0.00 Kernel#equal?
4.60 63.71 64.12 31149801 0.00 0.00 Symbol.===
3.33 66.76 46.38 10065865 0.00 0.01 Hash#key_index
SELECT groups.name, count(distinct group_memberships.id) as count_id FROM groups INNER JOIN group_memberships ON group_memberships.group_id = groups.id LIMIT 3;
irb(main):001:0> a = [1,2,3,4,5]
=> [1, 2, 3, 4, 5]
irb(main):002:0> a[0..3-1]
=> [1, 2, 3]
irb(main):003:0> a[0,3]
=> [1, 2, 3]
@ghazel
ghazel / gist:785315
Created January 18, 2011 22:42
windows io junk to get io.cpp to compile. might be wrong, certainly not entirely right.
diff --git a/vm/builtin/io.cpp b/vm/builtin/io.cpp
index 64989ce..a5e7321 100644
--- a/vm/builtin/io.cpp
+++ b/vm/builtin/io.cpp
@@ -5,6 +5,7 @@
#include <fcntl.h>
#ifdef RBX_WINDOWS
#include <winsock2.h>
+#include <ws2tcpip.h>
#else
@_o
def read_map_chunk(self):
x = yield self.read_int()
y = yield self.read_short()
z = yield self.read_int()
size_x = yield self.read_byte()
size_y = yield self.read_byte()
size_z = yield self.read_byte()
compressed_chunk_size = yield self.read_int()
compressed_chunk = yield self.client.read(compressed_chunk_size)
S:\>ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
S:\>ruby script\runner
** Erubis 2.6.6
** Erubis 2.6.6
SQL (0.0ms) SET NAMES 'utf8'
SQL (0.0ms) SET SQL_AUTO_IS_NULL=0
User Columns (1.0ms) SHOW FIELDS FROM `users`
Friendship Columns (1.0ms) SHOW FIELDS FROM `friendships`