Perforce slowing down unreal 5

Hello,

We have just set up a local server for our team to use perforce with our projects. Currently, the people who are not on the local network connect to the server through Hamachi.

The project setup and everything works fine, but source control takes a really long time to rename, create, edit, or do anything in editor at all. Does anyone else here have the same problem / know a solution that would make perforce work faster with the editor. Both the server and the computers are windows devices.

If the problem is Hamachi, then what are the alternatives that we could use? (preferably free alternatives if possible)

TL;DR perforce source control in unreal editor is really slow for us and we are trying to find a solution

1 Like

Hello. Thank you for posting.

I tend to use Perforce quite a bit myself and I find that if I copy the files locally and work on the project locally, performance is better. Another potential concern is making sure your P4Ignore is set in the right path.

Its great to hear of developers using version control. Best of luck to you out there.

What do you need Hamachi for? You can configure your own router to forward to the server, or set up a VPN to connect them.

Itā€™s likely that the network connection or the hardware (router etc) simply can not handle the amount of traffic quickly, but it could also be Perforce itself or the size of the repository. For that youā€™d need to perform some tests to be sure.

Iā€™m still a huge fan of Git. I tried Perforce and Plastic and I was seriously disappointed by the lack of control I had and complexity to port my existing git repo (which eventually just didnā€™t work out). So I sticked with git. If you wonder about how to use git in a team and with binary files there seem to be some developments to improve that. thereā€™s a Git plugin on the marketplace to work with a team (and lock binary UAssets), but I have not tried it. Also the new version of Git lfs might have proper ssh support now, I read about it on github a while back.

1 Like

Canā€™t imagine a world without it :slight_smile: reality would crash probably

1 Like

We are using hamachi to connect to the server that is not hosted locally. We are basically all working remote for now so thats the only way we found to connect to each others computers for now.

Where do you think is a good place to start with connecting to the server using VPNs?

We started trying to get into it heavier lately and it has been extremely useful (nearly as much as it has been frustrating :smiley: ). How does your workflow look like when you are working locally and then trying to upload it to the source control?

Do you check out the files manually in P4V before starting to modify them and then switch on source control in editor later when checking all the changes in?

If you manage the server and its network you can. Google microsoft docs on how to install a vpn server and how to add a vpn connection to your pc.

weā€™ll look into that. thank you

The project setup and everything works fine, but source control takes a really long time to rename, create, edit, or do anything in editor at all. Does anyone else here have the same problem / know a solution that would make perforce work faster with the editor. Both the server and the computers are windows devices.

Sadly, it is a nature of P4.
Iā€™ve tried different setups, and none worked w/o lags (even when the server was connected to local network where the clients were). P4 queue is just slow by nature.

One thing that Iā€™ve noticed that may help is to check out all file you expect to move/rename prior to doing that will help to decrease the time of the operations.

Another way is to use Offline mode + reconcile. Not ideal, but may save hours of reordering files if counts are in thousands.

Iā€™ve been using P4 for 4-5 years with UE4. And I despise it. Itā€™s a horrible integration.

2 Likes

Just an example of how horrible it is:

  • Add 100 files to repo
  • Submit
  • Then use ren/move command and place them in a different folder
  • Do not submit
  • Then go to change list and revert
  • p4 will undo the move operation by delete!

We are having the same problem, we have local workspaces and the only thing we have issue with is edits in the editor even checking and unchecking properties in editor will make the editor freeze for 10 to 25 seconds each time. closing editor windows when checking assets and BPs also have that effect, non source controlled projects on the same system and SSD will have none of the performance issues. I hope a solution for this is around the corner itā€™s making working with Perforce being questioned company wide.

1 Like

25s per change? It is too much imo. For local network especially.

For me itā€™s generally ~1-5s per change. 1s is when engine already has files checked out and just iterating the list of changes. And 5s when it was not aware file needs to be checked out and it needs some time to look that file has ā€œread only flagā€ then it checks the repo and then it shows up the dialogue to check out the file.

Same here. I was looking forward to getting used to a perforce workflow, but I canā€™t imagine how so many people can use perforce when it causes such slowdowns. Itā€™s taking me 15 seconds just to close a material for example. Iā€™m using a local network to just work between my different PCā€™s in the same house. I guess itā€™s back to manually making file backups! :frowning:

You can make it less annoying by disabling the automatic prompts and actions. But you will need to do reconcile manually every time.
image

Perforce core is just old software being dragged kicking and screaming while they tack on other solutions on top. Working with Perforce is painfully slow with a large number of files being changed, and the documentation was written as an after thought and requires you to make multiple searches just to understand a single line in a doc.

Iā€™m running a fully populated P4 proxy to speed things up, with a 24 core TR, 64GB ram, with NVME drives, and reconciling say 340,000 files is a nightmare (engine upgrade). As Iā€™m writting this P4 is reconiling about 140,000 files. P4V.exe has 38 threads openā€¦ at 0.09% average CPU usage, 1GB ram usage, and almost no disk/network activity except massive bursts every 2-4 minutes randomly. I waited three hours just to get to the Reconcile Offline Work file list dialog, and now I can wait another three hours for P4 to actually reconcile it. (Mind you this is TOTALLY client side. Iā€™m not storing any data on the server, so take that out of the equation. Plus my P4 Proxy (think server cache) already has all the data I need to do this reconcile.

Also, it is Christmas break. Iā€™m the ONLY one using the P4 server atm. I checked. There is no excuse for this considering you have to pay for it.

And Iā€™m tired of seeing various ā€œtricks and tipsā€ for speeding up P4 which donā€™t work, while git is running laps around P4.

If you plan on having a large UE project (200,000+ files, 60gb+) I would stay away from P4. We switched from git for filelocking, and it wasnā€™t worth it. Plus I believe git has file locking capabilities now, and UE5 no longer saves maps as a single file, so reaching the git file size limit would take serious effort.

What @S-ed said will give you local performance back. But also, like he said, you will have to manually reconcile EVERY time. And if your .gitignore/p4ignore game isnā€™t 100% on point, you are going to constantly be fighting with files being added to your reconcile that you donā€™t want.

Hello everybody! recently, here at the company, we accidentally discovered a way to solve these slowdowns when working in perforce.

By needing to delete the saved folder of the project we are developing, perforce is now very fast. We no longer have a problem with taking time to open and close windows, save, press ctrl+z, checkout.

Itā€™s working as if it were working locally offline.

Delete only one ā€œSavedā€ folder

Could you elaborate on this? Every piece of documentation Iā€™ve read (guides, example p4ignores, Epicā€™s own .gitignore file)ā€¦ all state that you shouldnā€™t ever check in Saved\ folders for any version control system. Are you referring to the Saved\ folder in your projectā€™s root directory?

Weā€™re having issues with a locally installed p4s server being incredibly slow (while in P4V) reconciling engine source while merging new versions into our custom engine code.

For example, after running Setup.bat, UE5.2 is ~162k files versioned (after taking the p4ignore into account), and either P4V or our p4s server really doesnā€™t like that.

Resolve, Reconcile, Add, and the ā€œp4 fstat -Olhpā€ command (P4V runs this command after every change to the workspace) are all incredibly slow, as they all seem to have to comb through the entire 162k files.

Reconcile is the worst however, as this command will churn through the ~400k files you have in your workspace directory after running Setup.bat and Generate Project Files.bat

Weā€™re running the server on a 16-core (32-thread) AMD 5950x with 128GB DDR4

Even trying to run P4V operations on the same machine the server is on using localhost:[port] ā€¦ itā€™s incredible how slow everything is.

The serverā€™s configurables regarding parallel submits, syncs, shelves, and checkpoints are configured, and net.parallel.max=28, but P4V appears to only use 4 threads on the server for the Resolve, Reconcile, Add, and fstat commands.

ā€¦We just keep thinking thereā€™s something obvious that weā€™re missing, but that isnā€™t documented.

1 Like

I cannot answer these specific questions about Perforce commands because I donā€™t have the knowledge for that. What we noticed here that made the work within Unreal much smoother, without constant freezing for every little thing we did, was deleting the ā€œsavedā€ folder of the project weā€™re working on. In all the projects weā€™re working on, after initially uploading the project to Perforce, we delete the ā€œsavedā€ folder of the project itself, and everything starts flowing without any freezing. Of course, it shouldnā€™t be the entire ā€œsavedā€ folder, but rather some configuration within the source control that causes these freezes within the project. However, since we donā€™t have the knowledge to identify it, what we do is delete the entire ā€œsavedā€ folder. And after doing that, even when we upload the projects to Perforce and pull updates every day, there havenā€™t been any more freezes.

Thanks for the advice @geonunes35.
I think this is one step away from the correct solution. Instead of deleting the projectā€™s ā€˜Savedā€™ folder I would recommend just changing it from Readonly. Since it shouldnā€™t be tracked in Perforce anyway it shouldnā€™t affect anything.

Because the Saved folder is full of project config and ini files I imagine that itā€™s being slowed down Unreal is used to having full control over these files.

For anyone (Using Windows) wondering:

  1. Navigate to your project directory
  2. Right click ā€˜Savedā€™
  3. Click Properties
  4. Uncheck ā€˜Read-onlyā€™
  5. Apply changes to subfolders and files

Changing the ā€œsavedā€ folder from read-only fixed my slow downā€¦even with p4ignoring the folder.

Thanks for the tip.