Hi Karoschel, thanks for that feedback!
Unfortunately I'm not sure that will work, since the trails are created using variables only available in control stage like the train color. I can mess around a bit and see if I can come up with something, but I'm not sure.
That being said I have spent a lot of time trying to reduce the script impact this mod has. If you haven't already, I'd encourage you to explore the different mod settings. By default the mod uses the "Pretty" performance mode setting, which means the code only runs every 2 ticks, but you can change that to every 4 ticks by choosing the "Efficient" mode instead.
The good thing is the script impact should only scale with number of trains, and even creating the trails on_tick ("Beautiful" performance mode) for ~350 trains should be less than 4ms, and just about or under 1ms on "Efficient" performance mode. I know that's still a lot, but there are some more potential optimizations planned for future releases I'm working on.
If you want to play around with the code yourself I do have it up on GitHub, it's just a bit hidden :P https://github.com/jingleheimer-schmidt/train-trails
p.s. If you have a megabase save handy, I'd be happy to use it for testing and benchmarking the mod!