Revision aabebcb...

Go back to digest for 31st March 2013

Optimization in KDE Base

Bernd Buschinski committed changes in [kdelibs] /:

kjs: Extend PropertySlot like JSC does, introduce new GetValueNumberFunc to
avoid doing unneeded Identifier::from(unsigned) if we already know its an unsigned.
Before we used to do something like:
store unsigned -> Identifier::from(unsigned) -> call -> Identifier.toArrayIndex to get the unsigned again -> use unsigned
store unsigned -> call -> use unsigned.
The pure Identifier/"String" case is unchanged.

Also (like JSC too) add function to directly store the Value, this avoids extra function call.
Now we no longer need to create a static GetValueFunc for getting a tiny value. (less code, more fun)

This overall improves the performance for kjs:

with SunSpider 1.0-svn, (less is better, 3*10 runs)
before: 2887.5ms, 2836.9ms, 2865.4ms
after: 2748.5ms, 2756.4ms, 2747.3ms

octane benchmark (more is better)
before score: 225
after score: 272

and most important not a single testcase got slower.

For typed-arrays, my extra bloated worstcase bubble sort testcase (less is better)
before: ~44sec
after: ~18sec


File Changes

Modified 5 files
  •   kjs/property_slot.h
  •   kjs/string_object.cpp
  •   kjs/string_object.h
  •   khtml/ecma/kjs_arraybufferview.h
  •   khtml/ecma/kjs_binding.h
5 files changed in total