Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/28/18 in all areas

  1. Arnaud Bouchez

    What is the fastest way to check if a file exists?

    FindFirst is definitively the slowest. It needs at least two calls (+ FindClose), and maintain some state in-between. GetFileAtributes() is the fastest under Windows, and fpaccess/euidaccess on POSIX systems. Note that a fallback to FileAge() is needed in case of sharing violation: function FileExists(const FileName: string): Boolean; {$IFDEF MSWINDOWS} // use GetFileAttributes: much faster than original, which uses FileAge=FindFirst var Attr: Integer; LastError: Cardinal; begin Attr := Integer(GetFileAttributesW(pointer(FileName))); if Attr <> -1 then Result := Attr and FILE_ATTRIBUTE_DIRECTORY = 0 else begin LastError := GetLastError; Result := (LastError <> ERROR_FILE_NOT_FOUND) and (LastError <> ERROR_PATH_NOT_FOUND) and (LastError <> ERROR_INVALID_NAME) and // (use FileAge to test SHARE_EXCLUSIVE files) ((LastError = ERROR_SHARING_VIOLATION) or (FileAge(FileName)<>-1)); end; end; {$ENDIF} {$IFDEF LINUX} begin Result := euidaccess(PChar(FileName), F_OK) = 0; end; {$ENDIF} (extracted from our Enhanced RTL source code) But the version currently included in Delphi 10.3 Rio SysUtils.pas is just as fast on Windows. On POSIX, it uses stats, which is slower than euidaccess().
  2. I believe this is the most common problem in our line of work: not realizing what really is the problem. 😄
  3. dummzeuch

    Speed up reading multiple text files

    (This is a different set of files, so this result can't be directly compared to the above.) It turns out that I wasn't doing anything wrong. It's not the loading and inserting that takes so long but building the list of files to load: loaded 1649 files found 188045 words searching time 2121 ms processing time 275 ms loading time 83 ms inserting time 10 ms sorting time 462 ms total time 2859 ms Thanks for listening. I think I'll just go down into the cellar to weep. 😉
  4. - IDE is slower than 10.2.3. For example, you can see how Project/Options window is being drawn while opening. - If you set the dark mode, then you can see how options window is first drawn white and then skinned. - Code scrolling in the editor seems bit slower. - When app is run and the closed, lots of windows resizing, flickering is going on while the IDE goes from Debug to Default layout. (The same is happening in 10.2.3 as well, only it does it much faster). - Sometimes after couple of runs Object inspector is not drawn at all until you refresh it. - 1st full recompile of the project took about 12 seconds - 2nd full recompile 40 seconds - 3rd full recompile minute and something - 4th one is still running (joke) - After couple of recompiles, the whole IDE just blurs in the background, compiler gets stuck, and then after some time everything resumes. - Code completion still isn't working in my project (It works after the 1st compile, then stops until project is cleaned). I reported it to QC and even got some response in the item, but then it stopped. When I turned the skinning off, IDE become more responsive, but some of the tool bars are drawn with non default background and when I hover over the tool bar buttons, the background for them becomes black. I'm kinda sad. Usually I install the new Delphi and very soon uninstall the previous one, as the new one is just better. Not this time 😞
  5. Wiki Article of the Change https://en.wikipedia.org/wiki/Unicode_in_Microsoft_Windows#cite_note-10 One of out customer had selected that and we started to experience very weird problems and took some time to find out why it misbehaves. None of the application could connect to Firebird SQL server (Ours or third party) successfully. So would be smart to go through all tooling and code with that setting, we never know what M$oft will do with that, will it ever be released or will it soon be default for all. One coder switched this on and started to get weird results, he could not specify what all symptoms, but said that lot of work to be done before that setting can be enabled. Could be smart to Check how your environment, tools and code will behave.
  6. David Heffernan

    TEdit Android DecimalSeparator 10.2.3 VS 10.3

    No such thing as EU decimal behaviour. Different countries in the EU have different locale settings.
  7. Kryvich

    Releasing memory devoted to arrays

    A demo program that demonstrates the bug would help the community to help you.
  8. Stefan Glienke

    Delphi Bugs reported to QualityPortal

    If you're interested, look there - otherwise too much noise for a forum imo.
  9. Actually clients do think this way! A couple of years ago we made a poll about features our customers want to see implemented in our software. Nearly 2/3 of the answers were about visual appearance. Probably because that is what the customers see and work with. They usually don't understand the internals and simply assume they just work. Even now I get approval for changes much easier if they are heavily accompanied by visual enhancements.
×