{"action":"created","issue":{"url":"https://api.github.com/repos/shopspring/decimal/issues/81","repository_url":"https://api.github.com/repos/shopspring/decimal","labels_url":"https://api.github.com/repos/shopspring/decimal/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/shopspring/decimal/issues/81/comments","events_url":"https://api.github.com/repos/shopspring/decimal/issues/81/events","html_url":"https://github.com/shopspring/decimal/issues/81","id":291971184,"node_id":"MDU6SXNzdWUyOTE5NzExODQ=","number":81,"title":"Performance issue preventing production use","user":{"login":"technicalviking","id":1546690,"node_id":"MDQ6VXNlcjE1NDY2OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1546690?v=4","gravatar_id":"","url":"https://api.github.com/users/technicalviking","html_url":"https://github.com/technicalviking","followers_url":"https://api.github.com/users/technicalviking/followers","following_url":"https://api.github.com/users/technicalviking/following{/other_user}","gists_url":"https://api.github.com/users/technicalviking/gists{/gist_id}","starred_url":"https://api.github.com/users/technicalviking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicalviking/subscriptions","organizations_url":"https://api.github.com/users/technicalviking/orgs","repos_url":"https://api.github.com/users/technicalviking/repos","events_url":"https://api.github.com/users/technicalviking/events{/privacy}","received_events_url":"https://api.github.com/users/technicalviking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-01-26T17:17:03Z","updated_at":"2018-11-27T23:09:27Z","closed_at":null,"author_association":"NONE","body":"I'm currently working on an application that would benefit greatly from this lib, due to requirements with floating point precision.  However benchmark tests of that application are worrying.\r\n\r\nThe scenario involves creating Decimal values, and then calling the various comparison methods on them.   This sequence of events happens millions of times.   Immediately after converting my code to use Decimal (instead of big.float, which was showing unacceptable precision loss after 20 significant digits), the performance time of our benchmark test went from 3-4 minutes for the test, to 22, on the same processor.  pprof helped narrow the problem to the fact that your implementation of CMP involves the creation of an additional 2 decimal objects whenever the 'exp' values were different (which was pretty much every time), which is in line with the fact that after the change, 60% of the cpu time was spent allocating memory.\r\n\r\nIs there a particular reason this approach was taken?   Would a PR attempting to optimize this be accepted?"},"comment":{"url":"https://api.github.com/repos/shopspring/decimal/issues/comments/442253617","html_url":"https://github.com/shopspring/decimal/issues/81#issuecomment-442253617","issue_url":"https://api.github.com/repos/shopspring/decimal/issues/81","id":442253617,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjI1MzYxNw==","user":{"login":"robaho","id":4958833,"node_id":"MDQ6VXNlcjQ5NTg4MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/4958833?v=4","gravatar_id":"","url":"https://api.github.com/users/robaho","html_url":"https://github.com/robaho","followers_url":"https://api.github.com/users/robaho/followers","following_url":"https://api.github.com/users/robaho/following{/other_user}","gists_url":"https://api.github.com/users/robaho/gists{/gist_id}","starred_url":"https://api.github.com/users/robaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robaho/subscriptions","organizations_url":"https://api.github.com/users/robaho/orgs","repos_url":"https://api.github.com/users/robaho/repos","events_url":"https://api.github.com/users/robaho/events{/privacy}","received_events_url":"https://api.github.com/users/robaho/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T23:09:27Z","updated_at":"2018-11-27T23:09:27Z","author_association":"NONE","body":"There are similar problems with the Add, and other computation methods... There is no reason to rescale the decimal if both operands already have the same scale - that is the core problem with the implementation."}}
{"actor":{"display_login":"robaho"}}