Git Product home page Git Product logo

Comments (5)

Ivony avatar Ivony commented on August 16, 2024

InnerText是有非常强大的副作用的方法(扫描所有子元素)。

from jumony.

nagasun avatar nagasun commented on August 16, 2024

可以设置内部缓存, 当发生内容赋值的时候向上清除缓存

from jumony.

CodingOctocat avatar CodingOctocat commented on August 16, 2024

因为习惯了 HtmlAgilityPack,所以每次调用诸如 InnerText 时都会忘记加括号。

from jumony.

Ivony avatar Ivony commented on August 16, 2024

事实上在一些未来分支里面是有尝试缓存的,但是无论如何缓存的刷新仍然不可避免的会带来性能问题,尤其是频繁大量的的修改操作,如果InnerText操作相对较少,反而不缓存能带来性能优势。

from jumony.

nagasun avatar nagasun commented on August 16, 2024

Ivony可能有点陷入性能问题的纠结中了,
客观的来说, 对性能有特别苛刻要求的环境下, 是不会使用Jumony这样的HTML结构分析器的, 而是会直接使用文字处理或者正则, 甚至是异步的获取信息缓存后使用.

对于一个模板引擎来说, 性能也绝不是Ivony的优点和卖点,

使用Ivony的环境, 大致有两类

一类是多线程任务方式运行的爬虫系统, 这类系统本身的设计就是"让他慢慢获取数据, 获取好了我再拿来用", 所以性能不是重点, 重点是用起来方便, 免去开发人员写大量复杂正则的工作.

另外一类是生成静态HTML的需求, 这类需求本身就应该被设计成异步的. 性能也不是重点.

如果存在第三类用Jumony来实时渲染模板输出到浏览器的应用, 那要么可以说它用错了场景, 要么就是项目的并发压力很小, 完全不必担心模板引擎的性能扯后腿.

from jumony.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.