/dev/null

Elite is stupid. Back to the roots.

September 7, 2009

Object property ordering in Google Chrome

Tags: , , , , — 00:26

Today, I prepared for the upcoming PHP/JS conferences and had a look at the mysterious bug #883 of Google Chrome and those related to it. Also I read though SquirrelFish source, which is used by Safari 4.

The reason for the odd behavior of Chrome seems to be a if/else construct that is repeated throughout the source of runtime.cc:

// Check if the name is trivially convertible to an index and get
// the element if so.
if (name->AsArrayIndex(&index)) {
return GetElementOrCharAt(object, index);
} else {
PropertyAttributes attr;
return object->GetProperty(*name, &attr);
}

Chrome makes a difference between properties and elements. And they do weird type casts. If you check JavaScriptCore, you see there is a better way:

inline JSValue JSObject::get(ExecState* exec, const Identifier& propertyName) const
{
PropertySlot slot(this);
if (const_cast(this)->getPropertySlot(exec, propertyName, slot))
return slot.getValue(exec, propertyName);

return jsUndefined();
}

May 25, 2008

Yes, there is a memory leak…

Tags: , — 06:49

If somebody ever said, there is no memory leak in Firefox, here’s the proof:

Firefox memory leak

It can’t be, that a browser with 4 open tabs requires about 600 MB of memory. That’s 150 MB per Web site, which seems a bit too much ;)

Safari, by the way, requires 128 MB for 5 open tabs.

If you find that Firefox’s memory usage continues to grow after long periods of being open, you may want to consider periodically restarting Firefox to bring the memory usage back to reasonable levels.

http://kb.mozillazine.org/Memory_Leak

Powered by PHP, Memcached, Suhosin, MySQL and WordPress