Giter Club home page Giter Club logo

Comments (15)

pieroxy avatar pieroxy commented on July 24, 2024

If you've patched the lib, can you make a jsperf out of it (against the current release version) ?

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

Haven't implemented those changes currently. I'll see what I can do in my spare time when I'm off for Christmas, though.

from lz-string.

pieroxy avatar pieroxy commented on July 24, 2024

ok, thanks. Let us know.

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

Just saw another slight tweak that I'll test out when I get to the rest of this. "context_w = String(context_c);" creates a string object instead of a string literal, which is going to be slower to work with. I'll try changing it to "context_w = '' + context_c;" to get around that.

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

Alright, made a jsperf for it. The results seem about even, though I have IE11, so I'm not sure if this is really accurate, but it's slightly faster in IE9 mode, and a lil bit faster than that in IE8 mode.

http://jsperf.com/lz-string-performance-enhancement-test

from lz-string.

pieroxy avatar pieroxy commented on July 24, 2024

Thanks for the jsperf. These changes seem to be slightly beneficial to some browser while neutral to others (slightly negative for IE8 but it's IE8 so I quite don't care). In other words it looks good. I'm waiting until tomorrow in order to be able to test this on Windows to make sure I can't find a browser with a negative impact.

from lz-string.

pieroxy avatar pieroxy commented on July 24, 2024

Ah, my bad, I was reading the JSPerf backwards... So it looks like your changes are faster on IE8, neutral on IE>8 and Firefox but slower on Chrome and Safari. Doesn't look good... Unless I'm mistaken once more that is ;-)

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

well, the changes were meant to be of benefit to older engines. newer ones are fast enough that it doesn't really matter that much. actually, IIRC, chrome is optimized to handle loops based on string/array length more efficiently. Though, I began wondering after the fact if string length is ever actually recalculated. strings should be immutable, so there'd never be a need to recalculate it like an array does...

from lz-string.

pieroxy avatar pieroxy commented on July 24, 2024

Did you change something on the jsperf? Results are very different this morning... The modified code runs consistently faster than the original one on pretty much all platforms...

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

I haven't changed anything to either the jsperf or the library since I posted it. Odd that it should choose to act differently.

from lz-string.

ChALkeR avatar ChALkeR commented on July 24, 2024

The modified version is 24% slower for me on Chromium 40.

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

interesting. I'm not sure how it would've had that much of an effect in any browser, either positive or negative.

from lz-string.

ChALkeR avatar ChALkeR commented on July 24, 2024

Maybe that's because you are using the master version of lz-string and it got updated? And you haven't rebased your changes.

from lz-string.

Ixonal avatar Ixonal commented on July 24, 2024

Admittedly, I haven't messed with this since the original conversation. It's probably irrelevant at this point.

from lz-string.

pieroxy avatar pieroxy commented on July 24, 2024

Closing this issue. The performance gain wasn't clear or significant and we're going to move toward greater gains with ES6 stuff for newer browsers

from lz-string.

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.