Closed Bug 569172 Opened 16 years ago Closed 15 years ago

TM: don't use tinyids for function objects

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 640593

People

(Reporter: gal, Assigned: gal)

Details

Attachments

(1 file)

I think this is the last use of tinyids inside the engine (call uses shortid, which is closely related).
Attached patch patch — — Splinter Review
Assignee: general → gal
Attachment #448323 - Flags: review?(brendan)
OS: Mac OS X → All
Hardware: x86 → All
We use tinyids to share a getter, there's no abstraction leak since the fix for bug 453747 went in. Is this not a code size loss? Any runtime win? /be
host-5-104:Darwin_OPT.OBJ gal$ size js __TEXT __DATA __OBJC others dec hex 1605632 73728 0 4295131136 4296810496 1001c2000 host-5-104:Darwin_OPT.OBJ gal$ size js-with __TEXT __DATA __OBJC others dec hex 1609728 73728 0 4295131136 4296814592 1001c3000 host-5-104:Darwin_OPT.OBJ gal$ bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 1609728 - 1605632 4096 With the patch we overflow onto another page, so the overhead is 1-4095 bytes. I can't tell precisely. I doubt this code is all that perf critical but anyway: var d = Date.now(); var f = function(a) {} var q = 0; for (var i = 0; i < 10000000; ++i) q = f.arity; print(Date.now() - d); host-5-104:src gal$ ./Darwin_OPT.OBJ/js x.js 746 host-5-104:src gal$ ./Darwin_OPT.OBJ/js-with x.js 705
Even 15 years ago, when compilers truly sucked hard (some still do, sometimes), tinyid was a straight-up space-time trade-off: saved code size via shared getter or setter, slower due to redispatching via switch on tinyid. If you are gunning for tinyid in the JS API (where's that newsgroup post?!) then ok -- I'll review in a bit. (Newsgroup post first please...) /be
Yeah, clearly not after perf here. I will write the newsgroup post in a bit.
Ping me here with newsgroup post link when up? /be
Comment on attachment 448323 [details] [diff] [review] patch No newsgroup post, newsgroup full of spam, patch rotted, patch seems to make code size bigger without benefit. Clearing r?me, looking for a better systematic way forward, even if it is per-property JSPropertyOp-style getters. /be
Attachment #448323 - Flags: review?(brendan)
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: