{"action":"opened","issue":{"url":"https://api.github.com/repos/OpenGATE/Gate/issues/26","labels_url":"https://api.github.com/repos/OpenGATE/Gate/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/OpenGATE/Gate/issues/26/comments","events_url":"https://api.github.com/repos/OpenGATE/Gate/issues/26/events","html_url":"https://github.com/OpenGATE/Gate/issues/26","id":83637125,"number":26,"title":"Optimizing the code","user":{"login":"BishopWolf","id":11816952,"avatar_url":"https://avatars.githubusercontent.com/u/11816952?v=3","gravatar_id":"","url":"https://api.github.com/users/BishopWolf","html_url":"https://github.com/BishopWolf","followers_url":"https://api.github.com/users/BishopWolf/followers","following_url":"https://api.github.com/users/BishopWolf/following{/other_user}","gists_url":"https://api.github.com/users/BishopWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/BishopWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BishopWolf/subscriptions","organizations_url":"https://api.github.com/users/BishopWolf/orgs","repos_url":"https://api.github.com/users/BishopWolf/repos","events_url":"https://api.github.com/users/BishopWolf/events{/privacy}","received_events_url":"https://api.github.com/users/BishopWolf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-01T18:38:16Z","updated_at":"2015-06-01T18:38:16Z","closed_at":null,"body":"In several places in the code you use a bunch of vectors to define properties, vectors from the same size that are always used together. So an important optimization should be to create structures and the a vector of that structures to optimize creation/deletion/insertion/extraction of elements. An example is the file GateSteppingVerbose, you have\r\n\r\n-  std::vector<GateInfoForSteppingVerbose *> theListOfTrack; \r\n-\r\n-  std::vector<G4String> theListOfVolumeAtTrackLevel; \r\n-  std::vector<G4String> theListOfProcessAtTrackLevel; \r\n-  std::vector<G4String> theListOfParticleAtTrackLevel; \r\n-  std::vector<G4SliceTimer*> theListOfTimerAtTrackLevel; \r\n-  std::vector<G4int> theListOfEnergyAtTrackLevel; \r\n\r\nwhile you can have\r\n\r\n+  struct GateTrackLevel\r\n+  {\r\n+\t  G4SliceTimer* Timer;\r\n+\t  G4String Particle;\r\n+\t  G4String Process;\r\n+\t  G4String Volume;\r\n+\t  G4int Energy;\r\n+\t  G4double Time;\r\n+  };\r\n+  typedef std::vector<GateTrackLevel> GateTrackLevelVec;\r\n\r\nand finally\r\n\r\n+  GateTrackLevelVec theListOfTrack;\r\n\r\nthis is used intensively in the code, so this issue require a lot of changes"}}