Post Reply 
HHC 2014 Programming Contest
09-29-2014, 11:35 AM
Post: #25
RE: HHC 2014 Programming Contest
(09-29-2014 11:13 AM)Neil Hamilton Wrote:  I am also wondering why the performance dropped to ~1.25 s/yr when run against a set with an ~8400 year span. The only thing I can think of is that since I push my answers to the stack and with 1000-odd entries on the stack, that might be slowing it down.
The large date span probably means that the calculator would do garbage collection at least one, and the items on the large number of items on the stack would make it slow. On the other hand, putting the items in a list would probably be even worse. When you add to a list, it actually creates a new list and copies the old and new items into it. Adding the 877th item copies 866 items, and the new one. So that would probably be even slower. Try dropping the items into a pre-sized array.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HHC 2014 Programming Contest - Paul Dale - 09-24-2014, 09:13 AM
RE: HHC 2014 Programming Contest - BruceH - 10-02-2014, 09:35 PM
RE: HHC 2014 Programming Contest - David Hayden - 09-29-2014 11:35 AM
RE: HHC 2014 Programming Contest - Jeff O. - 09-29-2014, 01:41 PM
RE: HHC 2014 Programming Contest - Jeff O. - 09-30-2014, 04:39 PM
RE: HHC 2014 Programming Contest - Jeff O. - 10-06-2014, 05:01 PM
RE: HHC 2014 Programming Contest - Jeff O. - 10-07-2014, 12:26 PM
RE: HHC 2014 Programming Contest - Werner - 10-03-2014, 07:35 AM
RE: HHC 2014 Programming Contest - C.Ret - 10-05-2014, 10:02 AM
RE: HHC 2014 Programming Contest - Werner - 10-05-2014, 08:02 PM



User(s) browsing this thread: 1 Guest(s)