{"action":"created","issue":{"url":"https://api.github.com/repos/geneura-papers/2015-ea-languages/issues/16","labels_url":"https://api.github.com/repos/geneura-papers/2015-ea-languages/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/geneura-papers/2015-ea-languages/issues/16/comments","events_url":"https://api.github.com/repos/geneura-papers/2015-ea-languages/issues/16/events","html_url":"https://github.com/geneura-papers/2015-ea-languages/issues/16","id":119575947,"number":16,"title":"Estructuras mutables/no persistentes vs inmutables/persistentes","user":{"login":"ppgllrd","id":4742844,"avatar_url":"https://avatars.githubusercontent.com/u/4742844?v=3","gravatar_id":"","url":"https://api.github.com/users/ppgllrd","html_url":"https://github.com/ppgllrd","followers_url":"https://api.github.com/users/ppgllrd/followers","following_url":"https://api.github.com/users/ppgllrd/following{/other_user}","gists_url":"https://api.github.com/users/ppgllrd/gists{/gist_id}","starred_url":"https://api.github.com/users/ppgllrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppgllrd/subscriptions","organizations_url":"https://api.github.com/users/ppgllrd/orgs","repos_url":"https://api.github.com/users/ppgllrd/repos","events_url":"https://api.github.com/users/ppgllrd/events{/privacy}","received_events_url":"https://api.github.com/users/ppgllrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-30T20:37:33Z","updated_at":"2015-12-01T06:11:36Z","closed_at":null,"body":"Le comentaba a JJ que las versiones del algoritmo que tenéis en C y Java usan como representación estructuras de datos mutables, por lo que al hacer la mutación, la versión previa del individuo ya no está disponible. \r\nEn Scala, tanto Vector como String son persistentes, por lo que se conserva el individuo antiguo tras mutarlo. Esto es lo habitual en lenguajes funcionales y puede ser adecuado si interesase mantener al individuo antiguo en la población. En C/Java habría que clonarlo antes de mutarlo, lo que tendría un coste temporal extra que habría que tener en cuenta, y por ello las comparaciones no son muy justas.\r\nEn Scala también se pueden usar estructuras no persistentes (como los Arrays), y en ese caso, el rendimiento debe ser semejante al de los arrays en C/Java. En mi máquina, los arrays de Scala son prácticamente igual de rápidos que los BitSets de Java que habéis utilizado y 11 veces más rápidos que los vectores persistentes.\r\nHe puesto los códigos y resultados obtenidos aquí:\r\nhttps://github.com/ppgllrd/research-2015-ea-languages\r\nPor último, creo que es conveniente repetir el experimento varias veces y sacar un promedio de tiempos (que es lo que yo he hecho), ya que los tiempos que obtengo son variables. Supongo que cosas como el recolector de basura alteran los resultados, sobre todo en las pruebas que llevan poco tiempo."},"comment":{"url":"https://api.github.com/repos/geneura-papers/2015-ea-languages/issues/comments/160866683","html_url":"https://github.com/geneura-papers/2015-ea-languages/issues/16#issuecomment-160866683","issue_url":"https://api.github.com/repos/geneura-papers/2015-ea-languages/issues/16","id":160866683,"user":{"login":"JJ","id":500,"avatar_url":"https://avatars.githubusercontent.com/u/500?v=3","gravatar_id":"","url":"https://api.github.com/users/JJ","html_url":"https://github.com/JJ","followers_url":"https://api.github.com/users/JJ/followers","following_url":"https://api.github.com/users/JJ/following{/other_user}","gists_url":"https://api.github.com/users/JJ/gists{/gist_id}","starred_url":"https://api.github.com/users/JJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JJ/subscriptions","organizations_url":"https://api.github.com/users/JJ/orgs","repos_url":"https://api.github.com/users/JJ/repos","events_url":"https://api.github.com/users/JJ/events{/privacy}","received_events_url":"https://api.github.com/users/JJ/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T06:11:36Z","updated_at":"2015-12-01T06:11:36Z","body":"Gracias, Pepe.\n"}}