Project

General

Profile

Feature #10302

[PATCH] marshal.c: lazy compat_tbl allocation

Added by normalperson (Eric Wong) over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:65305]

Description

Will commit in a few days.

In some common cases, compat_tbl is unused in dump_arg/load_arg,
so avoid malloc/free costs for the unused table.

ruby -e 'h = {a: :b}; 600000.times { Marshal.load(Marshal.dump(h)) }'

before:
    real    0m2.458s
    user    0m2.450s
    sys     0m0.006s

after:
    real    0m2.122s
    user    0m2.110s
    sys     0m0.011s

Files

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

  • Description updated (diff)

Seems fine.

#2

Updated by hsbt (Hiroshi SHIBATA) over 5 years ago

  • Status changed from Open to Assigned

Updated by normalperson (Eric Wong) over 5 years ago

  • Status changed from Assigned to Closed

r47756

Also available in: Atom PDF