Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve naive reference counting performance
Profiling the attached mx_utils_SHA256 test shows that considerable amount of execution time is spent in acquireObject/abandonObject. This commit converts referencedObjects to an intrusive linked list. Benefits: O(1) insertion and deletion, and avoiding memory allocations. A lot of time is still being spent on locking.
- Loading branch information
Showing
5 changed files
with
89 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<mx:Application name="lightspark_utils_SHA256_test" | ||
xmlns:mx="http://www.adobe.com/2006/mxml" | ||
layout="absolute" | ||
applicationComplete="appComplete();" | ||
backgroundColor="white"> | ||
|
||
<mx:Script> | ||
<![CDATA[ | ||
import flash.system.fscommand; | ||
import mx.utils.SHA256; | ||
import flash.utils.ByteArray; | ||
private function appComplete():void | ||
{ | ||
var ba:ByteArray = new ByteArray(); | ||
for (var i:int=0; i<10000; i++) { | ||
ba.writeUTFBytes("1234567890"); | ||
} | ||
SHA256.computeDigest(ba); | ||
fscommand("quit"); | ||
} | ||
]]> | ||
</mx:Script> | ||
|
||
<mx:UIComponent id="visual" /> | ||
|
||
</mx:Application> |
2a0d8cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I have currently an half-baked solution that makes it not necessary to keep track of all the objects manually by integrating with a slightly custom version of jemalloc. I'll try to commit both the modified jemalloc and the relevant code in the next few days