GithubHelp home page GithubHelp logo

Speed about dart-tags HOT 11 CLOSED

nikotron avatar nikotron commented on May 31, 2024
Speed

from dart-tags.

Comments (11)

n3rfd avatar n3rfd commented on May 31, 2024 2

Thanks @Nailik this is a life saver!

To give a little more context, before adding the fix, parsing 100 mp3 files of around 80mb in total took 500+ seconds to complete and from time to time crashes my app. After the fix, it only took ~15 seconds to extract all the tags from the same number of mp3 files!

from dart-tags.

o4x avatar o4x commented on May 31, 2024 1

Thank's @NiKoTron, yeah it's solved.

from dart-tags.

NiKoTron avatar NiKoTron commented on May 31, 2024

Hi @o4x, can you explain more detailed, what do you mean by slow? Any measurements or smth. else..

from dart-tags.

o4x avatar o4x commented on May 31, 2024

@NiKoTron when I use getTagFromByteArray in my project ui lagged and when use it on isolate take one or two seconds to return tags. its very much
Can we do it faster?

from dart-tags.

NiKoTron avatar NiKoTron commented on May 31, 2024

@o4x, Actually, I think we can. Currently, library looking through the whole file while scanning tags. Of course, It isn't a cheap operation and if you have a quite big file and slow IO. It's really may become a cause of slow parse. Well, I'll plan this for the next release.

Thank you for the helpful feedback!

from dart-tags.

NiKoTron avatar NiKoTron commented on May 31, 2024

@o4x, Well I've rechecked it. The feature is that the file is reading only in the tag area has already been implemented.

I did some benchmarks and, It looks like bottleneck is file.readAsBytes(), cuz for parsing via getTagFromByteArray we must have a complete byte array of a file in the RAM.

Can you tell me what file do you parse (size and which tags) and on what's hardware do you you use (especially which kind of hard\solid state drive)?

So, I'll implement API that will accept the stream as an argument.

from dart-tags.

o4x avatar o4x commented on May 31, 2024

@NiKoTron I'm sorry I wasn't here for a while, I use profile mode in flutter and test it on my real phone .
Its specifications are as follows:

Memory Storage System on chip
4 GB LPDDR4X RAM 64 GB UFS 2.1 Snapdragon 835

And the size of my songs is about 10 Mb .

for example this song

output

I/flutter ( 3706): album: 慒楤慫�
I/flutter ( 3706): artist: 䅀捲楨敶也橡晡�
I/flutter ( 3706): genre: 汆浡湥潣
I/flutter ( 3706): title: 汁桥
I/flutter ( 3706): track: 㔰ㄯ�
I/flutter ( 3706): year: 〲㜱
I/flutter ( 3706): comment: {language:eng, description:, body:
I/flutter ( 3706): lyrics: 湥ァ�䃾牁档癩彥慎慪楦਍دنیا⠠䜆 درکㄠ䄆⨆ و⼠䜆 بی㌠ㄆ و㌠✆䔆✆䘆 شد㌠䜆䔆 من䠠 تو✠㈆ آن찠꤆ سفره찠 بی䘠✆䘆 شد਍از蘠㐆䔆 کبو倠⼆ ما†هی✠㐆꤆ بهㄠ✆䜆 افتاد✠匆䘆䈆⼆ㄆ که⠠✆ㄆ찆⼆찆䔆 تبدیل⠠䜆 باران㐠⼆ആ䜊ㄆ دوستꤠ䜆 با䔠✆ بود⼠㐆䔆䘆 شد䠠 خنجر㈠⼆ با䈠✆䄆䐆䜆 پیمان⠠㌆⨆ همꤠ✆㌆䜆 ِی⼠㈆⼆✆䘆 شد਍پ㐠 ِت䜠䔆䜆 ِی⼠ رها⼠찆䠆✆ㄆ کشیدند䠠 هی㌠䈆䄆 فرو縠✆㐆찆⼆ هی縠䘆Ⰶㄆ䜆 سیمان㐠⼆ആ䜊찆 شهد䠠 شکر⼠✆⼆䘆⼆℆䜠찆 سکه찠 زر⼠✆⼆䘆⼆℆✠匆ㄆ✆䔆 بسا倠㜆 شعر⨠⠆⼆찆䐆 به⼠꤆✆䘆 شد਍هرꤠ㌆ که⼠䐆㐆 میخواست䘠찆㈆䜆 به㈠䔆찆䘆 کوبید䜠찆 کشت䠠 تجاوزꤠㄆ⼆ تا�
I/flutter ( 3706): picture: {mime:image/jpeg, description:, bitmap: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAPoA+gDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCjZ/PNBCv9/wD1j/5/76raf5EeOOdE3zb33/xr/wABqrDc/ufLZPPdX/c/7a7furtqPTblbl0Vv3flP8n991/utX1Z+dEjzSPvaZN6fM6f30bd8tFhbXSTI0kHkIqbHj8tf33+zTkfZDPJJB

And as you can see in the example, Persian language is not supported either.

from dart-tags.

o4x avatar o4x commented on May 31, 2024

In version 0.2.3, the Persian language works well.

from dart-tags.

Nailik avatar Nailik commented on May 31, 2024

The problem i found is (for me) in id3v2.dart There the end of the information get's recognized by end = offset < size; (line 73). This is really a problem as it will scan every bytes of the song for header information including just the sound. So i changed it a little bit, when the first tag result m is null i set end = false so it will stop after last tag is read.
This should not make any problems as the song tags should not have empty tags in between.
This is the commit in my fork: aa1f777

from dart-tags.

NiKoTron avatar NiKoTron commented on May 31, 2024

hi @o4x, @n3rfd ! this issue should be solved in the latest version (0.3.0) could you please check it?

from dart-tags.

neilweber avatar neilweber commented on May 31, 2024

@o4x, Well I've rechecked it. The feature is that the file is reading only in the tag area has already been implemented.

I did some benchmarks and, It looks like bottleneck is file.readAsBytes(), cuz for parsing via getTagFromByteArray we must have a complete byte array of a file in the RAM.

Can you tell me what file do you parse (size and which tags) and on what's hardware do you you use (especially which kind of hard\solid state drive)?

So, I'll implement API that will accept the stream as an argument.

Is accepting a stream as an argument still planned?

from dart-tags.

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.