Closed MrSapps closed 6 years ago
You may experience slowness if you initialized YaCo on a repo before the first auto-analysis was complete. You should probably resync the IDB & force push once to clear it up. Anyway, the branch here https://github.com/DGA-MI-SSI/YaCo/tree/issue_36 may reduce the pauses
That wasn't the case but I did a resync & force push anyway :).
Is there an automated build of that branch that I can try? After the force resync the delay is still around the same (not using the issue_36 branch).
Managed to get a build but it still hangs IDA for around 20 seconds on save.
The output was this:
repo: commit: 4 added 1 updated 0 deleted
And the changes where:
https://github.com/AliveTeam/YaCo/commit/33ffa2f346de5fdf821c60d8b3db8bf5097b0b81
Sorry, I cannot do automated builds because this plugin need to compile against the IDA SDK which is not public.
About the slowness, there are multiple issues
Saving may be slow when we need to commit too many files at once. If you save & you get hundred of committed files, it's slow. Version 2.0 mitigates this and the issue_36 further more, but all users need to use the latest version. IDA makes it hard to determine which events are useful & which events are high priority
As you share your incremental changes to other people, the cache will grow in size. Sometimes when you save, we need to rebase your work on top of remote changes. Due to a current design limitation, we need to reload the whole cache directory in memory to correctly identify dependencies. This part is slow if your cache is big and if you do not use an SSD
For now, I advise switching every users to this branch, do a force push and maybe invest in a SSD or try it inside a ramdisk ^^
Thanks, it is running in an SSD so I guess ram disk is the next thing to try. What is the min version of IDA that v2.0 requires? I will switch to this if we all have a compatible version.
Ok, I’m using 7.1 and I’m not reproducing the 20s slowdown with the patches on top of v2.0 If you compile the binaries yourself, You should try with ida 7.1 and idasdk 7.1 Forget the RAM disk if you already have an ssd.
OK - if mixed IDA versions use the same repo is that supported or will all users have to switch?
Edit: BTW I was looking at IDA API changes from 7.0 to 7.1 - doesn't look like anything ground breaking which would radically improve performance?
Could it be due to use of hex rays decompiler that it may always generate a lot of events or something?
Sorry, I cannot do automated builds because this plugin need to compile against the IDA SDK which is not public.
@bamiaux
Can't you encrypt the IDA SDK and host it somewhere, and then you encrypt the decryption key using Travis CI's encrypted values feature?
The repository format is the same & compatible between 7.0 & 7.1 I don't know why you still have slowdowns, I need to check further
@devnoname120 Sorry, I prefer to wait until hexrays make their SDK downloadable by anyone
@bamiaux Do they plan to do so? I haven't read anything about it, and Hex-Rays isn't exactly known for making sound business decisions.
Is there any logging or something I could enable that would help to track down the slow down source?
@devnoname120 I have no idea about their plans, it's still a mystery to me why the SDK is not public
@paulsapps yes, set LOG_IDB_EVENTS to true here https://github.com/DGA-MI-SSI/YaCo/blob/d9f6a60b78a4a446acc08357b2a56bfc7e3f3927/YaLibs/YaToolsIDALib/Hooks.cpp#L38 you will see some logs on IDA actions
Note that if you plan to systematically document the whole base, or "as much as possible", it won't work, as the current XML file format is too inefficient to be able to duplicate a whole IDB
I force pushed and flattened repo history to 1 commit. This has reduced save time from 20-40 seconds to about 5 seconds. This seems strange as I thought the force push would have had the same effect as it updates the "base" IDB file to the current "local" IDB file? (It didn't change save time without flattening history down to 1 commit).
Perhaps that is a separate issue.
So with 1 commit and a new base IDB and no changes pressing save takes around 5 seconds and nothing gets pushed. Does that seem about on par with the kind of performance you would expect?
What do you mean about the save time ? Maybe there's an issue here.
It takes 2s here, but I'm using a local remote. You can try with this
git remote rm origin
git clone . --bare /some/ssd/path
git remote add origin /some/ssd/path
It will remove the network overhead. In any case, it seems saving does too many git commands which may be optimized, I'll look into it soon Saving without any conflict should be faster than current version
Confirmed its around 2 seconds with a local remote. So therefore the delay must be in huge network overhead? This is odd because if I push the changes from the local to real remote origin it only takes around 2 seconds. Therefore I would expect the over all time to be around 4 seconds?
Edit: By push I mean let YaCo save to the local remote (2 seconds) and then do a git push from that one via the git bash).
I will look at our git handling code which is using libgit, maybe we can do things more efficiently, but I don't know yet. I'm a little busy right now though, so don't hold your breath ^_^
With current issue_36 branch, it looks like the biggest slowdown is during push, which entirely handled by libgit2. I've updated to the latest version, but the changelog doesn't mention any speed changes. I've also modified our rebase handling code which should be slightly faster than before but I don't expect dramatic changes
Please try https://github.com/DGA-MI-SSI/YaCo/tree/git_async Saving should be much faster as git push is done in the background now Note that I didn't test it on linux, it may have build issues
Linux build fixed
Will get a Windows build and try it out as soon as, thanks :)
Haven't used it too much yet but looks like the hang is reduced to 2-5 seconds which is acceptable by me :+1:
I'm closing it, it's in master with other fixes and will be in the next release
I don't know if this is a limitation or bug so I figured I'd raise it.
My repo is here:
https://github.com/AliveTeam/YaCo
Fork make a change and save to repro. IDA will hang for up to 20+ seconds on save.