Skip to content

performance in windows of lfs.attributes inside lfs.dir loop #153

@sonoro1234

Description

@sonoro1234

on https://github.com/sonoro1234/luafilesystem/ I did a performance comparision on windows between calling lfs.attibutes inside lfs.dir loop and a modified version of lfs.dir which returns file name but also a dir.entry which can be queried for file size and file mode. The performance increase was huge. (It was tested running a test that will recurse subdirectories from a hight level directory and was much slower in windows than in linux)

The change from https://github.com/sonoro1234/luafilesystem/ branch unicode is in commit sonoro1234/luafilesystem@ba39e41

The problem is that it breaks compability with https://github.com/keplerproject/luafilesystem

But the only breaking is that lfs.dir returns as always on linux/osx but on windows it returns the file name and also an object that can be queried for getting attributes. So that old use pattern is still possible but on windows you can also use the object if you need to increase performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions