Textures generated at runtime causing massive slowdown

My project is one where I recreate a Quake 3 level inside of Unity. I do this by reading all of the information I need for the meshes, textures, lightmaps, etc directly from a .pk3 file, which is a zip. I use SharpZipLib to read the file, and create what I need from the streams it provides. After adding support for textures, I receive massive slowdown when rendering those textures. I’m not sure why. The visual results are the same as when I was reading the textures from disk.

The slowdown is not instant, and if I “ride it out”, it goes away completely. It seems that Unity is doing something to the textures before they are rendered for the first time, but I can’t figure out what.

The textures are crated one of two ways, either using .LoadImage(MemoryStream) to load the .jpg textures, and a custom class of my own that reads in Color32 information from a TGA and returns a Texture2D. I call Apply() on the TGA based texture after I SetPixels32, and call Compress(true) on both.

As I said I previously had all of the textures files extracted and loaded as TextureAssets, and there were no performance problems. Does Unity do some kind of processing (mipmaps?) ahead of time that it’s having to do Just-In-Time with the textures being created via script?

I just tried this out on a Windows machine without changing a single line of code, and it’s working perfectly. I was using an iMac previously. The iMac has decent graphics, so I’m not sure why it’s only an issue there. I also ran it on my Surface Pro 2, which has weaker graphics than the iMac, and it works great there as well. Is this a mac specific issue?