{"action":"created","issue":{"url":"https://api.github.com/repos/dadhi/FastExpressionCompiler/issues/52","repository_url":"https://api.github.com/repos/dadhi/FastExpressionCompiler","labels_url":"https://api.github.com/repos/dadhi/FastExpressionCompiler/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/dadhi/FastExpressionCompiler/issues/52/comments","events_url":"https://api.github.com/repos/dadhi/FastExpressionCompiler/issues/52/events","html_url":"https://github.com/dadhi/FastExpressionCompiler/issues/52","id":295903613,"node_id":"MDU6SXNzdWUyOTU5MDM2MTM=","number":52,"title":"Execution slow-down, or incorrect use?","user":{"login":"KristianWedberg","id":11193804,"node_id":"MDQ6VXNlcjExMTkzODA0","avatar_url":"https://avatars2.githubusercontent.com/u/11193804?v=4","gravatar_id":"","url":"https://api.github.com/users/KristianWedberg","html_url":"https://github.com/KristianWedberg","followers_url":"https://api.github.com/users/KristianWedberg/followers","following_url":"https://api.github.com/users/KristianWedberg/following{/other_user}","gists_url":"https://api.github.com/users/KristianWedberg/gists{/gist_id}","starred_url":"https://api.github.com/users/KristianWedberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristianWedberg/subscriptions","organizations_url":"https://api.github.com/users/KristianWedberg/orgs","repos_url":"https://api.github.com/users/KristianWedberg/repos","events_url":"https://api.github.com/users/KristianWedberg/events{/privacy}","received_events_url":"https://api.github.com/users/KristianWedberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-02-09T15:14:55Z","updated_at":"2018-11-07T13:00:05Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nIn the compiled delegates below (adding two ints), using FastExpressionCompiler the _execution_ time is consistently 16% and 65% slower than using standard BCL expressions. Any idea why, or am I using it incorrectly?\r\n\r\nThanks,\r\nKristian\r\n\r\nETSumBCL: 164 ms\r\nETSumCompileFastInfo: 191 ms (+16%)\r\nETSumCompileFast: 271 ms (+65%)\r\n\r\n```C#\r\n// using Fast = FastExpressionCompiler;\r\n// using FastPEI = FastExpressionCompiler.ParameterExpressionInfo;\r\n\r\n            Time(\"Expression\", ETSum());\r\n            Time(\"Expression Compile Fast Info\", ETSumCompileFastInfo());\r\n            Time(\"Expression Compile Fast\", ETSumCompileFast());\r\n\r\n             Func<int, int, int> ETSum()\r\n            {\r\n                var aExp = Expression.Parameter(typeof(int), \"a\");\r\n                var bExp = Expression.Parameter(typeof(int), \"b\");\r\n\r\n                return Expression.Lambda<Func<int, int, int>>(\r\n                    Expression.Add(aExp, bExp), aExp, bExp).Compile();\r\n            }\r\n\r\n            Func<int, int, int> ETSumCompileFastInfo()\r\n            {\r\n                var aExp = FastPEI.Parameter(typeof(int), \"a\");\r\n                var bExp = FastPEI.Parameter(typeof(int), \"b\");\r\n\r\n                return Fast.ExpressionCompiler.CompileFast<Func<int, int, int>>(\r\n                    FastPEI.Lambda(Expression.Add(aExp, bExp), aExp, bExp)\r\n                    );\r\n            }\r\n\r\n            Func<int, int, int> ETSumCompileFast()\r\n            {\r\n                var aExp = Expression.Parameter(typeof(int), \"a\");\r\n                var bExp = Expression.Parameter(typeof(int), \"b\");\r\n\r\n                return Fast.ExpressionCompiler.CompileFast<Func<int, int, int>>(\r\n                    Expression.Lambda(Expression.Add(aExp, bExp), aExp, bExp)\r\n                    );\r\n            }\r\n\r\n        private static void Time(String name, Func<Int32, Int32, Int32> fn)\r\n        {\r\n            int result = 0;\r\n            Stopwatch sw = new Stopwatch();\r\n            sw.Start();\r\n            for (Int32 index = 0; index <= 100000000; index++)\r\n            {\r\n                result += fn(index, 1);\r\n            }\r\n            sw.Stop();\r\n            Console.WriteLine($\"{name}: {sw.ElapsedMilliseconds} ms{result.ToString().Substring(0, 0)}\");\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/dadhi/FastExpressionCompiler/issues/comments/436614986","html_url":"https://github.com/dadhi/FastExpressionCompiler/issues/52#issuecomment-436614986","issue_url":"https://api.github.com/repos/dadhi/FastExpressionCompiler/issues/52","id":436614986,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjYxNDk4Ng==","user":{"login":"dzmitry-lahoda","id":757125,"node_id":"MDQ6VXNlcjc1NzEyNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/757125?v=4","gravatar_id":"","url":"https://api.github.com/users/dzmitry-lahoda","html_url":"https://github.com/dzmitry-lahoda","followers_url":"https://api.github.com/users/dzmitry-lahoda/followers","following_url":"https://api.github.com/users/dzmitry-lahoda/following{/other_user}","gists_url":"https://api.github.com/users/dzmitry-lahoda/gists{/gist_id}","starred_url":"https://api.github.com/users/dzmitry-lahoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzmitry-lahoda/subscriptions","organizations_url":"https://api.github.com/users/dzmitry-lahoda/orgs","repos_url":"https://api.github.com/users/dzmitry-lahoda/repos","events_url":"https://api.github.com/users/dzmitry-lahoda/events{/privacy}","received_events_url":"https://api.github.com/users/dzmitry-lahoda/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T13:00:05Z","updated_at":"2018-11-07T13:00:05Z","author_association":"CONTRIBUTOR","body":"Is it still an issues I may look at?"}}
{"actor":{"display_login":"dzmitry-lahoda"}}