Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #143 #145

Merged
merged 3 commits into from
Apr 3, 2024
Merged

Fix #143 #145

merged 3 commits into from
Apr 3, 2024

Conversation

mind-ar
Copy link
Contributor

@mind-ar mind-ar commented Mar 29, 2024

Este PR es para probar alternativas para mejorar la performance de wollok game

@mind-ar mind-ar marked this pull request as draft March 29, 2024 17:51
Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.33%. Comparing base (f6cf36c) to head (7dfd747).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
- Coverage   84.35%   84.33%   -0.03%     
==========================================
  Files           9        9              
  Lines         684      683       -1     
  Branches      162      162              
==========================================
- Hits          577      576       -1     
  Misses        107      107              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mind-ar
Copy link
Contributor Author

mind-ar commented Mar 29, 2024

Hola, con este PR me puse a buscar donde se perdía mas tiempo
Esta función tomaba bastante tiempo (unos 120ms en una prueba con 250 visuales maso)

export const getVisuals = (game: RuntimeObject, interpreter: Interpreter): VisualState[] =>

Mirando mas a fondo, noté que acá se demoraba mucho, el tema es que no termino de entender que es ese round

const roundedPosition = interpreter.send('round', position)!

Eliminando esa línea el tiempo baja de 120ms a unos 20ms. Tendría que saber cual es la función de ese round para ver si se puede implementar directamente en ts

@mind-ar mind-ar requested a review from PalumboN March 29, 2024 18:00
Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alto laburo Manuel!!

Ahí te dejé un comentario, similar al del PR de TS.
Habría que ver cómo te dan los tiempos si hacemos el redondeo en TS en vez de en Wollok. Pero los número que tenés ahora da menos porque perdimos un feature.

Por otro lado, cómo hiciste para profilear y encontrar la línea que tarda? Es interesante

src/commands/extrasGame.ts Outdated Show resolved Hide resolved
@mind-ar mind-ar marked this pull request as ready for review March 31, 2024 21:46
@mind-ar mind-ar requested a review from PalumboN March 31, 2024 21:47
Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

También en algún momento habría que:

  • Testear todas estas funciones de este archivo
  • Ver si conviene moverlas a TS

@PalumboN PalumboN merged commit a2a5a0e into uqbar-project:master Apr 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants