Move test_server module into testing.#65
Conversation
Where it was before, it looked like a test. Even renamed, it would have been strange to have it as a special, favored peer of `testing`, where all the other test machinery lived. Let's pull it and the Viceroy stuff into a `testing` package we can expand as necessary. Making `_ViceroyException` and `_ViceroyReturn` public so the autogenerated test-running wasm module can import them from `testing` seemed slightly preferable to having it reach invasively into `testing.viceroy`. But I'm open to persuasion, as customers shouldn't need them.
0723694 to
692a024
Compare
posborne
left a comment
There was a problem hiding this comment.
Probably for a later experiment, but I do wonder if the init inclusions will cause binaries to be larger as the crawler will pull in more python modules as a result.
Not at all concerned for this case (or probably in general for our sdk), it was just something that occurred to me as likely happening in some cases as I think it might trigger more eager inclusion of modules by componentize-py.
|
Of course, as you know, nobody should be importing It would be interesting to measure the size impact on the wizer'd wasm from importing an extra small module. |
|
It's chaos. Be sure to read all the way to the bottom. A nearly-empty module costs 15K in wasm size. I added nearly_nothing = 1…and imported it in game-of-life: from fastly_compute.nearly_empty import nearly_nothingThe difference in the resulting composed wasms was 15K: >>> 49859107 - 49843951
15156I expect most of that to end up as runtime RAM use. It should be a ceiling, anyway, given how wizer works. Then… I tried making the imported module wholy empty. It increased wasm size 1543 bytes. In fact, doing 2 consecutive builds of equal source just had a 16K variance for me. What can we conclude?
Whee! |
That's somewhat surprising but doesn't totally blow me away; it wouldn't take too much to cause the allocator used leading into snapshotting to result in some fragmentation or other effects. Knowing python, there's probably an absurd number of individual heap allocations taking place during this initialization window (which is obviously a good motivator to snapshot). |
Where it was before, it looked like a test. Even renamed, it would have been strange to have it as a special, favored peer of
testing, where all the other test machinery lived. Let's pull it and the Viceroy stuff into atestingpackage we can expand as necessary.