Comments (2)
Thanks for the detailed report @realiteer! I'll have a closer look.
from liqp.
I'm currently the porting the ANTLR3 grammar to the newer v4 version, and this is now what I get with the newer v4 version of ANTLR:
import liqp.nodes.LNode;
import liqp.tags.Tag;
import org.codehaus.plexus.util.StringUtils;
import org.junit.Test;
import com.google.common.base.Stopwatch;
public class Demo {
@Test
public void testCustomTags() {
Tag.registerTag(new Tag("snippet") {
@Override
public Object render(TemplateContext context, LNode... nodes) {
return "NADA";
}
});
final Stopwatch stopwatch = new Stopwatch();
for (int n = 1; n < 60; n++) {
final String content = StringUtils.repeat("{% snippet \"face\" %}", n);
stopwatch.start();
Template.parse(content);
stopwatch.stop();
System.out.printf("script size=%s, tags=%s -> %s milliseconds\n", content.length(), n, stopwatch.elapsedMillis());
stopwatch.reset();
}
}
}
output:
script size=20, tags=1 -> 278 milliseconds
script size=40, tags=2 -> 8 milliseconds
script size=60, tags=3 -> 3 milliseconds
script size=80, tags=4 -> 3 milliseconds
script size=100, tags=5 -> 4 milliseconds
script size=120, tags=6 -> 4 milliseconds
script size=140, tags=7 -> 5 milliseconds
script size=160, tags=8 -> 5 milliseconds
script size=180, tags=9 -> 5 milliseconds
script size=200, tags=10 -> 4 milliseconds
script size=220, tags=11 -> 3 milliseconds
script size=240, tags=12 -> 5 milliseconds
script size=260, tags=13 -> 4 milliseconds
script size=280, tags=14 -> 4 milliseconds
script size=300, tags=15 -> 9 milliseconds
script size=320, tags=16 -> 5 milliseconds
script size=340, tags=17 -> 6 milliseconds
script size=360, tags=18 -> 6 milliseconds
script size=380, tags=19 -> 6 milliseconds
script size=400, tags=20 -> 6 milliseconds
script size=420, tags=21 -> 9 milliseconds
script size=440, tags=22 -> 15 milliseconds
script size=460, tags=23 -> 12 milliseconds
script size=480, tags=24 -> 12 milliseconds
script size=500, tags=25 -> 9 milliseconds
script size=520, tags=26 -> 14 milliseconds
script size=540, tags=27 -> 10 milliseconds
script size=560, tags=28 -> 7 milliseconds
script size=580, tags=29 -> 10 milliseconds
script size=600, tags=30 -> 27 milliseconds
script size=620, tags=31 -> 17 milliseconds
script size=640, tags=32 -> 8 milliseconds
script size=660, tags=33 -> 16 milliseconds
script size=680, tags=34 -> 9 milliseconds
script size=700, tags=35 -> 18 milliseconds
script size=720, tags=36 -> 13 milliseconds
script size=740, tags=37 -> 13 milliseconds
script size=760, tags=38 -> 14 milliseconds
script size=780, tags=39 -> 15 milliseconds
script size=800, tags=40 -> 23 milliseconds
script size=820, tags=41 -> 19 milliseconds
script size=840, tags=42 -> 19 milliseconds
script size=860, tags=43 -> 25 milliseconds
script size=880, tags=44 -> 20 milliseconds
script size=900, tags=45 -> 27 milliseconds
script size=920, tags=46 -> 20 milliseconds
script size=940, tags=47 -> 20 milliseconds
script size=960, tags=48 -> 19 milliseconds
script size=980, tags=49 -> 24 milliseconds
script size=1000, tags=50 -> 26 milliseconds
script size=1020, tags=51 -> 25 milliseconds
script size=1040, tags=52 -> 20 milliseconds
script size=1060, tags=53 -> 22 milliseconds
script size=1080, tags=54 -> 20 milliseconds
script size=1100, tags=55 -> 19 milliseconds
script size=1120, tags=56 -> 17 milliseconds
script size=1140, tags=57 -> 12 milliseconds
script size=1160, tags=58 -> 16 milliseconds
script size=1180, tags=59 -> 13 milliseconds
from liqp.
Related Issues (20)
- Upgrade ANTLR HOT 11
- Template errors not being stored when using liquid for loops HOT 2
- Support for Liquid's Layouts HOT 3
- Integer and Float Comparisons After Using Times Filter HOT 15
- How to modify default renderer HOT 1
- Shaded jar should exclude non-ANTLR dependencies HOT 2
- Support for `liquid` tag HOT 1
- expression errors ignored in _some_ cases HOT 1
- Template parse is deprecated HOT 3
- Issues with the new release. HOT 2
- != working as == HOT 2
- Is Template (render) thread safe? HOT 2
- when text contains UNICODE characters the parsing fails HOT 1
- Parser error "Invalid Tag: 'liquid'" HOT 2
- Support Instant datetime pattern
- Support for Instant, LocalDateTime date pattern HOT 1
- BlockNode Map render issue: String.valueOf(Map<?,?>) returns '=' instead of ':' as delimiter HOT 12
- Strict typing enforcement cannot be fully disabled HOT 3
- Applying strip_html filter to escaped html will unescape the string HOT 6
- Variable Name with Hyphen Misinterpreted in Conditional Statements HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liqp.