elementary / elementary/files

Permanently deleting lots of files on fast storage is 100x slower than `rm -r`

Open
#1,579 2 comments 0 reactions 0 assignees View on GitHub
Priority: Low
Dominant language
Vala
Stars
365
Forks
82
Avg merge
4d 2h
Merged PRs (30d)
3

Description

## What Happened

Permanently deleting lots of small files on fast storage (e.g. an NVMe SSD) is 100x slower in Pantheon Files than when using `rm -r`. For example, deleting 800,000 small files takes 14 minutes in Files but 14 seconds via `rm -r`.

## Expected Behavior

Performance comparable to `rm -r` when deleting files permanently

## Steps to Reproduce

1. Create tons of small files in a single folder, e.g. via a shell loop with echo. I've used an NVMe SSD, but tmpfs should also work.
2. Select the folder (without opening it) in Pantheon Files and press Shift+Delete, then click through the warning dialog.

### Logs

[Interactive results of profiling with `perf` in your browser](https://profiler.firefox.com/public/4183b6vgcrxa8gfnjgh8k9kd45rwm57k4ebx710/flame-graph/?globalTrackOrder=0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-133-134-135-136-137-138-139-140-141-142-143-144-145-146-147-148-149-150-151-152-153-154-155-156-157-158-159-160-161-162-163-164-165-166-167-168-169-170-171-172-173-174-175-176-177-178-179-180-181-182-183-184-185-186-187-188-189-190-191-192-193-194-195-196-197-198-199-200-201-202-203-204-205-206-207-208-209-210-211-212-213-214-215-216-217-218-219-220-221-222-223-224-225-226-227-228-229-230-231-232-233-234-235-236-237-238-239-240-241-242-243-244-245-246-247-248-249-250-251-252-253-254-255-256-257-258-259-260-261-262-263-264-265-266-267-268-269-270-271-272-273-274-275-276-277-278-279-280-281-282-283-284-285-286-287-288-289-290-291-292-293-294-295-296-297-298-299-300-301-302-303-304-305-306-307-308-309-310-311-312-313-314-315-316-317-318-319-320-321-322-323-324-325-326-327-328-329-330&localTrackOrderByPid=0-0~2495-0-1-2-3~2265-0-1-2~4381-0-1~2606-0-1~4222-0~1244-0~406-0~3338-0-1-2-3-4-5-6~1779-0-1-2-3~2278-0~2233-0-1-2-3~2260-0-1~233-0~725-0~724-0~96-0~2952-0~697-0~3837-0~11-0~37-0~3834-0~25-0~24-0~3842-0~4385-0~4386-0~4387-0~4388-0~4389-0~4390-0~4391-0~4392-0~4393-0~4394-0~4395-0~4396-0~4397-0~4398-0~18-0~4399-0~4401-0~4402-0~4403-0~4404-0~4405-0~4406-0~4407-0~4409-0~4411-0~4412-0~4413-0~4414-0~4415-0~4416-0~4417-0~4418-0~4419-0~4420-0~4421-0~4422-0~4423-0~4424-0~4425-0~4426-0~4428-0~4429-0~4430-0~4432-0~4433-0~4434-0~4435-0~4436-0~4437-0~38-0~4438-0~4439-0~4441-0~4442-0~4443-0~4444-0~4445-0~4446-0~4447-0~4448-0~4449-0~4450-0~4451-0~4452-0~4453-0~2508-0-1~4454-0~4455-0~23-0~4456-0~4457-0~4458-0~4459-0~4460-0~4461-0~4462-0~4463-0~4464-0~4465-0~12-0~4466-0~4467-0~4468-0~4469-0~4470-0~4471-0~4472-0~4473-0~4474-0~4475-0~4476-0~4477-0~4478-0~4479-0~4480-0~4481-0~4482-0~4483-0~4484-0~4485-0~4486-0~4487-0~4488-0~4489-0~4491-0~4490-0~4492-0~4493-0~4494-0~4495-0~4497-0~4498-0~4499-0~4500-0~4501-0~4502-0~17-0~4504-0~4505-0~4506-0~4507-0~4508-0~4509-0~4510-0~358-0~2351-0~224-0~252-0~2095-0~3331-0-1-2-3-4~3833-0~3835-0~3836-0~3838-0~3839-0~3840-0~30-0~10-0~4511-0~4512-0~4513-0~4514-0~4515-0~4516-0~4517-0~4518-0-1-2~702-0~3105-0~795-0~4521-0~4522-0~4523-0~4524-0~250-0~4525-0~4526-0~4527-0~4528-0~4529-0~4530-0~2602-0~4531-0~4532-0~4533-0~4534-0~2561-0~4535-0~4536-0~4537-0~4538-0~4539-0~4540-0~704-0-1~4541-0~4542-0~4543-0~4544-0~4545-0~4546-0~4547-0~4548-0~4549-0~4550-0~4551-0~4552-0~4553-0~4554-0~4555-0~29-0~4556-0~4557-0~4558-0~4559-0~4560-0~4561-0~4562-0~4563-0~4564-0~4565-0~4566-0~4567-0~4568-0~4569-0~4570-0~4571-0~4572-0~4573-0~4574-0~4575-0~4576-0~4577-0~4578-0~4579-0~4580-0~4581-0~4582-0~4583-0~4584-0~4585-0~4586-0~4587-0~4588-0~4589-0~4590-0~4591-0~4592-0~4593-0~4594-0~4595-0~4596-0~4597-0~4598-0~4599-0~4600-0~4601-0~4602-0~4603-0~4604-0~4605-0~4606-0~4607-0~4608-0~4609-0~4610-0~242-0~4611-0~4612-0~4613-0~4614-0~4615-0~4616-0~4617-0~4618-0~4619-0~4620-0~4621-0~4622-0~4623-0~4624-0~4625-0~4626-0~4628-0~4627-0~4629-0~4630-0~4631-0~4632-0~4633-0~2682-0~4634-0~2610-0~2493-0~4635-0~708-0~4636-0~106-0~4637-0~4638-0~378-0~351-0~728-0~2076-0~2109-0~2334-0~2165-0~727-0~4640-0~4641-0~2063-0~4642-0~4644-0~4645-0~4647-0~4648-0~4650-0~4651-0~1-0~4652-0~4653-0~2167-0-1~2592-0~2600-0~1944-0-1~228-0~4380-0~&thread=1&timelineType=stack&v=5), courtesy of Firefox Profiler.

It seems 50% of the time is spent on issuing a D-bus call and waiting on the result, 20% is spent in `show_mountinfo`, and only 14% of time is spent on actual deletion.

## Platform Information

Pantheon Files package version `4.5.0+r4069+pkg95~ubuntu18.04.1` (latest on elementary OS 5.1.7 Hera as of this writing)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.