-
Notifications
You must be signed in to change notification settings - Fork 14
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
Problems with grunt generate-development-strings
#1369
Comments
@pixelzoom said above:
@samreid then said:
@samreid did most of the work on this under #1308. I recall making the same argument at the time that @pixelzoom is making, i.e. that having redundant sources of information is likely going to cause problems. And it is. So I'm going to hit this one back into @samreid's court for further consideration. I proposed the alternative of having a list of supported locales for each sim and loading just those files so that we don't run into timeouts in #1308 (comment). Perhaps we should reconsider that approach. |
To investigate this issue, I ran performance testing comparing loading the non-conglomerate strings vs the conglomerate strings. To load the non-conglomerate strings (from each ground-truth file in babel), I first enumerated the locales CCK is translated into. Then I turned them into a query string like http://localhost/main/circuit-construction-kit-dc/circuit-construction-kit-dc_en.html?brand=phet&ea&debugger&locales=en,am,ar,ar_MA,az,be,bn,bs,ca,cs,cy,da,de,el,es,es_MX,es_PE,et,eu,fa,fi,fo,fr,gu,ha,hi,hr,ht,hu,hy,ig,in,is,it,iw,ja,ka,kk,kn,ko,ku,ku_TR,lg,lt,lv,mi,mn,mr,ms,mt,nb,nl,nn,ny,om,pl,pt,pt_BR,ro,ru,rw,sk,sl,sq,sr,st,sv,sw,ta,te,tg,th,tk,tr,tw,uk,ur,uz,vi,yo,zh_CN,zh_TW because those are loaded one at a time from the actual strings files (not from a conglomerate). I ran that once as a warmup, then performance tested time from refresh to LCP (largest contentful paint). My tests are run on macbook air m1 running Chrome and http-server. The times were: Then I ran the same test with ?locales=*. I ran it once as a warmup then tested 3x to see the LCP. Results: These averages differ by 527ms, which is more than half a second. In my opinion, it is acceptable to have redundant information to get such a significant speed boost in our development. This speeds up sim development iteration, API file generation and CT, and phettest. We would probably see a speed boost by listing which repos have which locales (so it would know not to load Bamboo/fr, for example), but then we would have the problem that the locale lists are redundant information to deal with, and need to be kept in sync, and it would still not be as fast as loading conglomerate files. In summary, I feel a quick time-to-launch for our unbuilt sims is preferable to removing the redundant conglomerate files. I would recommend sharing the knowledge with the team about the conglomerate files, so that devs are aware and do not get surprised by this redundancy. If a developer needs to run a test that skips the conglomerate string file, they can do so by specifying ?locales=..... (list all the locales). I would also like to update that file when |
I made it so that |
I don't see any problem with the commits. There should probably be a PSA so that devs are aware that |
I sent a PSA to #dev-public that read:
Anything else for this issue? Please close if all is well. |
For phetsims/ph-scale#258, I needed to remove a string from ph-scale-strings_en.json, because it was now obsolete and did not appear in the sim. But after running
grunt modulify
, the string was still appearing in Studio. This led to much head scratching. @samreid and I finally figured out that Studio was also loadingbabel/_generated_development_strings/ph-scale_all.json
, and that we needed to also rungrunt generate-development-strings
-- which is also apparently run as part of nightly tasks.Imo having a redundant source of strings like
_generated_development_strings
is a really bad idea. And not updating the redudnant source of strings whengrunt modulify
is run make it even worse. But if we must, then this info needs to be in some documentation, maybe how-to-change-a-string-key.md.The text was updated successfully, but these errors were encountered: