I currently have a game with about 1500 non player characters all of which at the moment are running some variation of an AI script. Right now this AI is really simple. NPC's simply walk from location to location randomly. This all happens in a game loop currently timed at 3 seconds as the game plays out in 3 second intervals.
Right now my AI doesn't seem to lock up the UI, but I imagine with more complexity or even more NPC's that it likely will start causing hiccups in the UI. Is this a good use case for web workers? My initial research tells me that I shouldn't create too many web workers so similar AI would likely be pooled together in a web worker of there own.
For anyone interested in actually looking at code this code would give you a good idea of what I'm doing although much of it has been rewritten at this time. https://github.com/caimen/subfaction
So I did some tests and web workers do seem like a good use case for large amounts of NPC AI. You can indeed make changes to the DOM with lot's of processing going on the background with web workers. Not only that but they really are threads and actually do utilize processor cores at least in Chrome. There are other considerations such as how many web workers to actually spawn, for that I found a nifty core estimator https://github.com/oftn-oswg/core-estimator
There is an excellent tool that is probably a bit out of date but still works. It can benchmark about how many web workers is ideal for your computer and gives an interesting idea about there power.
http://pmav.eu/stuff/javascript-webworkers/
Of course if your AI is fairly simple and you aren't experiencing lag in the DOM there really is no need to overkill with this.