unformatted XML may come without any newline, although they could be very big. It takes too long to load them. My 75MByte unfromatted XML file takes longer than 5 minutes from SSD on a 16GB I7 HP E850 machine. A formatted 185MByte XML file takes less than 2 minutes to load. A 40MByte formatted XML file takes less than half a minute.
Geany's most prominent use-case is for human programming with lines people can understand (and write :). As a result lots of things like screen layout and formatting are performed on a a per-line basis, which is fine for human length lines.
But in your case that means they are always being performed on the whole file, so its much slower, and clearly the operations are polynomial time in the length of the line since doubling the size takes ten times the time.
PS in particular wrapping is a polynomial operation, and I guess you have wrapping on if its one 75Mb line.
@rolfschumacher you might be able to gain back some of the performance lost on super-long line handling by opening the file with the "None" filetype hidden under "More Options" in the Open File dialog.
However, knowing that unformatted xml is not so easy for geany, you can format it in advance. With the stylesheet
``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform%22%3E <xsl:output method="xml" indent="yes" encoding="UTF-8" /> <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <!-- standard copy template --> <xsl:template match="@*|node()"> xsl:copy <xsl:apply-templates select="@*" /> <xsl:apply-templates /> </xsl:copy> </xsl:template> </xsl:stylesheet> ```
saxon formats my 75MByte file to a 136MByte formatted xml in 8 seconds.
I would like to recommend that geany analyses whether the file is suited to be worked within geany and otherwise informs the user.
I would like to recommend that geany analyses whether the file is suited to be worked within geany and otherwise informs the user.
The problem with this how does Geany know? Its a similar situation to the "should warn of big files" problem that has been raised before. What is "big" for my 4GB core 2 spinny disk laptop is a snip for someone elses 32GB 3.5Ghz i7 SSD workstation.
And "analysing" the file before/during loading is only going to slow down loading more for everybody.
From my personal viewpoint, Geany is a tool for developers, and as such the target users should be assumed to have a reasonable understanding that some operations not in the common use-case (enormous lines or massive log files for eg) are not optimised for, and so may be lower performance (from experience if not by prior consideration :-).
this can be labeled as Scintilla issue, most of time is spend on word wrapping and measuring width. SCI_SETLAYOUTCACHE(SC_CACHE_PAGE) may help a bit.
@zufuliu it certainly occurs inside Scintilla, but I am not sure what it can do about it, it has to perform the wrapping operation if that setting is on.
I doubt the cache will help since the problem is the first time the file is opened, so nothing is in the cache.
Sadly I don't known how to improve this yet, I observed a similar problem several months ago https://sourceforge.net/p/scintilla/feature-requests/1238/.
I think what @rolfschumacher said 'load' not means loading the file from disk, instead means the whole time (from 'open' to see text on screen). Loading the file and parsing (assigning style bits) it the unformatted file will faster than the formatted one.
'load' not means loading the file from disk, instead means the whole time (from 'open' to see text on screen)
Thats the assumption since Geany is unavailable until then :)
Loading the file and parsing (assigning style bits) it the unformatted file will faster than the formatted one.
I think you may have left a word out somewhere, that doesn't make sense.
github-comments@lists.geany.org