flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Mclean (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-35330) [FlexJS] comparison of objects using non strict inequality or non strict equality is slow
Date Sat, 24 Jun 2017 09:30:00 GMT

    [ https://issues.apache.org/jira/browse/FLEX-35330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061879#comment-16061879
] 

Justin Mclean commented on FLEX-35330:
--------------------------------------

Looks like on windows there's about a 50% performance increase on Chrome. Interesting that
Edge and Firefox don't see gains but that's browsers for you.

> [FlexJS] comparison of objects using non strict inequality or non strict equality is
slow
> -----------------------------------------------------------------------------------------
>
>                 Key: FLEX-35330
>                 URL: https://issues.apache.org/jira/browse/FLEX-35330
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Apache FlexJS 0.7.0
>            Reporter: Justin Mclean
>
> Code use to test:
> {code}
> <?xml version="1.0" encoding="utf-8"?>
> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                 xmlns:js="library://ns.apache.org/flexjs/basic" applicationComplete="init()">
>     <js:valuesImpl>
>         <js:SimpleCSSValuesImpl/>
>     </js:valuesImpl>
>     <fx:Script><![CDATA[
>             protected function init():void
>             {
>                 var start:Date;
>                 var end:Date;
>                 var took:Number;
>                 var obj1:Object;
>                 var obj2:Object;
>                 var obj3:Object = null;
>                 var obj4:Object = null;
>                 var i:int;
>                 var j:int;
>                 j = 0;
>                 start = new Date();
>                 for (i = 0; i < 1e7; i++) {
>                     if (obj1 != null) {
>                         j++;
>                     }
>                 }
>                 end = new Date();
>                 took = end.getTime() - start.getTime();
>                 trace("Uninitialised != : " + took);
>                 j = 0;
>                 start = new Date();
>                 for (i = 0; i < 1e7; i++) {
>                     if (obj2 !== null) {
>                         j++;
>                     }
>                 }
>                 end = new Date();
>                 took = end.getTime() - start.getTime();
>                 trace("Uninitialised !== : " + took);
>                 j = 0;
>                 start = new Date();
>                 for (i = 0; i < 1e7; i++) {
>                     if (obj3 != null) {
>                         j++;
>                     }
>                 }
>                 end = new Date();
>                 took = end.getTime() - start.getTime();
>                 trace("Null initialised != : " + took);
>                 j = 0;
>                 start = new Date();
>                 for (i = 0; i < 1e7; i++) {
>                     if (obj4 !== undefined) {
>                         j++;
>                     }
>                 }
>                 end = new Date();
>                 took = end.getTime() - start.getTime();
>                 trace("Null initialised !== : " + took);
>             }
>         ]]></fx:Script>
>     <js:initialView>
>         <js:View percentWidth="100" percentHeight="100">
>             <js:Label id="result" />
>         </js:View>
>     </js:initialView>
> </js:Application>
> {code}
> Output of 5 consecutive tests:
> Uninitialised != : 18
> Uninitialised !== : 18
> Null initialised != : 16
> Null initialised !== : 13
> Uninitialised != : 20
> Uninitialised !== : 18
> Null initialised != : 17
> Null initialised !== : 14
> Uninitialised != : 18
> Uninitialised !== : 19
> Null initialised != : 16
> Null initialised !== : 14
> Uninitialised != : 18
> Uninitialised !== : 18
> Null initialised != : 16
> Null initialised !== : 14
> Uninitialised != : 19
> Uninitialised !== : 18
> Null initialised != : 17
> Null initialised !== : 14
> Smaller numbers are faster. Run on Chrome 55 on OSX.
> You can see about a 35% performance increase.
> Note there is also a small performance increase in use non strict inequality and assigning
to null.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message