« home   paste   Anonymous | Login | Signup for a new account 09-17-2019 13:03 CEST
* X »
GeSHi - Generic Syntax Highlighter Syntax Coloriser for PHP

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000093 [GeSHi] optimisations minor always 09-17-06 22:13 09-19-06 06:11
Reporter nigel View Status public  
Assigned To nigel
Priority low Resolution open Platform
Status assigned   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 1.1.2alpha2
  Product Build
Summary 0000093: Try to avoid passing long strings around
Description geshi_get_position currently takes some very long strings (upwards of 50K quite easily on large source), and does it often. It would be better if the callers passed shorter strings if they could.
Steps To Reproduce
Additional Information The performance benefit of this is unknown, and will have to be tested.
Attached Files

- Relationships

- Notes
09-19-06 06:11

There are two possible things that could be done about this issue:

1. Pass only the string until the first known match of a string (including some chars behind) for further searching to geshi_get_position as every match that starts AFTER a known match is uninteresting for finding the next delimiter

2. Do first chance matching to find the next delimiter using a shortened version of the original code string (if this is above a given size*). This should significantly speed up RegExps that are known to be slow. Only if no match is found using the shortened string the whole remaining source is passed in for searching. This should help because GeSHi aims to find mostly short context strings thus the found offset is most times near the beginning of the passed string. The disadvantage of this method is that long contexts (e.g. a comment of multiple KB) would significantly slow down as it has to be searched twice - which should be compensated by the long contexts that make highlighting such comments very fast (only few searches of this kind will every appear in a source).

- Issue History
Date Modified Username Field Change
09-17-06 22:13 nigel New Issue
09-17-06 22:13 nigel Status new => assigned
09-17-06 22:13 nigel Assigned To  => nigel
09-17-06 22:13 nigel Relationship added child of 0000091
09-18-06 00:09 nigel Category core => optimisations
09-18-06 00:11 nigel Relationship deleted child of 0000091
09-19-06 06:11 BenBE Note Added: 0000455


Mantis 1.0.0rc2[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker