Piglet icon indicating copy to clipboard operation
Piglet copied to clipboard

Extremely Slow

Open walle303 opened this issue 10 years ago • 6 comments

The version in the master branch is extremely slow.

walle303 avatar May 12 '15 03:05 walle303

This is heavily dependent on your hardware and setup, but I'll mark it as confirmed, since I think I know more specifically what parts of the code you're referring to and because speed should improve in the next release anyway.

Most of the recent work on Piglet lately has been on the surrounding environment: see serverboy.js and serverboy-streamer.js.

I haven't announced anything to this effect yet, but part of porting Piglet's environment to nodeJS/javascript means that I will also be porting Piglet from LUA to native Javascript. "Native" being a weird word to use with Javascript, but I was running LUA in a Javascript VM before, so... more native I guess. It really does make a difference, LUA loops are greedy and slow and lead to me needing to do some terrible things to optimize them and minimize what data gets shared.

Because of how out-of-touch I am with the whole project atm, can't make any promises about what final run-speed will look like, but it is a goal that with a moderate setup, Piglet should be able to run and stream at the same time. Whether that ever gets 100% full-speed is pretty up in the air. It should be tolerable though.

danShumway avatar May 13 '15 01:05 danShumway

Both master and the release will run, they are just both really slow [dropping the emulator to ~30-40% speed during the loops, rendering the audio useless]

walle303 avatar May 13 '15 03:05 walle303

This is fair - I got full speed last time I ran this code on an i7 laptop, but streaming from a single-core left framerates of even slower speeds than what you're mentioning. Worth mentioning that this was without a GPU on the server, which I believe VBA takes advantage of.

Would you mind posting the specs of the machine you were running on so I'll be able to get a better idea of whether this might be a VBA issue and so I can get a baseline of what the speeds currently are for that hardware and what types of improvement I need to shoot for?

While speed is a concern for Piglet, I'm doubtful that she'll ever be a truly "lightweight" application. But I do expect her performance to improve in the future - the switch off of LUA alone should help with that.

danShumway avatar May 13 '15 11:05 danShumway

i5-4690K clocked at 4.62ghz AMD Radeon R9 270x [WDDM 2.0/ DirectX 12] Windows 10 Build 10074

walle303 avatar May 14 '15 06:05 walle303

Thanks.

Off the top of my head, that type of horsepower sounds like it ought to be getting good performance - I pulled full-speed on my laptop, and the base specs aren't much better (maybe even worse). No promises about when I'll be able to look into the root cause of that discrepancy since I've already basically abandoned VBA, but this is something that I will look into moving forward. Swapping everything to Javascript should bring some standardization on this front.

danShumway avatar May 14 '15 11:05 danShumway

Not that anyone else is tracking at this point, but this ties in pretty deep to getting Piglet set up as a distributed AI rather than a single application.

Up until now, Piglet (both JS version and Lua version) is running on a single core in a single thread. Lots of gains to be gotten from moving away from that system. I'm hoping this switch will make Piglet a lot more fault tolerant and a lot more efficient.

The bad news is that it forces Piglet to be, well, a distributed system, which is fine for my needs but not fine for people who want to just download it and start messing around on their own computer. There may be ways around this, but it just boils down to that Piglet started out as a desktop app and is at this point basically a server app since it needs to be able to stream off of small clusters of inexpensive hardware.

I'll try to keep desktop users in mind as that gets closer to completion.

danShumway avatar Apr 14 '16 10:04 danShumway