{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/6a1abc11b3d1e432758d39dfd7c69a20?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6a1abc11b3d1e432758d39dfd7c69a20","url":"https://api.github.com/users/mpictor","login":"mpictor","id":671579},"milestone":null,"updated_at":"2011-11-06T00:13:24Z","labels":[],"assignee":null,"comments":19,"closed_at":null,"url":"https://api.github.com/repos/mpictor/StepClassLibrary/issues/91","body":"fedex_plus spends 64.75% of its time on the function [`generate_attribute_name()`](https://github.com/mpictor/StepClassLibrary/blob/master/src/fedex_plus/classes.c#L406) itself, and an additional 31% on `tolower()`, which is mostly called from `generate_attribute_name()`.\r\n\r\nIt spends a total of 96.58% of its time on `generate_attribute_name()` or on functions called from there.\r\n\r\nsource: `valgrind --tool=callgrind ../bin/fedex_plus ../../data/ap239/ap239_arm_lf.exp`","html_url":"https://github.com/mpictor/StepClassLibrary/issues/91","number":91,"title":"fedex_plus bottleneck - generate_attribute_name()","id":2151493,"created_at":"2011-11-05T11:07:05Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/6a1abc11b3d1e432758d39dfd7c69a20?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6a1abc11b3d1e432758d39dfd7c69a20","url":"https://api.github.com/users/mpictor","login":"mpictor","id":671579},"updated_at":"2011-11-06T00:13:24Z","url":"https://api.github.com/repos/mpictor/StepClassLibrary/issues/comments/2643197","body":"@tpaviot - I created another branch, `review/fedex-optimization`. It includes a commit with your version of `generate_attribute_name()`, as well as the change to `utype_member()` that I mention in the above comment.\r\n\r\n----\r\n> We should implement a kind of buffer that retrieves attribute names that has already been built\r\n\r\nAs fast as fedex_plus is now, I'm not sure that this is necessary. \r\n\r\nHowever, what I was thinking about doing is adding `char * attr_name` to `Variable_`. Care would have to be taken to ensure that `attr_name` was always initialized to zero, but then `generate_attribute_name()` could use it to store the name once generated. The function would do nothing more than return that pointer, unless it was null.\r\n","id":2643197,"created_at":"2011-11-06T00:13:24Z"}}