View Issue Details

IDProjectCategoryView StatusLast Update
0031129FPCFCLpublic2017-03-04 15:59
ReporterBenito van der ZanderAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031129: netdb slow /etc/hosts parsing
DescriptionThe parsing of the /etc/hosts file seems to be rather slow and it is frustrating users.

Perhaps increasing the text buffer size helps when reading the file?
Keep the aliases as list rather than string concat the names?
Or store all entries in a trie and reuse entries for the same address to reduce memory allocations?

Some people have 170 000 lines in the file and it causes a huge delay https://github.com/benibela/xidel/issues/2#issuecomment-266758139
TagsNo tags attached.
Fixed in Revision35520
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2017-03-04 15:59

administrator   ~0098633

I have increased the buffer size to it's maximum, 64k. This speeds up the reading of the file. Most likely it is possible to speed up even more by allocating a larger array of hot entries, but the use of ansistrings makes that a tricky operation.
Patches for this are of course welcome.

Issue History

Date Modified Username Field Change
2016-12-17 01:10 Benito van der Zander New Issue
2017-01-30 08:44 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-01-30 08:44 Michael Van Canneyt Status new => assigned
2017-03-04 15:59 Michael Van Canneyt Fixed in Revision => 35520
2017-03-04 15:59 Michael Van Canneyt Note Added: 0098633
2017-03-04 15:59 Michael Van Canneyt Status assigned => resolved
2017-03-04 15:59 Michael Van Canneyt Fixed in Version => 3.1.1
2017-03-04 15:59 Michael Van Canneyt Resolution open => fixed
2017-03-04 15:59 Michael Van Canneyt Target Version => 3.2.0