Code Monkey home page Code Monkey logo

Comments (6)

alexcorre avatar alexcorre commented on July 23, 2024

I'll fix this one. Looking into it now.

from git-blame.

alexcorre avatar alexcorre commented on July 23, 2024

Reverted to my original regex pattern in the commit above. fixes issue. will be adding unit test coverage for this file.

from git-blame.

KylePDavis avatar KylePDavis commented on July 23, 2024

Sorry I wasn't watching the repo so I missed this. There was a tiny bug in my regex that caused this to fail for the last line if it didn't end with a \n but I have that fixed now.

I'd rather we use the new parsing rather than the original for the reasons that I explained in #21.
Oh, and I can go ahead and write some tests while I'm at it, too.

Want to reopen this issue or should I create another issue for this?

from git-blame.

KylePDavis avatar KylePDavis commented on July 23, 2024

I'll fix the bug in my regex as part of fixing issue #25

from git-blame.

alexcorre avatar alexcorre commented on July 23, 2024

I think the regex we have right now is fine and I havent noticed any performance issues with it. What were the advantages of yours again?

from git-blame.

KylePDavis avatar KylePDavis commented on July 23, 2024

@alexcorre, the main feature is that it is iterative so it can handle larger data sets with a smaller memory footprint.
I ran some tests with benchmark.js and it is about 2x faster which is probably due to the smaller memory footprint and perhaps the fact that the RegExp doesn't use a lookahead.

$ node test.js
RegExp split x 56,146 ops/sec ±0.80% (92 runs sampled)
RegExp iterative x 98,484 ops/sec ±0.45% (102 runs sampled)
Fastest is RegExp iterative

I have the fixed RegExp and a couple of tests if you'd like me to make another PR.
Just let me know.

from git-blame.

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.