-
Notifications
You must be signed in to change notification settings - Fork 18
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
Optimization wollok game #328
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #328 +/- ##
==========================================
- Coverage 89.85% 89.80% -0.05%
==========================================
Files 28 29 +1
Lines 3212 3226 +14
Branches 584 586 +2
==========================================
+ Hits 2886 2897 +11
- Misses 171 173 +2
- Partials 155 156 +1 ☔ View full report in Codecov by Sentry. |
test/benchmarks.ts
Outdated
const deltaError = Math.max(0.1, expectedTime * 0.1) // 0.1 or 10 % | ||
restore() | ||
|
||
// console.info(`${message} - ${fqn} - ${time} ms (${iterations} iterations)`) | ||
results.push({ message, fqn, time, iterations }) | ||
time.should.be.closeTo(expectedTime, deltaError) | ||
}) | ||
} | ||
|
||
benchmark('empty', 0.55) | ||
benchmark('visuals_1', 0.4) | ||
benchmark('visuals_100', 0.3) | ||
benchmark('ticks_1', 0.8) | ||
benchmark('ticks_100', 44) | ||
benchmark('onCollide_1', 0.8) | ||
benchmark('onCollide_100', 44) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these assertions portable on different machines / browsers / JS implementations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just hope:
- to have some number more or less regular in the CI
- detect when the number changes a lot
1b55a35
to
db4e5ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Te dejo una pregunta, mañana si querés lo vemos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increibleee, Wollok vuelaa
[Run benchmarks]
^- esto hace que corran los benchmarks en el CI y ponga los resultados como comment del commit
Acá se mejora la performance de las natives críticas de Wollok Game en base a lo que había investigado @mind-ar en un PR/issue que no encontré.
La optimización que se implementa es evitar invocar los getters creados por properties en las natives de game (que, además, por querer optimizar de más tenía un bug).
Lo importante es que armé unos mini-benchmarks de game para medir esto.
De paso también abrí al puerta para poder compilar implementaciones nativas de cualquier método. Por ahora solo se hace para las properties (no solo de game, sino de todo el programa).
Quiero implementar más benchmarks del lenguaje antes de meterme con un compilador...
TODOs
Benchmarks en uqbar-project/wollok-language#236