Giter VIP home page Giter VIP logo

Comments (1)

bryphe avatar bryphe commented on May 22, 2024

The piece table should drastically reduce the cost of inserting into large buffers, as most of the cost of our previous strategy is because we incur lots of copying / memory cost in creating new arrays when splicing. Ideally, with the piece table strategy, the cost should be the same when inserting in a large buffer or a small buffer.

In the current state of the world, as measured by #96 , that is not the case:

+----------------------------------------------------------------------------------------------------------------------------------------------+
|  BENCHMARK                                      |  TIME               |  MINOR GC  |  MAJOR GC  |  MINOR ALLOC  |  PROMOTED  |  MAJOR ALLOC  |
|-------------------------------------------------+---------------------+------------+------------+---------------+------------+---------------|
|  Buffer: Add lines to empty buffer              |  1.22300958633      |  334       |  67        |  24359        |  1627      |  100002627    |
|-------------------------------------------------+---------------------+------------+------------+---------------+------------+---------------|
|  Buffer: Insert line in middle of small buffer  |  0.000998497009277  |  1         |  0         |  244029       |  25        |  25           |
|-------------------------------------------------+---------------------+------------+------------+---------------+------------+---------------|
|  Buffer: Insert line in middle of large buffer  |  0.546031951904     |  401       |  80        |  42349        |  3945      |  110005945    |
|-------------------------------------------------+---------------------+------------+------------+---------------+------------+---------------|
|  Buffer: Clear large buffer                     |  0.                 |  1         |  0         |  19029        |  25        |  25           |

from oni2.

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.