Closed
Bug 569172
Opened 16 years ago
Closed 15 years ago
TM: don't use tinyids for function objects
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 640593
People
(Reporter: gal, Assigned: gal)
Details
Attachments
(1 file)
|
15.04 KB,
patch
|
Details | Diff | Splinter Review |
I think this is the last use of tinyids inside the engine (call uses shortid, which is closely related).
| Assignee | ||
Comment 1•16 years ago
|
||
Assignee: general → gal
| Assignee | ||
Updated•16 years ago
|
Attachment #448323 -
Flags: review?(brendan)
| Assignee | ||
Updated•16 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Comment 2•16 years ago
|
||
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
| Assignee | ||
Comment 3•16 years ago
|
||
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
Comment 4•16 years ago
|
||
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
| Assignee | ||
Comment 5•16 years ago
|
||
Yeah, clearly not after perf here. I will write the newsgroup post in a bit.
Comment 6•16 years ago
|
||
Ping me here with newsgroup post link when up?
/be
Comment 7•15 years ago
|
||
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)
Updated•15 years ago
|
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.
Description
•