This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/eval.c b/eval.c | |
| index 057afd9..aa50cb5 100644 | |
| --- a/eval.c | |
| +++ b/eval.c | |
| @@ -371,69 +371,10 @@ struct cache_entry { /* method hash table. */ | |
| static struct cache_entry cache[CACHE_SIZE]; | |
| static int ruby_running = 0; | |
| -void | |
| -rb_clear_cache() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| methodmissing:rubyenterpriseedition187-248 lourens$ ./ruby -Ilib obj_hash_bench.rb | |
| Rehearsal --------------------------------------------------- | |
| Hash#[:array] 0.030000 0.000000 0.030000 ( 0.030316) | |
| Hash#[:bignum] 0.030000 0.000000 0.030000 ( 0.027775) | |
| Hash#[:hash] 0.030000 0.000000 0.030000 ( 0.030893) | |
| Hash#[:numeric] 0.030000 0.000000 0.030000 ( 0.030195) | |
| Hash#[:range] 0.030000 0.000000 0.030000 ( 0.029430) | |
| Hash#[:time] 0.030000 0.000000 0.030000 ( 0.029966) | |
| Hash#[:rexp] 0.030000 0.000000 0.030000 ( 0.029690) | |
| Hash#[:string] 0.030000 0.000000 0.030000 ( 0.032869) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| methodmissing:rubyenterpriseedition187-248 lourens$ ./ruby -Ilib obj_hash_bench.rb | |
| Rehearsal --------------------------------------------------- | |
| Hash#[:array] 0.030000 0.000000 0.030000 ( 0.032720) | |
| Hash#[:bignum] 0.030000 0.000000 0.030000 ( 0.028503) | |
| Hash#[:hash] 0.030000 0.000000 0.030000 ( 0.031888) | |
| Hash#[:numeric] 0.030000 0.000000 0.030000 ( 0.032113) | |
| Hash#[:range] 0.030000 0.000000 0.030000 ( 0.031008) | |
| Hash#[:time] 0.030000 0.000000 0.030000 ( 0.030119) | |
| Hash#[:rexp] 0.030000 0.000000 0.030000 ( 0.030865) | |
| Hash#[:string] 0.040000 0.000000 0.040000 ( 0.033808) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GC.enable_stats | |
| class S | |
| def initialize(a) | |
| @a = a | |
| end | |
| end | |
| ITER = 5 | |
| Benchmark.bmbm do |results| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void * | |
| alloc_ruby_heap_with_file(size_t size) | |
| { | |
| FileHeapAllocatorMetaData meta; | |
| meta.fd = open("/dev/zero", O_RDONLY); | |
| meta.size = size; | |
| if (meta.fd == -1) { | |
| return NULL; | |
| } else { | |
| void *memory = mmap(NULL, size + sizeof(meta), PROT_READ | PROT_WRITE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| methodmissing:google-perftools-1.5 lourens$ make | |
| /bin/sh ./libtool --tag=CXX --mode=link g++ -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -g -O2 -no-undefined -o libtcmalloc_minimal.la -rpath /opt/local/lib -D_THREAD_SAFE libtcmalloc_minimal_la-tcmalloc.lo libtcmalloc_minimal_internal.la | |
| rm -fr .libs/libtcmalloc_minimal.lax | |
| rm -fr .libs/libtcmalloc_minimal.lax | |
| mkdir .libs/libtcmalloc_minimal.lax | |
| rm -fr .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a | |
| mkdir .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a | |
| Extracting /Users/lourens/installs/google-perftools-1.5/./.libs/libtcmalloc_minimal_internal.a | |
| (cd .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a && ar x /Users/lourens/installs/google-perftools-1.5/./.libs/libtcmalloc_minimal_internal.a) | |
| g++ -dynamiclib -o .libs/libtcmalloc_minimal.0.0.0.dylib .libs/libtcmalloc_minimal_la-tcmalloc.o .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a/atomicops-internals-x86.o .libs/libtcmalloc_minima |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| methodmissing:google-perftools-1.5 lourens$ make | |
| /bin/sh ./libtool --tag=CXX --mode=link g++ -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -g -O2 -no-undefined -o libtcmalloc_minimal.la -rpath /opt/local/lib -D_THREAD_SAFE libtcmalloc_minimal_la-tcmalloc.lo libtcmalloc_minimal_internal.la | |
| rm -fr .libs/libtcmalloc_minimal.lax | |
| rm -fr .libs/libtcmalloc_minimal.lax | |
| mkdir .libs/libtcmalloc_minimal.lax | |
| rm -fr .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a | |
| mkdir .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a | |
| Extracting /Users/lourens/installs/google-perftools-1.5/./.libs/libtcmalloc_minimal_internal.a | |
| (cd .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a && ar x /Users/lourens/installs/google-perftools-1.5/./.libs/libtcmalloc_minimal_internal.a) | |
| g++ -dynamiclib -o .libs/libtcmalloc_minimal.0.0.0.dylib .libs/libtcmalloc_minimal_la-tcmalloc.o .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a/atomicops-internals-x86.o .libs/libtcmalloc_minima |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void | |
| mark_locations_array(x, n) | |
| VALUE *x; | |
| size_t n; | |
| { | |
| VALUE v; | |
| while (n--) { | |
| v = *x; | |
| if (is_pointer_to_heap((void *)v)) { | |
| gc_mark(v); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case NODE_SCOPE: /* 2,3 */ | |
| case NODE_BLOCK_PASS: | |
| case NODE_CDECL: | |
| gc_mark((VALUE)obj->as.node.u3.node); | |
| ptr = (VALUE)obj->as.node.u2.node; | |
| goto again; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static inline int | |
| is_pointer_to_heap(ptr) | |
| void *ptr; | |
| { | |
| RVALUE *p = RANY(ptr); | |
| struct heaps_slot *heap; | |
| if (p < lomem || p > himem || (VALUE)p % sizeof(RVALUE)) return Qfalse; | |
| /* check if p looks like a pointer */ |