mozilla :: #perf

16 May 2017
15:56jmaherb4hand: hi
16:29b4handjmaher: hey. Got my machine all set up. I am going to start today
16:29jmaherb4hand: cool
16:30jmaherb4hand: I am not sure on how we use webextensions, from this: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_first_WebExtension - I get the impression we just need a manifest.json file?
16:30b4handYeah, an intern I knew created a webext generator. I was going to use that. It creates a blank webext
16:31jmaherok, cool
16:31jmaherI know nothing about them, I was trying to learn more today
16:32jmaherb4hand: do you know how they are installed; if we have one in a profile does it just work?
16:32b4handjmaher: https://github.com/justinpotts/project-axl
16:32b4handI also think muffinresearch over in #amo has a generator
16:32b4handI do think its just a manifest.json tho
16:35jmaherb4hand: let me go to #amo and ask questions about installing an empty webext
16:38aswanb4hand, jmaher: there's also #webextensions
16:38b4hand^
16:38jmaheraswan: oh, cool
16:38aswanare you trying to test startup perf with a trivial webextension installed?
16:38jmaheraswan: yes
16:39aswanJohn-Galt: for the test described above, what was the conclusion about what the test should include? ie should it have a background page?
16:40aswanb4hand, jmaher: if it really is mean to be completely empty, a simple manifest.json is all you need
16:40* John-Galt reads backlog
16:41jmaheraswan: yeah, determining what an empty webextension is is one part of the problem; the other part is getting it installed
16:41John-GaltI think we decided to test a WebExtension with an empty background script.
16:41jmaherok
16:42jmaheris that like a content_scripts in the manifest.json?
16:42aswanjmaher: simplest would be to install it and then restart, if that's not feasible with the test harness, then we can fuss directly with the profile
16:42aswanjmaher: no a "background" property, there shouldn't be any content_scripts
16:43jmaheraswan: that is realistic to do; we do a warmup on the profile- as long as if we install it during the warmup it will remain for future restarts of the browser :)
16:44jmaheraswan: is there a programatic way to install a web extension, maybe with marionette or something?
16:44aswanjmaher: good, that seems easiest. assuming you're not using release builds, you just need to set the xpinstall.signatures.required pref to false
16:44aswanhm, you could script a bunch of click in about:addons, or you could navigate to a page that uses IntallTrigger
16:44jmaherok, cool, we can do that
16:44aswanyou'll still need to accept permission prompts
16:45aswanwhich should be doable from marionette
16:45jmahergot it
16:45jmaherthat seems reasonable, let me read up on some of that and see if we can get that working
16:45aswanhttps://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger
16:46aswanyou'll get an initial prompt with confusing wording that is just about allowing the page to attempt installation
16:46John-GaltI think Marionette should be able to just install the add-on...
16:46aswanJohn-Galt: but i think that just copies it into the profile
16:46aswanyou'll have to go manually enable it
16:46jmaheryeah, we can figure out the best way with marionette to install the addon
16:47aswanwait that can't be right since we rely on installing other extensions through marionette
16:47aswanhm
16:47jmaherok, do we need .xpi files, or will a directory with the manifest.json be sufficient?
16:47John-GaltAnd XPI would be best.
16:48aswanxpi would be good for measuring the code paths that will run in the real world
16:48jmaherok, great; and this won't need to be signed (as per the pref we are flipping)
17:22jmaherb4hand: I assume I need more than a manifest.json to make a valid .xpi to install
17:24jmaherb4hand: do you have a random example of a web extension that is packaged as a .xpi so I can work on installing it via marionette? doesn't have to be a dummy one with the background set
17:24b4handjmaher: https://justinpotts.github.io/project-axl-frontend/
17:25b4handthis creates one
17:25b4handI just downloaded one and it looks fine
17:25jmaherah, I missed the frontend part!
17:25b4handheh me too
17:25b4handforgot they were separate
17:26jmaherthat got me going right now
18:04b4handjmaher: will the marionette commands need to be in the directory of the test I am making?
18:05jmaherb4hand: I am not too familiar with marionette
18:06jmaherI have verified I can install the demo axl web extensions, I am using python interface to control the browser
18:06jmaherb4hand: do you have better skills for marionette?
18:07b4handjmaher: kinda...I haven't used it in a while
18:08jmaherok I am open to all options here
18:29b4handjmaher: I don't think there will be that many commands so I could probably do it
18:30b4handBut I would need to know where the script lives
18:32jmahercurrently we don't use marionette at all, so getting that running seems to be a next step
18:32jmaherthat isn't so easy
18:32b4handah
18:33jmaherit is easy to add -marionette to the command line
18:34jmaherb4hand: for example, I wrote a script like this: https://pastebin.mozilla.org/9021913
18:35jmaherthat works fine, but doing it inside of talos I never get past client.start_session()
18:35b4handhm
18:36jmaherI don't know enough about marionette to know if I am even taking the right approach!
18:36b4handjmaher: https://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette_driver/marionette.py#1290
18:36b4handI think that command will open a browser
18:37b4handMaybe marionette should start the browser then talos takes over
18:37jmaherhmm, I wonder if --no-remote is the problem
18:37jmaherI have a custom profile that needs tobe initialized, maybe we make 2 passes though
18:39jmaheroh!
18:39jmaherthis could be my use of a proxy server
18:39b4handCould be!
18:41jmaherwe do that inside of mochitest- let me look at the option of start_session and then using that profile to add the rest of talos settings to
19:38mstangeaklotz: ping
19:38mstangeaklotz: I'm looking at IOInterposer::Register again and I don't really understand how it works with respect to threads
19:38mstangeit seems like there's one master list, and that list is only moved into thread local data if you call Report
19:39mstangeand if I call Register, I register with the master list regardless of what thread I'm calling it on
19:45aklotzmstange: So this is kind of written as a poor man's RCU.
19:45aklotzWe don't want threads to take a mutex every time there is an I/O operation to check the master list
19:45aklotzSo Register and Unregister update the master list which also has a generation count
19:45aklotzThreads that are registered with the I/O Interposer have their own observer list in TLS
19:46aklotzSo if nothing has changed they always use their own thread-local observer list
19:46aklotzBut if something has changed and the generation count of the master list does not match the generation count of the thread-local list, the thread will take the master list lock and update its thread-local copy
19:47aklotzthen the generation counts match again so it doesn't need to take the master list lock again until the next time the master list changes
19:48mstangeaklotz: so this relies on Update being called between two different Register calls on two different threads?
19:48mstangewhat guarantees that?
19:50aklotzmstange: Update is always called by threads registered with the I/O interposer whenever an I/O event is generated
19:50mstangeoh, I see!
19:53mstangeaklotz: thanks
19:53aklotzmstange: no problem
20:12John-Galtmstange: What did you do with my file picker?!
20:13mstangeJohn-Galt: gregtatum converted it into a drop handler
20:13John-GaltDoesn't work...
20:13mstangeyikes
20:13John-GaltAnd why can't I have both?
20:13mstangeno good reason
20:13mstangeI'll back it out
20:14John-GaltOh, it works if I use a Gnome-ish file manager...
20:14mstangeoh, interesting
20:14mstangeI just tested it locally and it seems to work on Mac
20:15mstangeso it sounds like we need a file input in addition to the drop handler
20:15John-GaltI guess we don't support Linux D&D very well.
20:15mstangegregtatum: want to implement?
20:15John-GaltAnyway, probably no need to back it out since I have a workaround. But a file picker in addition to D&D would be nice.
20:15mstangeok, thanks
20:16mstangeI'll file an issue
20:16gregtatummstange: yeah i can add that back in there
20:16John-Galtmstange: Although... it's seriously unintuitive... It only even mentions D&D when it's on the screen that asks you to install the profiler. And it *does* work in the other screen, but you seem to need hover for a bit before it shows the D&D square and accepts the file.
20:17mstangegregtatum: I filed https://github.com/devtools-html/perf.html/issues/331
20:18mstangeJohn-Galt: I don't know why there would be a delay
20:19John-Galtmstange: I don't either, but there is. There's a bit of a delay on hover before the D&D box begins animating in, and dropping the file before it's there has no effect.
20:19gregtatumthe drag and drop API is really hard to understand, so i might not be implementing all of the handlers correctly
20:20gregtatumand i'm not ruling out OS differences
20:20mstangeand Firefox bugs
20:53jmaherb4hand: I think I got marionette to install properly
20:54jmaherb4hand: err marionette to install a webextension; I had to change how I was launch the firefox browser
20:57b4handjmaher: sweet!
21:01b4handI was thinking it was how it got launched
21:03jmaherb4hand: I should have a patch that you could apply locally- there is a list of todo items to sort out
21:04b4handperfect
21:04b4handAll we need is to add a test with a blank webext correct? Not one without
21:04b4handjmaher: ^
21:05jmaherb4hand: correct
21:06b4handI think the hardest thing will be using mercurial :(
21:07jmaher:(
21:15b4handgit-cinnabar is awesome though
21:16jmaherb4hand: I just uploaded a WIP patch to run talos with webextensions: https://bugzilla.mozilla.org/show_bug.cgi?id=1364941
21:16jmaherit assumes there is a dummy.xpi in the webextensions/dummy/ folder, possibly you can work from that and add the dummy and build the .xpi
21:17b4handOkay cool
21:17b4handI can just pull that patch?
21:18jmaherumm, download it as a raw file
21:18b4handAh okay. Sorry I havent used mercurial in a while
21:18jmaherthen you can either |patch -p1 < filename| or use mq |hg qimport <filename>|
21:19jmaherit is ok
21:19jmaherif you patch, then you can make a commit in a local branch and base future changes off that
21:19jmaherI am going to afk, it is getting to be dinner time for me now
21:20jmaherb4hand: I will check back before too long if you have questions
21:20b4handthanks!
22:06b4handjmaher|afk: got the patch applied. Is there a way to run it?
22:09b4handgot it
17 May 2017
No messages
   
Last message: 39 days and 19 hours ago